|
1 | 1 | import React from 'react'; |
2 | 2 |
|
3 | 3 | import { useEnvironment } from '../../contexts'; |
4 | | -import { Flex, Icon, Link, Text } from '../../customizables'; |
| 4 | +import { Col, Flex, Icon, Link, Text } from '../../customizables'; |
5 | 5 | import { LogoMark } from '../../icons'; |
6 | 6 | import type { PropsOfComponent } from '../../styledSystem'; |
| 7 | +import { DevModeNotice } from '../DevModeNotice'; |
7 | 8 | import { Card } from '.'; |
8 | 9 |
|
9 | 10 | export const CardClerkAndPagesTag = React.memo( |
10 | | - React.forwardRef<HTMLDivElement, PropsOfComponent<typeof Flex> & { withFooterPages?: boolean }>((props, ref) => { |
11 | | - const { sx, withFooterPages = false, ...rest } = props; |
12 | | - const { branded } = useEnvironment().displayConfig; |
| 11 | + React.forwardRef< |
| 12 | + HTMLDivElement, |
| 13 | + PropsOfComponent<typeof Flex> & { withFooterPages?: boolean; withDevModeNotice?: boolean } |
| 14 | + >((props, ref) => { |
| 15 | + const { sx, withFooterPages = false, withDevModeNotice = false, ...rest } = props; |
| 16 | + const { displayConfig } = useEnvironment(); |
13 | 17 |
|
14 | | - if (!(branded || withFooterPages)) { |
| 18 | + if (!(displayConfig.branded || withFooterPages)) { |
15 | 19 | return null; |
16 | 20 | } |
17 | 21 |
|
18 | 22 | return ( |
19 | | - <Flex |
20 | | - sx={[ |
21 | | - t => ({ |
22 | | - ':has(div:only-child)': { |
23 | | - justifyContent: 'center', |
24 | | - }, |
25 | | - justifyContent: 'space-between', |
26 | | - width: '100%', |
27 | | - padding: `0 ${t.space.$8}`, |
28 | | - }), |
29 | | - sx, |
30 | | - ]} |
31 | | - {...rest} |
32 | | - ref={ref} |
| 23 | + <Col |
| 24 | + sx={t => ({ |
| 25 | + gap: t.space.$2, |
| 26 | + marginLeft: 'auto', |
| 27 | + marginRight: 'auto', |
| 28 | + width: '100%', |
| 29 | + justifyContent: 'center', |
| 30 | + alignItems: 'center', |
| 31 | + })} |
33 | 32 | > |
34 | | - {branded && ( |
35 | | - <Flex |
36 | | - gap={1} |
37 | | - align='center' |
38 | | - justify='center' |
39 | | - sx={t => ({ color: t.colors.$colorTextSecondary })} |
40 | | - > |
41 | | - <> |
42 | | - <Text variant='buttonSmall'>Secured by</Text> |
43 | | - <LogoMarkIconLink /> |
44 | | - </> |
45 | | - </Flex> |
46 | | - )} |
| 33 | + <Flex |
| 34 | + sx={[ |
| 35 | + t => ({ |
| 36 | + ':has(div:only-child)': { |
| 37 | + justifyContent: 'center', |
| 38 | + }, |
| 39 | + justifyContent: 'space-between', |
| 40 | + width: '100%', |
| 41 | + padding: `0 ${t.space.$8}`, |
| 42 | + }), |
| 43 | + sx, |
| 44 | + ]} |
| 45 | + {...rest} |
| 46 | + ref={ref} |
| 47 | + > |
| 48 | + {displayConfig.branded && ( |
| 49 | + <Flex |
| 50 | + gap={1} |
| 51 | + align='center' |
| 52 | + justify='center' |
| 53 | + sx={t => ({ color: t.colors.$colorTextSecondary })} |
| 54 | + > |
| 55 | + <> |
| 56 | + <Text variant='buttonSmall'>Secured by</Text> |
| 57 | + <LogoMarkIconLink /> |
| 58 | + </> |
| 59 | + </Flex> |
| 60 | + )} |
| 61 | + |
| 62 | + {withFooterPages && <Card.FooterLinks />} |
| 63 | + </Flex> |
47 | 64 |
|
48 | | - {withFooterPages && <Card.FooterLinks />} |
49 | | - </Flex> |
| 65 | + {withDevModeNotice && <DevModeNotice />} |
| 66 | + </Col> |
50 | 67 | ); |
51 | 68 | }), |
52 | 69 | ); |
|
0 commit comments