atrilabs-engine icon indicating copy to clipboard operation
atrilabs-engine copied to clipboard

Add a Switch Component

Open diptitiwari2917 opened this issue 1 year ago • 10 comments

This issue is added to support new components to Atri app

As we started using Ant Design, so here also we can use Switch Antd Component to create resusable one https://ant.design/components/switch

All the possible props are added below:

type SwitchProps = {
       styles: React.CSSProperties;
       className: string;
       custom: { 		
        // Whether get focus when component mounted. default: false
		autoFocus: boolean; 
		// Determine whether the Switch is checked. default: false
		checked: boolean;
		// The content to be shown when the state is checked
		checkedChildren: ReactNode;
        // The content to be shown when the state is unchecked
		unCheckedChildren: ReactNode;
		// Whether to set checked in initial state. default: false
        defaultChecked: boolean;
		// Disable switch. default: false
		disabled: boolean
        // Loading state of switch. default: false
        loading: boolean;
        // The size of the Switch, options: default | small. default: default
		size: string;
		// Trigger when the checked state is changing
		onChange: function(checked: boolean, event: Event);
        // Trigger when clicked
        onClick: function(checked: boolean, event: Event);
       };
};
export const SwitchProps: React.FC<SwitchProps> = React.forwardRef(
  (ref, props) => {
    return <div ></div>;
  }
);

image image image image

diptitiwari2917 avatar Mar 23 '23 13:03 diptitiwari2917

Hello there! Welcome to the project! 💖

Thank you for opening your very first issue here. Hope you have a great time here!😄

Besides, don’t forget to ⭐ the repository, if you haven’t already!

welcome[bot] avatar Mar 23 '23 13:03 welcome[bot]

Hey I would like to work on this . Can you assign it to me ?

SksOp avatar Mar 23 '23 15:03 SksOp

Hey I would like to work on this. Can you assign it to me ?

@SksOp you can go ahead and start working on it.

cruxcode avatar Mar 23 '23 16:03 cruxcode

@cruxcode I was able to complete the build steps when I started working on this. But due to some system failures my files were deleted.
I am trying to make the build version again as per this Discussion #655 But its not getting build on step 5 "Run yarn build inside @atrilabs/commands package."

The error is something like this

`$ yarn build yarn run v1.22.19 $ concurrently 'yarn build-app-dev' 'yarn build-dev-editor' 'yarn build-manifest-registry' 'yarn build-gen-py-classes' 'yarn build-gen-py-app' 'yarn build-dev-py-app' 'yarn build-build-editor' 'yarn build-create-atri-app' 'yarn build-build-atri-app' 'yarn build-compute-init-state' 'yarn build-serve'

[0] ''yarn' is not recognized as an internal or external command,

[0] operable program or batch file.

[1] 'build-app-dev'' is not recognized as an internal or external command,

[1] operable program or batch file.

[2] ''yarn' is not recognized as an internal or external command,

[2] operable program or batch file.

[3] 'build-dev-editor'' is not recognized as an internal or external command,

[3] operable program or batch file.

[4] ''yarn' is not recognized as an internal or external command,

[4] operable program or batch file.

[5] 'build-manifest-registry'' is not recognized as an internal or external command,

[5] operable program or batch file.

[6] ''yarn' is not recognized as an internal or external command,

[6] operable program or batch file.

[7] 'build-gen-py-classes'' is not recognized as an internal or external command,

[7] operable program or batch file.

[8] ''yarn' is not recognized as an internal or external command,

[8] operable program or batch file.

[9] 'build-gen-py-app'' is not recognized as an internal or external command,

[9] operable program or batch file.

[10] ''yarn' is not recognized as an internal or external command,

[10] operable program or batch file.

[11] 'build-dev-py-app'' is not recognized as an internal or external command,

[11] operable program or batch file.

[12] ''yarn' is not recognized as an internal or external command,

[12] operable program or batch file.

[13] 'build-build-editor'' is not recognized as an internal or external command,

[13] operable program or batch file.

[14] ''yarn' is not recognized as an internal or external command,

[14] operable program or batch file.

[15] 'build-create-atri-app'' is not recognized as an internal or external command,

[15] operable program or batch file.

[16] ''yarn' is not recognized as an internal or external command,

[16] operable program or batch file.

[17] 'build-build-atri-app'' is not recognized as an internal or external command,

[17] operable program or batch file.

[18] ''yarn' is not recognized as an internal or external command,

[18] operable program or batch file.

[19] 'build-compute-init-state'' is not recognized as an internal or external command,

[19] operable program or batch file.

[20] ''yarn' is not recognized as an internal or external command,

[20] operable program or batch file.

[20] 'yarn exited with code 1

[19] build-compute-init-state' exited with code 1

[18] 'yarn exited with code 1

[17] build-build-atri-app' exited with code 1

[16] 'yarn exited with code 1

[15] build-create-atri-app' exited with code 1

[14] 'yarn exited with code 1

[13] build-build-editor' exited with code 1

[12] 'yarn exited with code 1

[11] build-dev-py-app' exited with code 1

[10] 'yarn exited with code 1

[9] build-gen-py-app' exited with code 1

[8] 'yarn exited with code 1

[7] build-gen-py-classes' exited with code 1

[6] 'yarn exited with code 1

[5] build-manifest-registry' exited with code 1

[4] 'yarn exited with code 1

[3] build-dev-editor' exited with code 1

[2] 'yarn exited with code 1

[1] build-app-dev' exited with code 1

[0] 'yarn exited with code 1

[21] 'build-serve'' is not recognized as an internal or external command,

[21] operable program or batch file.

[21] build-serve' exited with code 1

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

SksOp avatar Apr 03 '23 23:04 SksOp

@cruxcode I was able to complete the build steps when I started working on this. But due to some system failures my files were deleted. I am trying to make the build version again as per this Discussion #655 But its not getting build on step 5 "Run yarn build inside @atrilabs/commands package."

The error is something like this

`$ yarn build yarn run v1.22.19 $ concurrently 'yarn build-app-dev' 'yarn build-dev-editor' 'yarn build-manifest-registry' 'yarn build-gen-py-classes' 'yarn build-gen-py-app' 'yarn build-dev-py-app' 'yarn build-build-editor' 'yarn build-create-atri-app' 'yarn build-build-atri-app' 'yarn build-compute-init-state' 'yarn build-serve'

