@adiraku/react-native-ui 1.2.9-canary-7 → 2.0.0-canary-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ActionList/ActionList.component.js +8 -7
- package/lib/commonjs/components/ActionList/ActionList.component.js.map +1 -1
- package/lib/commonjs/components/ActionList/ActionList.styles.js +13 -10
- package/lib/commonjs/components/ActionList/ActionList.styles.js.map +1 -1
- package/lib/commonjs/components/Appbar/Appbar.component.js +5 -4
- package/lib/commonjs/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/commonjs/components/Appbar/Appbar.style.js +15 -12
- package/lib/commonjs/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js +10 -8
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js +16 -16
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.style.js +35 -25
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.style.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.component.js +8 -4
- package/lib/commonjs/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.style.js +16 -17
- package/lib/commonjs/components/Checkbox/Checkbox.style.js.map +1 -1
- package/lib/commonjs/components/Pagination/pagination.component.js +39 -0
- package/lib/commonjs/components/Pagination/pagination.component.js.map +1 -0
- package/lib/commonjs/components/Pagination/pagination.style.js +26 -0
- package/lib/commonjs/components/Pagination/pagination.style.js.map +1 -0
- package/lib/commonjs/components/Pagination/pagination.type.js +2 -0
- package/lib/commonjs/components/Pagination/pagination.type.js.map +1 -0
- package/lib/commonjs/components/RadioButton/RadioButton.component.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.style.js +15 -12
- package/lib/commonjs/components/RadioButton/RadioButton.style.js.map +1 -1
- package/lib/commonjs/components/RadioInput/RadioInput.component.js +17 -19
- package/lib/commonjs/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/commonjs/components/RadioInput/RadioInput.style.js +35 -25
- package/lib/commonjs/components/RadioInput/RadioInput.style.js.map +1 -1
- package/lib/commonjs/components/StickyBar/StickyBar.component.js +67 -0
- package/lib/commonjs/components/StickyBar/StickyBar.component.js.map +1 -0
- package/lib/commonjs/components/StickyBar/StickyBar.style.js +64 -0
- package/lib/commonjs/components/StickyBar/StickyBar.style.js.map +1 -0
- package/lib/commonjs/components/StickyBar/StickyBar.type.js +6 -0
- package/lib/commonjs/components/StickyBar/StickyBar.type.js.map +1 -0
- package/lib/commonjs/components/TextInput/TextInput.component.js +9 -3
- package/lib/commonjs/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/commonjs/components/TextInput/TextInput.style.js +30 -25
- package/lib/commonjs/components/TextInput/TextInput.style.js.map +1 -1
- package/lib/commonjs/components/View/View.component.js +42 -0
- package/lib/commonjs/components/View/View.component.js.map +1 -0
- package/lib/commonjs/components/View/View.type.js +6 -0
- package/lib/commonjs/components/View/View.type.js.map +1 -0
- package/lib/commonjs/components/button/button.component.js +7 -4
- package/lib/commonjs/components/button/button.component.js.map +1 -1
- package/lib/commonjs/components/button/button.styles.js +21 -17
- package/lib/commonjs/components/button/button.styles.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.component.js +37 -37
- package/lib/commonjs/components/calendars/calendars.component.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.service.js.map +1 -1
- package/lib/commonjs/components/calendars/calendars.style.js +73 -51
- package/lib/commonjs/components/calendars/calendars.style.js.map +1 -1
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/typography/typography.component.js +12 -2
- package/lib/commonjs/components/typography/typography.component.js.map +1 -1
- package/lib/commonjs/components/typography/typography.style.js +21 -351
- package/lib/commonjs/components/typography/typography.style.js.map +1 -1
- package/lib/commonjs/config/index.js +50 -0
- package/lib/commonjs/config/index.js.map +1 -0
- package/lib/commonjs/config/makeStyles.js +37 -0
- package/lib/commonjs/config/makeStyles.js.map +1 -0
- package/lib/commonjs/config/theme.default.js +422 -0
- package/lib/commonjs/config/theme.default.js.map +1 -0
- package/lib/commonjs/config/theme.provider.js +48 -0
- package/lib/commonjs/config/theme.provider.js.map +1 -0
- package/lib/commonjs/config/theme.type.js +6 -0
- package/lib/commonjs/config/theme.type.js.map +1 -0
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/themes/border.js.map +1 -1
- package/lib/commonjs/themes/colors.js +1 -1
- package/lib/commonjs/themes/shadow.js +1 -0
- package/lib/commonjs/themes/shadow.js.map +1 -1
- package/lib/module/components/ActionList/ActionList.component.js +8 -7
- package/lib/module/components/ActionList/ActionList.component.js.map +1 -1
- package/lib/module/components/ActionList/ActionList.styles.js +11 -7
- package/lib/module/components/ActionList/ActionList.styles.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.component.js +4 -3
- package/lib/module/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.style.js +10 -6
- package/lib/module/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.component.js +2 -2
- package/lib/module/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.style.js +10 -7
- package/lib/module/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js +17 -17
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/module/components/CheckBoxInput/CheckBoxInput.style.js +24 -13
- package/lib/module/components/CheckBoxInput/CheckBoxInput.style.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.component.js +9 -5
- package/lib/module/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.style.js +14 -14
- package/lib/module/components/Checkbox/Checkbox.style.js.map +1 -1
- package/lib/module/components/Pagination/pagination.component.js +31 -0
- package/lib/module/components/Pagination/pagination.component.js.map +1 -0
- package/lib/module/components/Pagination/pagination.style.js +20 -0
- package/lib/module/components/Pagination/pagination.style.js.map +1 -0
- package/lib/module/components/Pagination/pagination.type.js +2 -0
- package/lib/module/components/Pagination/pagination.type.js.map +1 -0
- package/lib/module/components/RadioButton/RadioButton.component.js +2 -2
- package/lib/module/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.style.js +12 -8
- package/lib/module/components/RadioButton/RadioButton.style.js.map +1 -1
- package/lib/module/components/RadioInput/RadioInput.component.js +17 -19
- package/lib/module/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/module/components/RadioInput/RadioInput.style.js +24 -13
- package/lib/module/components/RadioInput/RadioInput.style.js.map +1 -1
- package/lib/module/components/StickyBar/StickyBar.component.js +60 -0
- package/lib/module/components/StickyBar/StickyBar.component.js.map +1 -0
- package/lib/module/components/StickyBar/StickyBar.style.js +57 -0
- package/lib/module/components/StickyBar/StickyBar.style.js.map +1 -0
- package/lib/module/components/StickyBar/StickyBar.type.js +2 -0
- package/lib/module/components/StickyBar/StickyBar.type.js.map +1 -0
- package/lib/module/components/TextInput/TextInput.component.js +10 -4
- package/lib/module/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/module/components/TextInput/TextInput.style.js +21 -15
- package/lib/module/components/TextInput/TextInput.style.js.map +1 -1
- package/lib/module/components/View/View.component.js +35 -0
- package/lib/module/components/View/View.component.js.map +1 -0
- package/lib/module/components/View/View.type.js +2 -0
- package/lib/module/components/View/View.type.js.map +1 -0
- package/lib/module/components/button/button.component.js +7 -4
- package/lib/module/components/button/button.component.js.map +1 -1
- package/lib/module/components/button/button.styles.js +14 -9
- package/lib/module/components/button/button.styles.js.map +1 -1
- package/lib/module/components/calendars/calendars.component.js +36 -36
- package/lib/module/components/calendars/calendars.component.js.map +1 -1
- package/lib/module/components/calendars/calendars.service.js.map +1 -1
- package/lib/module/components/calendars/calendars.style.js +65 -43
- package/lib/module/components/calendars/calendars.style.js.map +1 -1
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/typography/typography.component.js +13 -3
- package/lib/module/components/typography/typography.component.js.map +1 -1
- package/lib/module/components/typography/typography.style.js +21 -350
- package/lib/module/components/typography/typography.style.js.map +1 -1
- package/lib/module/config/index.js +5 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/makeStyles.js +30 -0
- package/lib/module/config/makeStyles.js.map +1 -0
- package/lib/module/config/theme.default.js +416 -0
- package/lib/module/config/theme.default.js.map +1 -0
- package/lib/module/config/theme.provider.js +35 -0
- package/lib/module/config/theme.provider.js.map +1 -0
- package/lib/module/config/theme.type.js +2 -0
- package/lib/module/config/theme.type.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/themes/border.js.map +1 -1
- package/lib/module/themes/colors.js +1 -1
- package/lib/module/themes/shadow.js +1 -0
- package/lib/module/themes/shadow.js.map +1 -1
- package/lib/typescript/components/ActionList/ActionList.component.d.ts.map +1 -1
- package/lib/typescript/components/ActionList/ActionList.styles.d.ts +3 -4
- package/lib/typescript/components/ActionList/ActionList.styles.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.component.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.style.d.ts +2 -3
- package/lib/typescript/components/Appbar/Appbar.style.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.style.d.ts +5 -4
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.style.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.component.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.style.d.ts +3 -2
- package/lib/typescript/components/Checkbox/Checkbox.style.d.ts.map +1 -1
- package/lib/typescript/components/Pagination/pagination.component.d.ts +5 -0
- package/lib/typescript/components/Pagination/pagination.component.d.ts.map +1 -0
- package/lib/typescript/components/Pagination/pagination.style.d.ts +19 -0
- package/lib/typescript/components/Pagination/pagination.style.d.ts.map +1 -0
- package/lib/typescript/components/Pagination/pagination.type.d.ts +15 -0
- package/lib/typescript/components/Pagination/pagination.type.d.ts.map +1 -0
- package/lib/typescript/components/RadioButton/RadioButton.component.d.ts +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.style.d.ts +2 -2
- package/lib/typescript/components/RadioButton/RadioButton.style.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.style.d.ts +5 -4
- package/lib/typescript/components/RadioInput/RadioInput.style.d.ts.map +1 -1
- package/lib/typescript/components/StickyBar/StickyBar.component.d.ts +5 -0
- package/lib/typescript/components/StickyBar/StickyBar.component.d.ts.map +1 -0
- package/lib/typescript/components/StickyBar/StickyBar.style.d.ts +15 -0
- package/lib/typescript/components/StickyBar/StickyBar.style.d.ts.map +1 -0
- package/lib/typescript/components/StickyBar/StickyBar.type.d.ts +30 -0
- package/lib/typescript/components/StickyBar/StickyBar.type.d.ts.map +1 -0
- package/lib/typescript/components/TextInput/TextInput.component.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.style.d.ts +6 -4
- package/lib/typescript/components/TextInput/TextInput.style.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts.map +1 -1
- package/lib/typescript/components/View/View.component.d.ts +4 -0
- package/lib/typescript/components/View/View.component.d.ts.map +1 -0
- package/lib/typescript/components/View/View.type.d.ts +10 -0
- package/lib/typescript/components/View/View.type.d.ts.map +1 -0
- package/lib/typescript/components/button/button.component.d.ts.map +1 -1
- package/lib/typescript/components/button/button.styles.d.ts +3 -4
- package/lib/typescript/components/button/button.styles.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.component.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.service.d.ts.map +1 -1
- package/lib/typescript/components/calendars/calendars.style.d.ts +6 -4
- package/lib/typescript/components/calendars/calendars.style.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +7 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.component.d.ts +1 -1
- package/lib/typescript/components/typography/typography.component.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.style.d.ts +5 -60
- package/lib/typescript/components/typography/typography.style.d.ts.map +1 -1
- package/lib/typescript/components/typography/typography.type.d.ts +7 -0
- package/lib/typescript/components/typography/typography.type.d.ts.map +1 -1
- package/lib/typescript/config/index.d.ts +5 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/makeStyles.d.ts +4 -0
- package/lib/typescript/config/makeStyles.d.ts.map +1 -0
- package/lib/typescript/config/theme.default.d.ts +178 -0
- package/lib/typescript/config/theme.default.d.ts.map +1 -0
- package/lib/typescript/config/theme.provider.d.ts +8 -0
- package/lib/typescript/config/theme.provider.d.ts.map +1 -0
- package/lib/typescript/config/theme.type.d.ts +12 -0
- package/lib/typescript/config/theme.type.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/themes/shadow.d.ts +2 -3
- package/lib/typescript/themes/shadow.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/components/ActionList/ActionList.component.tsx +20 -17
- package/src/components/ActionList/ActionList.styles.tsx +11 -11
- package/src/components/Appbar/Appbar.component.tsx +4 -3
- package/src/components/Appbar/Appbar.style.tsx +9 -9
- package/src/components/BottomSheet/BottomSheet.component.tsx +2 -2
- package/src/components/BottomSheet/BottomSheet.style.tsx +9 -7
- package/src/components/CheckBoxInput/CheckBoxInput.component.tsx +21 -20
- package/src/components/CheckBoxInput/CheckBoxInput.style.tsx +29 -15
- package/src/components/Checkbox/Checkbox.component.tsx +13 -13
- package/src/components/Checkbox/Checkbox.style.tsx +16 -17
- package/src/components/Pagination/pagination.component.tsx +29 -0
- package/src/components/Pagination/pagination.style.tsx +20 -0
- package/src/components/Pagination/pagination.type.ts +16 -0
- package/src/components/RadioButton/RadioButton.component.tsx +3 -4
- package/src/components/RadioButton/RadioButton.style.tsx +10 -10
- package/src/components/RadioInput/RadioInput.component.tsx +14 -15
- package/src/components/RadioInput/RadioInput.style.tsx +29 -15
- package/src/components/StickyBar/StickyBar.component.tsx +74 -0
- package/src/components/StickyBar/StickyBar.style.tsx +79 -0
- package/src/components/StickyBar/StickyBar.type.ts +35 -0
- package/src/components/TextInput/TextInput.component.tsx +7 -6
- package/src/components/TextInput/TextInput.style.tsx +86 -70
- package/src/components/TextInput/TextInput.type.ts +1 -1
- package/src/components/View/View.component.tsx +42 -0
- package/src/components/View/View.type.ts +14 -0
- package/src/components/button/button.component.tsx +9 -4
- package/src/components/button/button.styles.ts +15 -15
- package/src/components/calendars/calendars.component.tsx +27 -22
- package/src/components/calendars/calendars.service.ts +7 -3
- package/src/components/calendars/calendars.style.ts +77 -49
- package/src/components/index.ts +15 -0
- package/src/components/typography/typography.component.tsx +17 -4
- package/src/components/typography/typography.style.tsx +17 -472
- package/src/components/typography/typography.type.ts +9 -0
- package/src/config/index.ts +4 -0
- package/src/config/makeStyles.ts +52 -0
- package/src/config/theme.default.ts +440 -0
- package/src/config/theme.provider.tsx +53 -0
- package/src/config/theme.type.ts +17 -0
- package/src/index.tsx +1 -0
- package/src/themes/border.ts +3 -3
- package/src/themes/colors.ts +1 -1
- package/src/themes/shadow.tsx +4 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Palettes, Radius, Spacing } from '../../themes';
|
|
1
|
+
import { Platform, ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { CheckboxInputProps } from './CheckBoxInput.type';
|
|
4
|
+
import { makeStyles } from '../../config';
|
|
6
5
|
|
|
7
6
|
interface ComputedStyleProps {
|
|
8
7
|
fieldWrapper?: ViewStyle;
|
|
@@ -15,17 +14,20 @@ interface ComputedStyleProps {
|
|
|
15
14
|
counter?: TextStyle;
|
|
16
15
|
inputIconWrapper?: ViewStyle;
|
|
17
16
|
checkboxItemWrapper?: ViewStyle;
|
|
17
|
+
sheetListContentContainer?: ViewStyle;
|
|
18
|
+
sheetBottomContaienr?: ViewStyle;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export const
|
|
21
|
+
export const useStyles = makeStyles((themes, props: CheckboxInputProps) => {
|
|
22
|
+
const { colors, Spacing, Radius } = themes;
|
|
21
23
|
const { editable = true, disabled = false, isError, errorMessage } = props;
|
|
22
24
|
|
|
23
25
|
const stateColor =
|
|
24
26
|
isError || errorMessage
|
|
25
|
-
? { text:
|
|
27
|
+
? { text: colors['text-danger'], border: colors['border-danger'] }
|
|
26
28
|
: {
|
|
27
|
-
text:
|
|
28
|
-
border:
|
|
29
|
+
text: colors['text-primary'],
|
|
30
|
+
border: colors['border-default'],
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
const computedStyle: ComputedStyleProps = {};
|
|
@@ -48,7 +50,9 @@ export const getStyle = (props: CheckboxInputProps) => {
|
|
|
48
50
|
computedStyle.label = {
|
|
49
51
|
color: stateColor.text,
|
|
50
52
|
backgroundColor:
|
|
51
|
-
!editable || disabled
|
|
53
|
+
!editable || disabled
|
|
54
|
+
? colors['fill-disable-secondary']
|
|
55
|
+
: colors['surface-primary'],
|
|
52
56
|
paddingHorizontal: Spacing[4],
|
|
53
57
|
borderRadius: Radius[4],
|
|
54
58
|
marginLeft: Spacing[8],
|
|
@@ -62,7 +66,9 @@ export const getStyle = (props: CheckboxInputProps) => {
|
|
|
62
66
|
borderWidth: Radius.border,
|
|
63
67
|
borderColor: stateColor.border,
|
|
64
68
|
backgroundColor:
|
|
65
|
-
!editable || disabled
|
|
69
|
+
!editable || disabled
|
|
70
|
+
? colors['fill-disable-secondary']
|
|
71
|
+
: colors['surface-primary'],
|
|
66
72
|
borderRadius: Radius[8],
|
|
67
73
|
padding: Spacing[8],
|
|
68
74
|
width: '100%',
|
|
@@ -70,7 +76,7 @@ export const getStyle = (props: CheckboxInputProps) => {
|
|
|
70
76
|
|
|
71
77
|
computedStyle.textField = {
|
|
72
78
|
flex: 1,
|
|
73
|
-
color:
|
|
79
|
+
color: colors['text-primary'],
|
|
74
80
|
padding: 0,
|
|
75
81
|
margin: 0,
|
|
76
82
|
overflow: 'visible',
|
|
@@ -87,7 +93,7 @@ export const getStyle = (props: CheckboxInputProps) => {
|
|
|
87
93
|
|
|
88
94
|
computedStyle.counter = {
|
|
89
95
|
marginLeft: Spacing[4],
|
|
90
|
-
color:
|
|
96
|
+
color: colors['text-disable'],
|
|
91
97
|
};
|
|
92
98
|
|
|
93
99
|
computedStyle.inputIconWrapper = {
|
|
@@ -102,5 +108,13 @@ export const getStyle = (props: CheckboxInputProps) => {
|
|
|
102
108
|
justifyContent: 'space-between',
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
computedStyle.sheetListContentContainer = {
|
|
112
|
+
paddingHorizontal: Spacing[16],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
computedStyle.sheetBottomContaienr = {
|
|
116
|
+
padding: Spacing[16],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return computedStyle;
|
|
120
|
+
});
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { useStyles } from './Checkbox.style';
|
|
6
5
|
import type { CheckboxProps } from './Checkbox.type';
|
|
6
|
+
|
|
7
7
|
import { IconTick } from '../../icons';
|
|
8
|
-
import {
|
|
8
|
+
import { useAppTheme } from '../../config';
|
|
9
9
|
|
|
10
10
|
const Checkbox: React.FunctionComponent<CheckboxProps> = (props) => {
|
|
11
11
|
const { selected, disabled, ...rest } = props;
|
|
12
|
+
const { colors, colorScheme } = useAppTheme();
|
|
12
13
|
|
|
13
|
-
const computedStyle =
|
|
14
|
+
const computedStyle = useStyles(props);
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
17
|
<>
|
|
17
|
-
<View
|
|
18
|
-
style={[
|
|
19
|
-
computedStyle.outer,
|
|
20
|
-
selected && computedStyle.outerSelected,
|
|
21
|
-
disabled && computedStyle.outerDisabled,
|
|
22
|
-
]}
|
|
23
|
-
{...rest}
|
|
24
|
-
>
|
|
18
|
+
<View style={[computedStyle.outer]} {...rest}>
|
|
25
19
|
{selected && (
|
|
26
20
|
<IconTick
|
|
27
21
|
height={14}
|
|
28
22
|
width={14}
|
|
29
|
-
fill={
|
|
23
|
+
fill={
|
|
24
|
+
disabled
|
|
25
|
+
? colors['icon-disable']
|
|
26
|
+
: colorScheme === 'light'
|
|
27
|
+
? colors['icon-primary']
|
|
28
|
+
: colors['icon-inverse']
|
|
29
|
+
}
|
|
30
30
|
/>
|
|
31
31
|
)}
|
|
32
32
|
</View>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Palettes, Radius } from '../../themes';
|
|
1
|
+
import { ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import { CheckboxProps } from './Checkbox.type';
|
|
4
|
+
import { makeStyles } from '../../config';
|
|
5
5
|
|
|
6
6
|
interface ComputedStyleProps {
|
|
7
7
|
outer?: ViewStyle;
|
|
@@ -12,7 +12,9 @@ interface ComputedStyleProps {
|
|
|
12
12
|
innerDisabled?: ViewStyle;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const
|
|
15
|
+
export const useStyles = makeStyles((themes, props: CheckboxProps) => {
|
|
16
|
+
const { colors, Radius } = themes;
|
|
17
|
+
const { selected, disabled } = props;
|
|
16
18
|
const computedStyle: ComputedStyleProps = {};
|
|
17
19
|
|
|
18
20
|
computedStyle.outer = {
|
|
@@ -20,20 +22,17 @@ export const getStyle = () => {
|
|
|
20
22
|
width: 18,
|
|
21
23
|
borderRadius: Radius[4],
|
|
22
24
|
borderWidth: 2,
|
|
23
|
-
borderColor:
|
|
25
|
+
borderColor: disabled
|
|
26
|
+
? colors['icon-disable-secondary']
|
|
27
|
+
: colors['border-primary'],
|
|
28
|
+
backgroundColor: !selected
|
|
29
|
+
? 'transparent'
|
|
30
|
+
: disabled
|
|
31
|
+
? colors['icon-disable-secondary']
|
|
32
|
+
: colors['fill-warning'],
|
|
24
33
|
justifyContent: 'center',
|
|
25
34
|
alignItems: 'center',
|
|
26
35
|
};
|
|
27
36
|
|
|
28
|
-
computedStyle
|
|
29
|
-
|
|
30
|
-
borderColor: Palettes.yellow[600],
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
computedStyle.outerDisabled = {
|
|
34
|
-
borderColor: Palettes.grey[100],
|
|
35
|
-
backgroundColor: Palettes.grey[100],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return StyleSheet.create(computedStyle);
|
|
39
|
-
};
|
|
37
|
+
return computedStyle;
|
|
38
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { PaginationProps } from './pagination.type';
|
|
4
|
+
|
|
5
|
+
const Pagination = ({ totalPages = 1, currentPage = 1 }: PaginationProps) => {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'flex-start' }}>
|
|
8
|
+
{Array.from({ length: totalPages }).map((_, index) => {
|
|
9
|
+
const page = index + 0;
|
|
10
|
+
const isActive = page === currentPage;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
key={page}
|
|
15
|
+
style={{
|
|
16
|
+
width: isActive ? 30 : 8,
|
|
17
|
+
height: 8,
|
|
18
|
+
borderRadius: 4,
|
|
19
|
+
backgroundColor: isActive ? '#000' : '#ddd',
|
|
20
|
+
marginHorizontal: 4,
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
})}
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Pagination };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const styles = StyleSheet.create({
|
|
4
|
+
paginationContainer: {
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
justifyContent: 'flex-start',
|
|
7
|
+
alignItems: 'flex-end',
|
|
8
|
+
},
|
|
9
|
+
dot: {
|
|
10
|
+
width: 8,
|
|
11
|
+
height: 8,
|
|
12
|
+
borderRadius: 4,
|
|
13
|
+
backgroundColor: '#ddd',
|
|
14
|
+
marginHorizontal: 4,
|
|
15
|
+
},
|
|
16
|
+
activeDot: {
|
|
17
|
+
width: 20,
|
|
18
|
+
backgroundColor: '#000',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import type { RadioButtonProps } from './RadioButton.type';
|
|
4
|
+
import { useStyles } from './RadioButton.style';
|
|
5
|
+
import { RadioButtonProps } from './RadioButton.type';
|
|
7
6
|
|
|
8
7
|
const RadioButton: React.FunctionComponent<RadioButtonProps> = (props) => {
|
|
9
8
|
const { selected, disabled, ...rest } = props;
|
|
10
9
|
|
|
11
|
-
const computedStyle =
|
|
10
|
+
const computedStyle = useStyles();
|
|
12
11
|
|
|
13
12
|
return (
|
|
14
13
|
<>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { Palettes, Radius } from '../../themes';
|
|
1
|
+
import { StyleSheet, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import { makeStyles } from '../../config';
|
|
5
4
|
|
|
6
5
|
interface ComputedStyleProps {
|
|
7
6
|
outer?: ViewStyle;
|
|
@@ -11,7 +10,8 @@ interface ComputedStyleProps {
|
|
|
11
10
|
innerDisabled?: ViewStyle;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export const
|
|
13
|
+
export const useStyles = makeStyles((themes) => {
|
|
14
|
+
const { colors, Radius } = themes;
|
|
15
15
|
const computedStyle: ComputedStyleProps = {};
|
|
16
16
|
|
|
17
17
|
computedStyle.outer = {
|
|
@@ -20,26 +20,26 @@ export const getStyle = () => {
|
|
|
20
20
|
padding: 2,
|
|
21
21
|
borderRadius: Radius.full,
|
|
22
22
|
borderWidth: 2,
|
|
23
|
-
borderColor:
|
|
23
|
+
borderColor: colors['border-primary'],
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
computedStyle.inner = {
|
|
27
27
|
flex: 1,
|
|
28
28
|
borderRadius: Radius.full,
|
|
29
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: colors['fill-inverse'],
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
computedStyle.innerSelected = {
|
|
33
|
-
backgroundColor:
|
|
33
|
+
backgroundColor: colors['fill-warning'],
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
computedStyle.outerDisabled = {
|
|
37
|
-
borderColor:
|
|
37
|
+
borderColor: colors['border-disable'],
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
computedStyle.innerDisabled = {
|
|
41
|
-
backgroundColor:
|
|
41
|
+
backgroundColor: colors['border-default'],
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
return StyleSheet.create(computedStyle);
|
|
45
|
-
};
|
|
45
|
+
});
|
|
@@ -2,28 +2,29 @@ import * as React from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
4
|
FlatList,
|
|
5
|
+
LayoutChangeEvent,
|
|
5
6
|
TouchableHighlight,
|
|
6
7
|
TouchableWithoutFeedback,
|
|
7
8
|
View,
|
|
8
9
|
} from 'react-native';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
import { Palettes } from '../../themes';
|
|
11
|
+
import { useAppTheme } from '../../config';
|
|
12
12
|
import { IconChevronDown } from '../../icons';
|
|
13
13
|
import { Button } from '../button/button.component';
|
|
14
|
-
import { Typography } from '../typography/typography.component';
|
|
15
14
|
import { BottomSheet } from '../BottomSheet/BottomSheet.component';
|
|
16
|
-
import { RadioButton } from '../RadioButton/RadioButton.component';
|
|
17
15
|
import { Divider } from '../Divider/Divider.component';
|
|
16
|
+
import { RadioButton } from '../RadioButton/RadioButton.component';
|
|
17
|
+
import { Typography } from '../typography/typography.component';
|
|
18
18
|
|
|
19
|
-
import type { LayoutChangeEvent } from 'react-native';
|
|
20
19
|
import type {
|
|
21
20
|
RadioInputProps,
|
|
22
21
|
RadioItemProps,
|
|
23
22
|
RadioItemPropsComponent,
|
|
24
23
|
} from './RadioInput.type';
|
|
24
|
+
import { useStyles } from './RadioInput.style';
|
|
25
25
|
|
|
26
26
|
const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => {
|
|
27
|
+
const { colors } = useAppTheme();
|
|
27
28
|
const {
|
|
28
29
|
value,
|
|
29
30
|
label,
|
|
@@ -34,7 +35,7 @@ const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => {
|
|
|
34
35
|
disabled,
|
|
35
36
|
editable = true,
|
|
36
37
|
inputIcon = (
|
|
37
|
-
<IconChevronDown width={14} height={14} fill={
|
|
38
|
+
<IconChevronDown width={14} height={14} fill={colors['icon-primary']} />
|
|
38
39
|
),
|
|
39
40
|
data,
|
|
40
41
|
onSaveInput = () => {},
|
|
@@ -50,10 +51,9 @@ const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => {
|
|
|
50
51
|
} = props;
|
|
51
52
|
|
|
52
53
|
const [labelWidth, setLabelWidth] = React.useState(0);
|
|
53
|
-
// const [inputVisibility, setInputVisibility] = React.useState(false);
|
|
54
54
|
const [selectedValue, setSelectedValue] = React.useState(value);
|
|
55
55
|
|
|
56
|
-
const computedStyle =
|
|
56
|
+
const computedStyle = useStyles(props);
|
|
57
57
|
|
|
58
58
|
type BottomSheetHandler = React.ElementRef<typeof BottomSheet>;
|
|
59
59
|
const ref = React.useRef<BottomSheetHandler>(null);
|
|
@@ -156,7 +156,7 @@ const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => {
|
|
|
156
156
|
computedStyle.inputWrapper,
|
|
157
157
|
!!selectedObject() &&
|
|
158
158
|
!isError &&
|
|
159
|
-
!errorMessage && { borderColor:
|
|
159
|
+
!errorMessage && { borderColor: colors['border-primary'] },
|
|
160
160
|
]}
|
|
161
161
|
>
|
|
162
162
|
<Typography
|
|
@@ -208,12 +208,10 @@ const RadioInput: React.FunctionComponent<RadioInputProps> = (props) => {
|
|
|
208
208
|
/>
|
|
209
209
|
);
|
|
210
210
|
}}
|
|
211
|
-
|
|
212
|
-
contentContainerStyle={{ padding: 16 }}
|
|
211
|
+
contentContainerStyle={computedStyle.sheetListContentContainer}
|
|
213
212
|
ItemSeparatorComponent={() => customItemSeparator}
|
|
214
213
|
/>
|
|
215
|
-
{
|
|
216
|
-
<View style={{ padding: 16, backgroundColor: 'transparent' }}>
|
|
214
|
+
<View style={computedStyle.sheetBottomContaienr}>
|
|
217
215
|
<Button
|
|
218
216
|
variant="primary"
|
|
219
217
|
label={saveInputLabel}
|
|
@@ -233,14 +231,15 @@ function RadioItem({
|
|
|
233
231
|
testID,
|
|
234
232
|
...rest
|
|
235
233
|
}: RadioItemPropsComponent) {
|
|
234
|
+
const { colors } = useAppTheme();
|
|
236
235
|
const { item } = data;
|
|
237
236
|
const { label, value, disabled } = item;
|
|
238
|
-
const computedStyle =
|
|
237
|
+
const computedStyle = useStyles({} as RadioInputProps);
|
|
239
238
|
|
|
240
239
|
return (
|
|
241
240
|
<TouchableHighlight
|
|
242
241
|
onPress={() => onItemPress(item)}
|
|
243
|
-
underlayColor={
|
|
242
|
+
underlayColor={colors['fill-disable-secondary']}
|
|
244
243
|
disabled={disabled}
|
|
245
244
|
testID={testID + 'item_radio_touchable_' + data.index}
|
|
246
245
|
accessibilityLabel={testID + 'item_radio_touchable_' + data.index}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Palettes, Radius, Spacing } from '../../themes';
|
|
1
|
+
import { Platform, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { RadioInputProps } from './RadioInput.type';
|
|
4
|
+
import { makeStyles } from '../../config';
|
|
6
5
|
|
|
7
6
|
interface ComputedStyleProps {
|
|
8
7
|
fieldWrapper?: ViewStyle;
|
|
@@ -15,17 +14,20 @@ interface ComputedStyleProps {
|
|
|
15
14
|
counter?: TextStyle;
|
|
16
15
|
inputIconWrapper?: ViewStyle;
|
|
17
16
|
radioItemWrapper?: ViewStyle;
|
|
17
|
+
sheetListContentContainer?: ViewStyle;
|
|
18
|
+
sheetBottomContaienr?: ViewStyle;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export const
|
|
21
|
+
export const useStyles = makeStyles((themes, props: RadioInputProps) => {
|
|
22
|
+
const { colors, Radius, Spacing } = themes;
|
|
21
23
|
const { editable = true, disabled = false, isError, errorMessage } = props;
|
|
22
24
|
|
|
23
25
|
const stateColor =
|
|
24
26
|
isError || errorMessage
|
|
25
|
-
? { text:
|
|
27
|
+
? { text: colors['text-danger'], border: colors['border-danger'] }
|
|
26
28
|
: {
|
|
27
|
-
text:
|
|
28
|
-
border:
|
|
29
|
+
text: colors['text-primary'],
|
|
30
|
+
border: colors['border-disable'],
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
const computedStyle: ComputedStyleProps = {};
|
|
@@ -48,7 +50,9 @@ export const getStyle = (props: RadioInputProps) => {
|
|
|
48
50
|
computedStyle.label = {
|
|
49
51
|
color: stateColor.text,
|
|
50
52
|
backgroundColor:
|
|
51
|
-
!editable || disabled
|
|
53
|
+
!editable || disabled
|
|
54
|
+
? colors['fill-disable-secondary']
|
|
55
|
+
: colors['fill-inverse'],
|
|
52
56
|
paddingHorizontal: Spacing[4],
|
|
53
57
|
borderRadius: Radius[4],
|
|
54
58
|
marginLeft: Spacing[8],
|
|
@@ -62,7 +66,9 @@ export const getStyle = (props: RadioInputProps) => {
|
|
|
62
66
|
borderWidth: Radius.border,
|
|
63
67
|
borderColor: stateColor.border,
|
|
64
68
|
backgroundColor:
|
|
65
|
-
!editable || disabled
|
|
69
|
+
!editable || disabled
|
|
70
|
+
? colors['fill-disable-secondary']
|
|
71
|
+
: colors['fill-inverse'],
|
|
66
72
|
borderRadius: Radius[8],
|
|
67
73
|
padding: Spacing[8],
|
|
68
74
|
width: '100%',
|
|
@@ -70,7 +76,7 @@ export const getStyle = (props: RadioInputProps) => {
|
|
|
70
76
|
|
|
71
77
|
computedStyle.textField = {
|
|
72
78
|
flex: 1,
|
|
73
|
-
color:
|
|
79
|
+
color: colors['text-primary'],
|
|
74
80
|
padding: 0,
|
|
75
81
|
margin: 0,
|
|
76
82
|
overflow: 'visible',
|
|
@@ -87,7 +93,7 @@ export const getStyle = (props: RadioInputProps) => {
|
|
|
87
93
|
|
|
88
94
|
computedStyle.counter = {
|
|
89
95
|
marginLeft: Spacing[4],
|
|
90
|
-
color:
|
|
96
|
+
color: colors['text-disable'],
|
|
91
97
|
};
|
|
92
98
|
|
|
93
99
|
computedStyle.inputIconWrapper = {
|
|
@@ -102,5 +108,13 @@ export const getStyle = (props: RadioInputProps) => {
|
|
|
102
108
|
justifyContent: 'space-between',
|
|
103
109
|
};
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
computedStyle.sheetListContentContainer = {
|
|
112
|
+
paddingHorizontal: Spacing[16],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
computedStyle.sheetBottomContaienr = {
|
|
116
|
+
padding: Spacing[16],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return computedStyle;
|
|
120
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
+
|
|
5
|
+
import { Typography } from '../typography/typography.component';
|
|
6
|
+
import { StickyBarProps } from './StickyBar.type';
|
|
7
|
+
import { Palettes, Spacing } from 'src/themes';
|
|
8
|
+
|
|
9
|
+
import { IconClose } from 'src/icons';
|
|
10
|
+
import { getStyle } from './StickyBar.style';
|
|
11
|
+
|
|
12
|
+
const StickyBar: FC<StickyBarProps> = ({
|
|
13
|
+
show,
|
|
14
|
+
text,
|
|
15
|
+
onClose,
|
|
16
|
+
iconComponent,
|
|
17
|
+
buttonComponent,
|
|
18
|
+
testID,
|
|
19
|
+
}) => {
|
|
20
|
+
const computedStyle = getStyle({
|
|
21
|
+
show,
|
|
22
|
+
text,
|
|
23
|
+
iconComponent,
|
|
24
|
+
buttonComponent,
|
|
25
|
+
onClose,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<View style={[computedStyle.container]}>
|
|
30
|
+
<LinearGradient
|
|
31
|
+
colors={[Palettes.yellow[600], '#FFFFFF']}
|
|
32
|
+
start={{ x: 0.5, y: 0 }}
|
|
33
|
+
end={{ x: 1, y: 0.1 }}
|
|
34
|
+
useAngle={true}
|
|
35
|
+
angle={45}
|
|
36
|
+
style={[computedStyle.linearGradient]}
|
|
37
|
+
>
|
|
38
|
+
<View style={[computedStyle.rowContainer]}>
|
|
39
|
+
{/* Small Image */}
|
|
40
|
+
<View
|
|
41
|
+
style={[computedStyle.contentWrapper, computedStyle.imageWrapper]}
|
|
42
|
+
>
|
|
43
|
+
{iconComponent}
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
{/* Copy */}
|
|
47
|
+
<View
|
|
48
|
+
style={[computedStyle.contentWrapper, computedStyle.textWrapper]}
|
|
49
|
+
>
|
|
50
|
+
<Typography
|
|
51
|
+
variant="overline-small"
|
|
52
|
+
testID={testID}
|
|
53
|
+
accessibilityLabel={testID}
|
|
54
|
+
>
|
|
55
|
+
{text}
|
|
56
|
+
</Typography>
|
|
57
|
+
</View>
|
|
58
|
+
|
|
59
|
+
{/* CTA Button */}
|
|
60
|
+
<View style={[computedStyle.contentWrapper]}>{buttonComponent}</View>
|
|
61
|
+
|
|
62
|
+
{/* Close Button */}
|
|
63
|
+
<View style={[computedStyle.closeButtonWrapper]}>
|
|
64
|
+
<TouchableOpacity onPress={onClose}>
|
|
65
|
+
<IconClose height={Spacing[12]} width={Spacing[12]} />
|
|
66
|
+
</TouchableOpacity>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
</LinearGradient>
|
|
70
|
+
</View>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { StickyBar };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { StyleSheet, ViewStyle } from 'react-native';
|
|
2
|
+
import { StickyBarProps } from './StickyBar.type';
|
|
3
|
+
import { Palettes, Spacing } from 'src/themes';
|
|
4
|
+
|
|
5
|
+
interface ComputedStyleProps {
|
|
6
|
+
container?: ViewStyle;
|
|
7
|
+
rowContainer?: ViewStyle;
|
|
8
|
+
linearGradient?: ViewStyle;
|
|
9
|
+
contentWrapper?: ViewStyle;
|
|
10
|
+
imageWrapper?: ViewStyle;
|
|
11
|
+
textWrapper?: ViewStyle;
|
|
12
|
+
buttonWrapper?: ViewStyle;
|
|
13
|
+
closeButtonWrapper?: ViewStyle;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const getStyle = (props: StickyBarProps) => {
|
|
17
|
+
const {
|
|
18
|
+
show,
|
|
19
|
+
onClose,
|
|
20
|
+
iconComponent: IconComponent,
|
|
21
|
+
buttonComponent,
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
const computedStyle: ComputedStyleProps = {};
|
|
25
|
+
|
|
26
|
+
computedStyle.container = {
|
|
27
|
+
flex: 1,
|
|
28
|
+
minWidth: 400,
|
|
29
|
+
display: show ? 'flex' : 'none',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
computedStyle.rowContainer = {
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
computedStyle.linearGradient = {
|
|
39
|
+
paddingVertical: Spacing[8],
|
|
40
|
+
paddingHorizontal: Spacing[16],
|
|
41
|
+
borderTopRightRadius: Spacing[16],
|
|
42
|
+
borderTopLeftRadius: Spacing[16],
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
zIndex: 2,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
computedStyle.contentWrapper = {
|
|
48
|
+
marginRight: Spacing[8],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
computedStyle.imageWrapper = {
|
|
52
|
+
display: IconComponent ? 'flex' : 'none',
|
|
53
|
+
alignSelf: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
backgroundColor: 'white',
|
|
56
|
+
borderRadius: Spacing[32],
|
|
57
|
+
padding: 6,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
computedStyle.textWrapper = {
|
|
61
|
+
flex: 1,
|
|
62
|
+
flexWrap: 'wrap',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
computedStyle.buttonWrapper = {
|
|
66
|
+
display: buttonComponent ? 'flex' : 'none',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
computedStyle.closeButtonWrapper = {
|
|
70
|
+
display: onClose ? 'flex' : 'none',
|
|
71
|
+
borderWidth: 2,
|
|
72
|
+
borderRadius: 12,
|
|
73
|
+
borderColor: Palettes.black[900],
|
|
74
|
+
borderStyle: 'solid',
|
|
75
|
+
padding: 2,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return StyleSheet.create(computedStyle);
|
|
79
|
+
};
|