-
Notifications
You must be signed in to change notification settings - Fork 2
Add examples to documentation and fix components #38
Conversation
30c0370
to
9a3171e
Compare
src/ui/atoms/button/usage.mdx
Outdated
```tsx | ||
const Example = () => ( | ||
<button.Primary text="Hello world" onClick={(event) => console.info('Hi!')} /> | ||
```tsx const Example = () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tsx const Example = () => ( | |
```tsx | |
const Example = () => ( |
src/ui/molecules/toggle/example.tsx
Outdated
const [isConfirmOn, setConfirmOn] = React.useState(false); | ||
const [isSubscribeOn, setSubscribeOn] = React.useState(false); | ||
|
||
const onConfirmClick = React.useCallback(() => { | ||
setConfirmOn(!isConfirmOn); | ||
}, [isConfirmOn]); | ||
|
||
const onSubscribeClick = React.useCallback(() => { | ||
setSubscribeOn(!isSubscribeOn); | ||
}, [isSubscribeOn]); | ||
|
||
React.useEffect(() => { | ||
setSubscribeOn(true); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isConfirmOn, setConfirmOn] = React.useState(false); | |
const [isSubscribeOn, setSubscribeOn] = React.useState(false); | |
const onConfirmClick = React.useCallback(() => { | |
setConfirmOn(!isConfirmOn); | |
}, [isConfirmOn]); | |
const onSubscribeClick = React.useCallback(() => { | |
setSubscribeOn(!isSubscribeOn); | |
}, [isSubscribeOn]); | |
React.useEffect(() => { | |
setSubscribeOn(true); | |
}, []); | |
const [isConfirmOn, onConfirmClick] = React.useReducer((on) => !on, false) | |
const [isSubscribeOn, onSubscribeClick] = React.useReducer((on) => !on, true) |
const [isPassportChecked, setPassport] = React.useState(false); | ||
const [isMoneyChecked, setMoney] = React.useState(false); | ||
const [isTicketsChecked, setTickets] = React.useState(false); | ||
|
||
const onPassportClick = React.useCallback(() => { | ||
setPassport(!isPassportChecked); | ||
}, [isPassportChecked]); | ||
|
||
const onMoneyClick = React.useCallback(() => { | ||
setMoney(!isPassportChecked); | ||
}, [isPassportChecked]); | ||
|
||
const onTicketsClick = React.useCallback(() => { | ||
setTickets(!isPassportChecked); | ||
}, [isPassportChecked]); | ||
|
||
React.useEffect(() => { | ||
setPassport(true); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isPassportChecked, setPassport] = React.useState(false); | |
const [isMoneyChecked, setMoney] = React.useState(false); | |
const [isTicketsChecked, setTickets] = React.useState(false); | |
const onPassportClick = React.useCallback(() => { | |
setPassport(!isPassportChecked); | |
}, [isPassportChecked]); | |
const onMoneyClick = React.useCallback(() => { | |
setMoney(!isPassportChecked); | |
}, [isPassportChecked]); | |
const onTicketsClick = React.useCallback(() => { | |
setTickets(!isPassportChecked); | |
}, [isPassportChecked]); | |
React.useEffect(() => { | |
setPassport(true); | |
}, []); | |
const [isPassportChecked, onPassportClick] = React.useReducer((ch) => !ch, true); | |
const [isMoneyChecked, onMoneyClick] = React.useReducer((ch) => !ch, false); | |
const [isTicketsChecked, onTicketsClick] = React.useReducer((ch) => !ch, false); |
src/ui/atoms/surface/example.tsx
Outdated
const [isOpen, setOpen] = React.useState(false); | ||
const onClick = React.useCallback(() => { | ||
setOpen(!isOpen); | ||
}, [isOpen]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isOpen, setOpen] = React.useState(false); | |
const onClick = React.useCallback(() => { | |
setOpen(!isOpen); | |
}, [isOpen]); | |
const [isOpen, onClick] = React.useReducer((is) => !is, false); | |
src/ui/atoms/popover/example.tsx
Outdated
const [isOpen, setOpen] = React.useState(false); | ||
const onClick = React.useCallback(() => { | ||
setOpen(!isOpen); | ||
}, [isOpen]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isOpen, setOpen] = React.useState(false); | |
const onClick = React.useCallback(() => { | |
setOpen(!isOpen); | |
}, [isOpen]); | |
const [isOpen, onClick] = React.useReducer((is) => !is, false); |
const [isVisible, setVisibility] = React.useState(false); | ||
const onClick = React.useCallback(() => { | ||
setVisibility(!isVisible); | ||
}, [isVisible]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [isVisible, setVisibility] = React.useState(false); | |
const onClick = React.useCallback(() => { | |
setVisibility(!isVisible); | |
}, [isVisible]); | |
const [isVisible, onClick] = React.useReducer((is) => !is, false); |
9a3171e
to
a2a0c40
Compare
Add examples to documentation, add documentation to menuList and notification, fix components bugs.