|
1 | 1 | A banner with a progress bar at the bottom. |
2 | 2 |
|
3 | 3 | ```jsx |
4 | | -import useProgression from 'cozy-ui/transpiled/react/helpers/useProgression' |
5 | | -import ProgressionBanner from 'cozy-ui/transpiled/react/ProgressionBanner' |
6 | | -import Icon from 'cozy-ui/transpiled/react/Icon' |
7 | | -import CloudSync from 'cozy-ui/transpiled/react/Icons/CloudSync' |
8 | | -import Variants from 'cozy-ui/docs/components/Variants' |
9 | | -import MuiButton from 'cozy-ui/transpiled/react/Button' |
10 | | -import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints' |
| 4 | +import useProgression from "cozy-ui/transpiled/react/helpers/useProgression"; |
| 5 | +import ProgressionBanner from "cozy-ui/transpiled/react/ProgressionBanner"; |
| 6 | +import Icon from "cozy-ui/transpiled/react/Icon"; |
| 7 | +import CloudSync from "cozy-ui/transpiled/react/Icons/CloudSync2"; |
| 8 | +import Variants from "cozy-ui/docs/components/Variants"; |
| 9 | +import MuiButton from "cozy-ui/transpiled/react/Button"; |
| 10 | +import { BreakpointsProvider } from "cozy-ui/transpiled/react/providers/Breakpoints"; |
11 | 11 |
|
12 | | -const { progression } = useProgression() |
| 12 | +const { progression } = useProgression(); |
13 | 13 |
|
14 | 14 | const initialVariants = [ |
15 | | - { withValue: true, progressBar: true, withButton: false } |
16 | | -] |
17 | | - |
18 | | -; |
| 15 | + { withValue: true, progressBar: true, withButton: false }, |
| 16 | +]; |
19 | 17 |
|
20 | 18 | <BreakpointsProvider> |
21 | 19 | <Variants initialVariants={initialVariants}> |
22 | | - {variant => ( |
| 20 | + {(variant) => ( |
23 | 21 | <ProgressionBanner |
24 | 22 | progressBar={variant.progressBar} |
25 | 23 | value={variant.withValue && progression} |
26 | | - text={variant.withButton ? "Storage limit nearly reached" : "4 remaining items"} |
| 24 | + text={ |
| 25 | + variant.withButton |
| 26 | + ? "Storage limit nearly reached" |
| 27 | + : "4 remaining items" |
| 28 | + } |
27 | 29 | icon={<Icon icon={CloudSync} />} |
28 | | - button={variant.withButton && <MuiButton color='primary' onClick={() => alert("Clicked!")}> |
29 | | - Manage your storage space |
30 | | - </MuiButton>} |
| 30 | + button={ |
| 31 | + variant.withButton && ( |
| 32 | + <MuiButton color="primary" onClick={() => alert("Clicked!")}> |
| 33 | + Manage your storage space |
| 34 | + </MuiButton> |
| 35 | + ) |
| 36 | + } |
31 | 37 | /> |
32 | 38 | )} |
33 | 39 | </Variants> |
34 | | -</BreakpointsProvider> |
| 40 | +</BreakpointsProvider>; |
35 | 41 | ``` |
0 commit comments