Skip to content

Commit

Permalink
chore: Reformat readme
Browse files Browse the repository at this point in the history
  • Loading branch information
y-lohse committed Jul 30, 2020
1 parent 750c49f commit 74f54ff
Showing 1 changed file with 77 additions and 56 deletions.
133 changes: 77 additions & 56 deletions react/Labs/ExperimentalDialog/Readme.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,108 @@
## Experimental Dialog

### With default Actions (mobile and desktop)

```jsx
import ExperimentalDialog, {ExperimentalDialogTitle, ExperimentalDialogActions} from './index';
import MuiCozyTheme from '../../MuiCozyTheme/';
import ExperimentalDialog, {
ExperimentalDialogTitle,
ExperimentalDialogActions
} from './index'
import MuiCozyTheme from '../../MuiCozyTheme/'

import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import Divider from '@material-ui/core/Divider';
import DialogCloseButton from '../../MuiCozyTheme/Dialog/DialogCloseButton';
import Button from '../../Button';
import DialogContent from '@material-ui/core/DialogContent'
import DialogContentText from '@material-ui/core/DialogContentText'
import Divider from '@material-ui/core/Divider'
import DialogCloseButton from '../../MuiCozyTheme/Dialog/DialogCloseButton'
import Button from '../../Button'

const onClose = () => setState({ modalOpened: !state.modalOpened })

initialState = { modalOpened: isTesting()};
<>
<button onClick={()=>setState({ modalOpened: !state.modalOpened })}>
initialState = { modalOpened: isTesting() }
;<>
<button onClick={() => setState({ modalOpened: !state.modalOpened })}>
Toggle modal
</button>
<MuiCozyTheme>

<ExperimentalDialog open={state.modalOpened} onClose={() => onClose()}>
<DialogCloseButton onClick={() =>onClose()} />
<ExperimentalDialogTitle>Ada Lovelace</ExperimentalDialogTitle>
<Divider />
<DialogContent>
Augusta Ada King-Noel, Countess of Lovelace (née Byron; 10 December 181527 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation, and published the first algorithm intended to be carried out by such a machine. As a result, she is often regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.
</DialogContent>
<ExperimentalDialogActions>
<MuiCozyTheme>
<ExperimentalDialog open={state.modalOpened} onClose={() => onClose()}>
<DialogCloseButton onClick={() => onClose()} />
<ExperimentalDialogTitle>Ada Lovelace</ExperimentalDialogTitle>
<Divider />
<DialogContent>
Augusta Ada King-Noel, Countess of Lovelace (née Byron; 10 December 1815
27 November 1852) was an English mathematician and writer, chiefly
known for her work on Charles Babbage's proposed mechanical
general-purpose computer, the Analytical Engine. She was the first to
recognise that the machine had applications beyond pure calculation, and
published the first algorithm intended to be carried out by such a
machine. As a result, she is often regarded as the first to recognise
the full potential of a "computing machine" and the first computer
programmer.
</DialogContent>
<ExperimentalDialogActions>
<Button
theme="secondary"
onClick={() => onClose()}
label={'Close Modal'}
theme="secondary"
onClick={() => onClose()}
label={'Close Modal'}
/>
<Button
theme="primary"
label={'Touch Me'}
onClick={() => alert('click')}
theme="primary"
label={'Touch Me'}
onClick={() => alert('click')}
/>
</ExperimentalDialogActions>
</ExperimentalDialog>
</ExperimentalDialogActions>
</ExperimentalDialog>
</MuiCozyTheme>
</>
</>
```
### With "below" Actions (mobile)
```jsx
import ExperimentalDialog, {ExperimentalDialogTitle, ExperimentalDialogActions} from './index';
import MuiCozyTheme from '../../MuiCozyTheme/';
import ExperimentalDialog, {
ExperimentalDialogTitle,
ExperimentalDialogActions
} from './index'
import MuiCozyTheme from '../../MuiCozyTheme/'
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogCloseButton from '../../MuiCozyTheme/Dialog/DialogCloseButton';
import Button from '../../Button';
import DialogContent from '@material-ui/core/DialogContent'
import DialogContentText from '@material-ui/core/DialogContentText'
import DialogCloseButton from '../../MuiCozyTheme/Dialog/DialogCloseButton'
import Button from '../../Button'
const onClose = () => setState({ modalOpened: !state.modalOpened })
initialState = { modalOpened: isTesting()};
<>
<button onClick={()=>setState({ modalOpened: !state.modalOpened })}>
initialState = { modalOpened: isTesting() }
;<>
<button onClick={() => setState({ modalOpened: !state.modalOpened })}>
Toggle modal
</button>
<MuiCozyTheme>
<ExperimentalDialog open={state.modalOpened} onClose={() => onClose()}>
<DialogCloseButton onClick={() =>onClose()} />
<ExperimentalDialogTitle>Ada Lovelace</ExperimentalDialogTitle>
<DialogContent>
Augusta Ada King-Noel, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation, and published the first algorithm intended to be carried out by such a machine. As a result, she is often regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.
</DialogContent>
<ExperimentalDialogActions layout="row">
<MuiCozyTheme>
<ExperimentalDialog open={state.modalOpened} onClose={() => onClose()}>
<DialogCloseButton onClick={() => onClose()} />
<ExperimentalDialogTitle>Ada Lovelace</ExperimentalDialogTitle>
<DialogContent>
Augusta Ada King-Noel, Countess of Lovelace (née Byron; 10 December 1815
– 27 November 1852) was an English mathematician and writer, chiefly
known for her work on Charles Babbage's proposed mechanical
general-purpose computer, the Analytical Engine. She was the first to
recognise that the machine had applications beyond pure calculation, and
published the first algorithm intended to be carried out by such a
machine. As a result, she is often regarded as the first to recognise
the full potential of a "computing machine" and the first computer
programmer.
</DialogContent>
<ExperimentalDialogActions layout="row">
<Button
theme="secondary"
onClick={() => onClose()}
label={'Close Modal'}
theme="secondary"
onClick={() => onClose()}
label={'Close Modal'}
/>
<Button
theme="primary"
label={'Touch Me'}
onClick={() => alert('click')}
theme="primary"
label={'Touch Me'}
onClick={() => alert('click')}
/>
</ExperimentalDialogActions>
</ExperimentalDialog>
</ExperimentalDialogActions>
</ExperimentalDialog>
</MuiCozyTheme>
</>
```
Expand Down

0 comments on commit 74f54ff

Please sign in to comment.