|
1 | | -import React, { ReactElement } from 'react'; |
2 | | -import { StyleSheet, View } from 'react-native'; |
3 | | - |
| 1 | +import React, { memo, ReactElement, ReactNode } from 'react'; |
| 2 | +import { StyleProp, StyleSheet, TextStyle, View } from 'react-native'; |
4 | 3 | import { BodyM } from '../styles/text'; |
5 | 4 |
|
6 | 5 | const T = ({ |
7 | 6 | children, |
8 | 7 | style, |
9 | 8 | }: { |
10 | | - children: React.ReactNode; |
11 | | - style: any; |
12 | | -}): ReactElement => { |
13 | | - return ( |
14 | | - <BodyM color="secondary" style={style}> |
15 | | - {children} |
16 | | - </BodyM> |
17 | | - ); |
18 | | -}; |
19 | | - |
20 | | -const s = StyleSheet.create({ |
21 | | - root: { |
22 | | - marginTop: 8, |
23 | | - marginBottom: 300, |
24 | | - }, |
25 | | - i: { |
26 | | - fontStyle: 'italic', |
27 | | - }, |
28 | | - u: { |
29 | | - textDecorationLine: 'underline', |
30 | | - }, |
31 | | - b: { |
32 | | - fontWeight: 'bold', |
33 | | - }, |
34 | | - p: { |
35 | | - marginTop: 10, |
36 | | - }, |
37 | | -}); |
| 9 | + children: ReactNode; |
| 10 | + style: StyleProp<TextStyle>; |
| 11 | +}): ReactElement => ( |
| 12 | + <BodyM style={style} color="secondary"> |
| 13 | + {children} |
| 14 | + </BodyM> |
| 15 | +); |
38 | 16 |
|
39 | 17 | type Props = { |
40 | | - children: React.ReactNode; |
| 18 | + children: ReactNode; |
41 | 19 | }; |
42 | 20 |
|
43 | 21 | const B = ({ children }: Props): ReactElement => { |
44 | | - return <T style={s.b}>{children}</T>; |
| 22 | + return <T style={styles.b}>{children}</T>; |
45 | 23 | }; |
46 | 24 |
|
47 | 25 | const U = ({ children }: Props): ReactElement => { |
48 | | - return <T style={s.u}>{children}</T>; |
| 26 | + return <T style={styles.u}>{children}</T>; |
49 | 27 | }; |
50 | 28 |
|
51 | 29 | const I = ({ children }: Props): ReactElement => { |
52 | | - return <T style={s.i}>{children}</T>; |
| 30 | + return <T style={styles.i}>{children}</T>; |
53 | 31 | }; |
54 | 32 |
|
55 | 33 | const BU = ({ children }: Props): ReactElement => { |
56 | | - return <T style={[s.b, s.u]}>{children}</T>; |
| 34 | + return <T style={[styles.b, styles.u]}>{children}</T>; |
57 | 35 | }; |
58 | 36 |
|
59 | 37 | const P = ({ children }: Props): ReactElement => { |
60 | | - return <T style={s.p}>{children}</T>; |
| 38 | + return <T style={styles.p}>{children}</T>; |
61 | 39 | }; |
62 | 40 |
|
63 | 41 | const BI = ({ children }: Props): ReactElement => { |
64 | | - return <T style={[s.b, s.i]}>{children}</T>; |
| 42 | + return <T style={[styles.b, styles.i]}>{children}</T>; |
65 | 43 | }; |
66 | 44 |
|
67 | 45 | const BUI = ({ children }: Props): ReactElement => { |
68 | | - return <T style={[s.b, s.u, s.i]}>{children}</T>; |
| 46 | + return <T style={[styles.b, styles.u, styles.i]}>{children}</T>; |
69 | 47 | }; |
70 | 48 |
|
71 | 49 | const TOS = (): ReactElement => ( |
72 | | - <View style={s.root}> |
| 50 | + <View style={styles.root}> |
73 | 51 | <P> |
74 | 52 | <B>Effective date: February 4, 2025</B> |
75 | 53 | </P> |
@@ -1898,4 +1876,23 @@ const TOS = (): ReactElement => ( |
1898 | 1876 | </View> |
1899 | 1877 | ); |
1900 | 1878 |
|
1901 | | -export default TOS; |
| 1879 | +const styles = StyleSheet.create({ |
| 1880 | + root: { |
| 1881 | + marginTop: 8, |
| 1882 | + marginBottom: 300, |
| 1883 | + }, |
| 1884 | + i: { |
| 1885 | + fontStyle: 'italic', |
| 1886 | + }, |
| 1887 | + u: { |
| 1888 | + textDecorationLine: 'underline', |
| 1889 | + }, |
| 1890 | + b: { |
| 1891 | + fontWeight: 'bold', |
| 1892 | + }, |
| 1893 | + p: { |
| 1894 | + marginTop: 10, |
| 1895 | + }, |
| 1896 | +}); |
| 1897 | + |
| 1898 | +export default memo(TOS); |
0 commit comments