Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Switch Component #745

Open
diptitiwari2917 opened this issue Mar 23, 2023 · 10 comments
Open

Add a Switch Component #745

diptitiwari2917 opened this issue Mar 23, 2023 · 10 comments
Assignees
Labels
create-component Create a component for visual editor good first issue Good for newcomers

Comments

@diptitiwari2917
Copy link
Collaborator

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 diptitiwari2917 added good first issue Good for newcomers create-component Create a component for visual editor labels Mar 23, 2023
@welcome
Copy link

welcome bot commented Mar 23, 2023

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
Copy link

SksOp commented Mar 23, 2023

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

@cruxcode
Copy link
Collaborator

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
Copy link

SksOp commented Apr 3, 2023

@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
Copy link
Collaborator

cruxcode commented Apr 4, 2023

@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
Copy link

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

@SksOp
Copy link

SksOp commented Apr 15, 2023

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

@cruxcode
Copy link
Collaborator

@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
Copy link

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

@alceil
Copy link

alceil commented Sep 7, 2023

Can I take a dab at this issue @cruxcode ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-component Create a component for visual editor good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants