Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Add examples to documentation and fix components #38

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

tatinacher
Copy link
Member

Add examples to documentation, add documentation to menuList and notification, fix components bugs.

@tatinacher tatinacher added the documentation Improvements or additions to documentation label Sep 15, 2020
@github-actions github-actions bot added @atoms Changes inside atoms @molecules lib labels Sep 15, 2020
@tatinacher tatinacher changed the title Add examples to documentation and fix components WIP: Add examples to documentation and fix components Sep 15, 2020
@tatinacher tatinacher force-pushed the docs/RBL-276-add-examples-to-documentation branch from 30c0370 to 9a3171e Compare September 16, 2020 09:21
@tatinacher tatinacher changed the title WIP: Add examples to documentation and fix components Add examples to documentation and fix components Sep 16, 2020
```tsx
const Example = () => (
<button.Primary text="Hello world" onClick={(event) => console.info('Hi!')} />
```tsx const Example = () => (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```tsx const Example = () => (
```tsx
const Example = () => (

Comment on lines 7 to 20
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);
}, []);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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)

Comment on lines 7 to 25
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);
}, []);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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);

Comment on lines 7 to 8
const [isOpen, setOpen] = React.useState(false);
const onClick = React.useCallback(() => {
setOpen(!isOpen);
}, [isOpen]);

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const [isOpen, setOpen] = React.useState(false);
const onClick = React.useCallback(() => {
setOpen(!isOpen);
}, [isOpen]);
const [isOpen, onClick] = React.useReducer((is) => !is, false);

Comment on lines 7 to 10
const [isOpen, setOpen] = React.useState(false);
const onClick = React.useCallback(() => {
setOpen(!isOpen);
}, [isOpen]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const [isOpen, setOpen] = React.useState(false);
const onClick = React.useCallback(() => {
setOpen(!isOpen);
}, [isOpen]);
const [isOpen, onClick] = React.useReducer((is) => !is, false);

Comment on lines 8 to 11
const [isVisible, setVisibility] = React.useState(false);
const onClick = React.useCallback(() => {
setVisibility(!isVisible);
}, [isVisible]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const [isVisible, setVisibility] = React.useState(false);
const onClick = React.useCallback(() => {
setVisibility(!isVisible);
}, [isVisible]);
const [isVisible, onClick] = React.useReducer((is) => !is, false);

@tatinacher tatinacher force-pushed the docs/RBL-276-add-examples-to-documentation branch from 9a3171e to a2a0c40 Compare September 16, 2020 10:44
@sergeysova sergeysova merged commit fd84ae6 into master Sep 16, 2020
@sergeysova sergeysova deleted the docs/RBL-276-add-examples-to-documentation branch September 16, 2020 11:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@atoms Changes inside atoms documentation Improvements or additions to documentation lib @molecules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants