|
| 1 | +import { |
| 2 | + ButtonWithLoading, |
| 3 | + PasswordField, |
| 4 | + ImageUploader, |
| 5 | +} from '@baseapp-frontend/design-system-mui' |
| 6 | +import { Divider, useTheme } from '@mui/material' |
| 7 | +import { useState } from 'react' |
| 8 | + |
1 | 9 | export default function Docs() { |
| 10 | + const [images, setImages] = useState([]) |
| 11 | + const theme = useTheme() |
2 | 12 | return ( |
3 | 13 | <div> |
4 | | - <h1>Docs</h1> |
| 14 | + <h1>Components demo</h1> |
| 15 | + <Divider style={{ margin: theme.spacing(2, 0) }} /> |
| 16 | + |
| 17 | + <h2>{`<ButtonWithLoading>`}</h2> |
| 18 | + <div style={{ width: theme.spacing(48), display: 'flex', flexDirection: 'column' }}> |
| 19 | + <ButtonWithLoading variant="contained" style={{ margin: theme.spacing(2, 0) }}> |
| 20 | + button |
| 21 | + </ButtonWithLoading> |
| 22 | + |
| 23 | + <ButtonWithLoading variant="contained" loading> |
| 24 | + button |
| 25 | + </ButtonWithLoading> |
| 26 | + </div> |
| 27 | + |
| 28 | + <Divider style={{ margin: theme.spacing(2, 0) }} /> |
| 29 | + |
| 30 | + <div style={{ width: theme.spacing(48) }}> |
| 31 | + <h2>{`<PasswordField />`}</h2> |
| 32 | + <PasswordField /> |
| 33 | + |
| 34 | + <PasswordField helperText="Type your password." /> |
| 35 | + |
| 36 | + <PasswordField error helperText="Incorrect entry." /> |
| 37 | + </div> |
| 38 | + |
| 39 | + <Divider style={{ margin: theme.spacing(2, 0) }} /> |
| 40 | + |
| 41 | + <h2>{`<ImageUploader />`}</h2> |
| 42 | + <div style={{ width: theme.spacing(48) }}> |
| 43 | + <ImageUploader |
| 44 | + images={images} |
| 45 | + setImages={setImages} |
| 46 | + name="imageUploeader" |
| 47 | + ImageProps={{ style: { outline: '1px solid blue' } }} |
| 48 | + buttonLabel="Upload your image here" |
| 49 | + buttonRemoveLabel="Remove" |
| 50 | + /> |
| 51 | + </div> |
5 | 52 | </div> |
6 | 53 | ) |
7 | 54 | } |
0 commit comments