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

create switch and toggle social media component #44

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

hxsggsz
Copy link
Contributor

@hxsggsz hxsggsz commented Aug 10, 2023

On this pull request i make a toggle social media with a switch component using the checkbox input as a base for it

The toggle social media component

To use this component you need to pass as props the social media name, here is the code example:

import { ToggleSocialMedia } from './components/toggleSocialMedia';

function App() {
  return (
	<ToggleSocialMedia socialMedia="Facebook" />
  );

}
  
export default App;

The final result:

2023-08-07-19-04-12

How to use the switch component on your code:

You will need to pass two props to the component: the checked state as a boolean and the setChecked

here is an example in code how to use it

function App() {
  const [checked, setChecked] = useState(false);

  return (
      <Switch checked={checked} setChecked={setChecked} />
  );

}

  

export default App;

Final result of the switch component

2023-08-07-18-51-24

Copy link
Member

@aalmeida00 aalmeida00 left a comment

Choose a reason for hiding this comment

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

lets goooo

@Alecell Alecell merged commit 28642ab into develop Aug 10, 2023
This was referenced Aug 10, 2023
@aalmeida00 aalmeida00 deleted the 35268942 branch December 10, 2023 04:33
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.

None yet

3 participants