[0] ''yarn' is not recognized as an internal or external command,

[0] operable program or batch file.

[1] 'build-app-dev'' is not recognized as an internal or external command,

[1] operable program or batch file.

[2] ''yarn' is not recognized as an internal or external command,

[2] operable program or batch file.

[3] 'build-dev-editor'' is not recognized as an internal or external command,

[3] operable program or batch file.

[4] ''yarn' is not recognized as an internal or external command,

[4] operable program or batch file.

[5] 'build-manifest-registry'' is not recognized as an internal or external command,

[5] operable program or batch file.

[6] ''yarn' is not recognized as an internal or external command,

[6] operable program or batch file.

[7] 'build-gen-py-classes'' is not recognized as an internal or external command,

[7] operable program or batch file.

[8] ''yarn' is not recognized as an internal or external command,

[8] operable program or batch file.

[9] 'build-gen-py-app'' is not recognized as an internal or external command,

[9] operable program or batch file.

[10] ''yarn' is not recognized as an internal or external command,

[10] operable program or batch file.

[11] 'build-dev-py-app'' is not recognized as an internal or external command,

[11] operable program or batch file.

[12] ''yarn' is not recognized as an internal or external command,

[12] operable program or batch file.

[13] 'build-build-editor'' is not recognized as an internal or external command,

[13] operable program or batch file.

[14] ''yarn' is not recognized as an internal or external command,

[14] operable program or batch file.

[15] 'build-create-atri-app'' is not recognized as an internal or external command,

[15] operable program or batch file.

[16] ''yarn' is not recognized as an internal or external command,

[16] operable program or batch file.

[17] 'build-build-atri-app'' is not recognized as an internal or external command,

[17] operable program or batch file.

[18] ''yarn' is not recognized as an internal or external command,

[18] operable program or batch file.

[19] 'build-compute-init-state'' is not recognized as an internal or external command,

[19] operable program or batch file.

[20] ''yarn' is not recognized as an internal or external command,

[20] operable program or batch file.

[20] 'yarn exited with code 1

[19] build-compute-init-state' exited with code 1

[18] 'yarn exited with code 1

[17] build-build-atri-app' exited with code 1

[16] 'yarn exited with code 1

[15] build-create-atri-app' exited with code 1

[14] 'yarn exited with code 1

[13] build-build-editor' exited with code 1

[12] 'yarn exited with code 1

[11] build-dev-py-app' exited with code 1

[10] 'yarn exited with code 1

[9] build-gen-py-app' exited with code 1

[8] 'yarn exited with code 1

[7] build-gen-py-classes' exited with code 1

[6] 'yarn exited with code 1

[5] build-manifest-registry' exited with code 1

[4] 'yarn exited with code 1

[3] build-dev-editor' exited with code 1

[2] 'yarn exited with code 1

[1] build-app-dev' exited with code 1

[0] 'yarn exited with code 1

[21] 'build-serve'' is not recognized as an internal or external command,

[21] operable program or batch file.

[21] build-serve' exited with code 1

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

@SksOp please install yarn by running npm i -g yarn.

cruxcode avatar Apr 04 '23 03:04 cruxcode

Can I work on this issue if this is still open?

faraz16iqbal avatar Apr 13 '23 01:04 faraz16iqbal

I complete the build steps . but now I am getting this issue in the Atri editor console after building image I am unable to drag components in the browser's editor served by @atrilabs/pwa-builder .

There was also an issue with the new example-atri-app in example-atri-app/pages/index.jsx the import for logo should be import YCLogo from "../public/assets/yc_logo.png";

Can you please review the build process for development. Also I am newbie , if i am misunderstanding some thing please help me out. Thanks

SksOp avatar Apr 15 '23 10:04 SksOp

@faraz16iqbal @SksOp this issue is still open. @SksOp please connect with me in the Slack community and we can setup a call to resolve your issue.

cruxcode avatar Apr 28 '23 16:04 cruxcode

hey @cruxcode do I need to create Switch.tsx and Switch.manifest.tsx file like iFrame component for building switch component ?

subhajit20 avatar May 01 '23 15:05 subhajit20

Can I take a dab at this issue @cruxcode ?

alceil avatar Sep 07 '23 07:09 alceil