Skip to content

Feature/pui 6/switch component#116

Open
JDsmile wants to merge 17 commits intomasterfrom
feature/pui-6/switchComponent
Open

Feature/pui 6/switch component#116
JDsmile wants to merge 17 commits intomasterfrom
feature/pui-6/switchComponent

Conversation

@JDsmile
Copy link
Collaborator

@JDsmile JDsmile commented Sep 21, 2022

PUI-6 Switch Component

Copy link
Collaborator

@asimbhdr96 asimbhdr96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your storybook please add different colors also for the default switch make the circular toggle different color than the slider both are gray maybe for the default one use white color slider gray

//in controlled component, the input’s(switch) value is always driven by the React state.

const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
// setShowOn((prev) => !prev);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary code

expect(checkbox).not.toBeChecked();
fireEvent.click(checkbox);
expect(checkbox).toBeChecked();
// expect(checkbox).toHaveAttribute('checked', 'true');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused code

margin-left: $margin-l;
margin-top: $margin-r;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put those mixins into the general mixin file

@@ -0,0 +1,4 @@
$switch-primary: rgba(32, 201, 151, 0.8);
$switch-secondary: rgba(108, 117, 125, 0.8);
$switch-primary-hover: 0 0 0 3px rgba(32, 201, 151, 0.2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also put them into the general variables file

@import '../components/Card/Card';
@import '../components/Progress/Progress';

//Switch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants