Atri-Labs / atrilabs-engine

🧘‍♂️ Open-source no-code & code web app builder
https://atrilabs.com
GNU General Public License v3.0
4.12k stars 182 forks source link

Add a Switch Component #745

Open diptitiwari2917 opened 1 year ago

diptitiwari2917 commented 1 year ago

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

welcome[bot] commented 1 year ago

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!

SksOp commented 1 year ago

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

cruxcode commented 1 year ago

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

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

SksOp commented 1 year ago

@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.`

cruxcode commented 1 year ago

@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.

faraz16iqbal commented 1 year ago

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

SksOp commented 1 year ago

I complete the build steps . but now I am getting this issue in the Atri editorconsole 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

cruxcode commented 1 year ago

@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.

subhajit20 commented 1 year ago

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

alceil commented 1 year ago

Can I take a dab at this issue @cruxcode ?