@tactics/toddle-styleguide 2.0.3 → 3.0.0
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/App.tsx +0 -12
- package/app.json +1 -0
- package/babel.config.js +14 -1
- package/index.d.ts +2 -5
- package/index.tsx +0 -8
- package/metro.config.js +11 -0
- package/package.json +1 -1
- package/src/components/atoms/animated-wave/animated-wave.styles.d.ts +19 -19
- package/src/components/atoms/backdrop/backdrop.styles.d.ts +9 -9
- package/src/components/atoms/background-gradient/background-gradient.styles.d.ts +6 -6
- package/src/components/atoms/count/count.component.d.ts +1 -1
- package/src/components/atoms/count/count.component.tsx +12 -13
- package/src/components/atoms/count/count.preview.tsx +5 -5
- package/src/components/atoms/count/count.styles.d.ts +23 -20
- package/src/components/atoms/count/count.styles.js +25 -17
- package/src/components/atoms/footer/footer.component.d.ts +1 -4
- package/src/components/atoms/footer/footer.component.tsx +9 -13
- package/src/components/atoms/footer/footer.preview.tsx +0 -17
- package/src/components/atoms/footer/footer.styles.d.ts +16 -13
- package/src/components/atoms/footer/footer.styles.js +1 -1
- package/src/components/atoms/increment-input/increment-input.styles.d.ts +33 -33
- package/src/components/atoms/quick-message/quick-message.styles.d.ts +16 -13
- package/src/components/atoms/split-container/split-container.styles.d.ts +12 -12
- package/src/components/molecules/amount/amount.component.d.ts +3 -3
- package/src/components/molecules/amount/amount.component.tsx +125 -100
- package/src/components/molecules/amount/amount.preview.tsx +59 -11
- package/src/components/molecules/amount/amount.styles.d.ts +34 -34
- package/src/components/molecules/amount/amount.styles.js +7 -7
- package/src/components/molecules/avatar/avatar.component.d.ts +1 -1
- package/src/components/molecules/avatar/avatar.component.tsx +8 -6
- package/src/components/molecules/avatar/avatar.styles.d.ts +96 -78
- package/src/components/molecules/avatar/avatar.styles.js +18 -16
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.d.ts +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.native.tsx +78 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.tsx +39 -67
- package/src/components/molecules/bare-time-picker/bare-time-picker.preview.tsx +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.d.ts +6 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.js +14 -8
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +2 -1
- package/src/components/molecules/calendar-select/calendar-select.component.tsx +76 -73
- package/src/components/molecules/calendar-select/calendar-select.styles.d.ts +31 -31
- package/src/components/molecules/calendar-select/calendar-select.styles.js +33 -33
- package/src/components/molecules/context-label/context-label.component.tsx +21 -23
- package/src/components/molecules/context-label/context-label.preview.tsx +45 -30
- package/src/components/molecules/context-label/context-label.styles.d.ts +7 -5
- package/src/components/molecules/date-input/date-input.styles.d.ts +16 -16
- package/src/components/molecules/day/day.component.d.ts +10 -6
- package/src/components/molecules/default-select/default-select.styles.d.ts +11 -11
- package/src/components/molecules/filter-range/filter-range.styles.d.ts +20 -20
- package/src/components/molecules/filter-tab/filter-tab.styles.d.ts +58 -53
- package/src/components/molecules/info/info.component.tsx +13 -5
- package/src/components/molecules/info/info.preview.tsx +4 -5
- package/src/components/molecules/info/info.styles.d.ts +14 -14
- package/src/components/molecules/inline-error/inline-error.component.tsx +10 -3
- package/src/components/molecules/inline-error/inline-error.preview.tsx +4 -2
- package/src/components/molecules/inline-error/inline-error.styles.d.ts +16 -16
- package/src/components/molecules/inline-error/inline-error.styles.js +2 -2
- package/src/components/molecules/inline-notice/inline-notice.component.tsx +16 -12
- package/src/components/molecules/inline-notice/inline-notice.preview.tsx +4 -2
- package/src/components/molecules/inline-notice/inline-notice.styles.d.ts +16 -16
- package/src/components/molecules/inline-notice/inline-notice.styles.js +18 -18
- package/src/components/molecules/message-input/message-input.styles.d.ts +31 -31
- package/src/components/molecules/password-input/password-input.component.tsx +1 -1
- package/src/components/molecules/password-input/password-input.styles.d.ts +27 -27
- package/src/components/molecules/quick-filter/quick-filter.component.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.preview.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.styles.js +1 -1
- package/src/components/molecules/search-input/search.styles.d.ts +31 -31
- package/src/components/molecules/select-list-item/select-list-item.component.d.ts +1 -1
- package/src/components/molecules/select-list-item/select-list-item.component.tsx +13 -9
- package/src/components/molecules/select-list-item/select-list-item.styles.d.ts +27 -22
- package/src/components/molecules/select-picker/select-picker.styles.d.ts +30 -30
- package/src/components/molecules/selectable-list-item/selectable-list-item-preview.tsx +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.d.ts +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.tsx +17 -5
- package/src/components/molecules/selectable-list-item/selectable-list-item.styles.d.ts +31 -27
- package/src/components/molecules/swipe/swipe.component.native.tsx +78 -0
- package/src/components/molecules/swipe/swipe.component.tsx +5 -63
- package/src/components/molecules/time-picker/time-picker.component.tsx +8 -2
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +25 -25
- package/src/components/molecules/wide-button/wide-button.styles.d.ts +14 -10
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +1 -1
- package/src/components/organisms/child-list-item/child-list-item.component.tsx +29 -26
- package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +56 -53
- package/src/components/organisms/child-list-item/child-list-item.styles.js +5 -5
- package/src/components/organisms/contact-item/contact-item.styles.d.ts +13 -13
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +5 -4
- package/src/components/organisms/journal-entry/journal-entry.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/journal-entry.styles.d.ts +25 -22
- package/src/components/organisms/my-child-list-item/my-child-list-item.styles.d.ts +31 -31
- package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +14 -14
- package/src/components/organisms/timetable-edit/timetable-edit.component.d.ts +1 -1
- package/src/components/organisms/timetable-edit/timetable-edit.component.tsx +58 -56
- package/src/components/organisms/timetable-edit/timetable-edit.preview.tsx +20 -18
- package/src/components/organisms/timetable-edit/timetable-edit.styles.d.ts +19 -19
- package/src/components/organisms/timetable-edit/timetable-edit.styles.js +21 -21
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.d.ts +4 -4
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.tsx +65 -58
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.d.ts +8 -0
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.tsx +66 -47
- package/src/components/organisms/timetable-editor/timetable-editor.component.d.ts +2 -2
- package/src/components/organisms/timetable-editor/timetable-editor.component.tsx +76 -53
- package/src/components/organisms/timetable-editor/timetable-editor.preview.tsx +7 -7
- package/src/components/organisms/timetable-editor/timetable-editor.styles.d.ts +6 -6
- package/src/components/organisms/timetable-editor/timetable-editor.styles.js +8 -8
- package/src/components/templates/modal/components/fade-panel.styles.d.ts +17 -13
- package/src/components/templates/modal/modal.styles.d.ts +21 -21
- package/src/components/templates/popover/components/foreground/foreground.styles.d.ts +10 -10
- package/src/components/templates/popover/components/modal/heading/heading.styles.d.ts +12 -12
- package/src/components/templates/popover/components/modal/modal.styles.d.ts +17 -17
- package/src/components/templates/popover/popover.styles.d.ts +9 -9
- package/src/components/templates/popover-action/popover-action.component.d.ts +8 -4
- package/src/components/templates/popover-action/popover-action.component.tsx +7 -4
- package/src/components/templates/popover-action/popover-action.styles.d.ts +26 -26
- package/src/context/theme.context.ts +4 -4
- package/src/hooks/use-debounce.ts +8 -8
- package/src/icons/crown.icon.tsx +18 -5
- package/src/icons/outline/outline-default.preview.tsx +2 -2
- package/src/icons/outline/outline.tsx +4 -4
- package/src/icons/outline/photograph/photograph.icon.tsx +3 -6
- package/src/icons/solid/photograph/photograph-solid.icon.tsx +4 -4
- package/src/icons/solid/share/share.icon.tsx +1 -3
- package/src/icons/solid/solid.tsx +4 -4
- package/src/models/time-slot-sequence.ts +13 -9
- package/src/theme/provider/parent.theme.ts +4 -4
- package/src/theme/provider/staff-member.theme.ts +4 -4
- package/src/types/state.enum.ts +5 -5
- package/src/utilities/color-handler/color-handler.ts +2 -3
- package/tsconfig.json +2 -1
- package/src/components/organisms/day-select/day-select.component.d.ts +0 -9
- package/src/components/organisms/day-select/day-select.component.tsx +0 -108
- package/src/components/organisms/day-select/day-select.preview.d.ts +0 -2
- package/src/components/organisms/day-select/day-select.preview.tsx +0 -23
- package/src/components/organisms/day-select/day-select.styles.d.ts +0 -18
- package/src/components/organisms/day-select/day-select.styles.js +0 -22
- package/src/components/organisms/tab-view/__snapshots__/tab-view.test.js.snap +0 -421
- package/src/components/organisms/tab-view/tab-view.component.d.ts +0 -12
- package/src/components/organisms/tab-view/tab-view.component.tsx +0 -49
- package/src/components/organisms/tab-view/tab-view.preview.d.ts +0 -2
- package/src/components/organisms/tab-view/tab-view.preview.tsx +0 -37
- package/src/components/organisms/tab-view/tab-view.styles.d.ts +0 -10
- package/src/components/organisms/tab-view/tab-view.styles.js +0 -14
- package/src/components/organisms/tab-view/tab-view.test.js +0 -37
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
export function Stylesheet(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
export function Stylesheet(
|
|
2
|
+
context: any,
|
|
3
|
+
selectedMessage: any
|
|
4
|
+
): {
|
|
5
|
+
container: {
|
|
6
|
+
width: '100%';
|
|
7
|
+
backgroundColor: any;
|
|
8
|
+
paddingTop: number;
|
|
9
|
+
paddingBottom: number;
|
|
10
|
+
paddingRight: number;
|
|
11
|
+
paddingLeft: number;
|
|
12
|
+
borderBottomLeftRadius: number;
|
|
13
|
+
borderTopLeftRadius: number;
|
|
14
|
+
borderTopRightRadius: number;
|
|
15
|
+
borderBottomRightRadius: number;
|
|
16
|
+
};
|
|
14
17
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export function Stylesheet(context: any): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
element: {
|
|
3
|
+
width: '100%';
|
|
4
|
+
paddingRight: number;
|
|
5
|
+
paddingLeft: number;
|
|
6
|
+
};
|
|
7
|
+
inner: {
|
|
8
|
+
flexDirection: 'row';
|
|
9
|
+
justifyContent: 'center';
|
|
10
|
+
};
|
|
11
|
+
twoElements: {
|
|
12
|
+
justifyContent: 'space-between';
|
|
13
|
+
};
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ImageSourcePropType } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType } from 'react-native';
|
|
3
3
|
interface AmountProps {
|
|
4
4
|
initialAmount: number;
|
|
5
5
|
image?: ImageSourcePropType;
|
|
@@ -8,5 +8,5 @@ interface AmountProps {
|
|
|
8
8
|
onSave: (num: number) => void;
|
|
9
9
|
readonly: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const Amount: ({ initialAmount, image, label, description, onSave, readonly }: AmountProps) => React.JSX.Element;
|
|
11
|
+
export declare const Amount: ({ initialAmount, image, label, description, onSave, readonly, }: AmountProps) => React.JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,123 +1,148 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, {useEffect, useState} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ImageSourcePropType,
|
|
4
|
+
Pressable,
|
|
5
|
+
View,
|
|
6
|
+
Image,
|
|
7
|
+
ImageStyle,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import {useContext} from 'react';
|
|
4
10
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import {Stylesheet} from './amount.styles';
|
|
12
|
+
import {Paragraph} from '../../atoms/paragraph-components';
|
|
13
|
+
import {IncrementInput} from '../../atoms/increment-input/increment-input.component';
|
|
14
|
+
import {Icon} from '../../../icons';
|
|
15
|
+
import {Count} from '../../atoms/count/count.component';
|
|
16
|
+
import {PressableIcon} from '../pressable-icon/pressable-icon.component';
|
|
11
17
|
|
|
12
18
|
interface AmountProps {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
initialAmount: number;
|
|
20
|
+
image?: ImageSourcePropType;
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
onSave: (num: number) => void;
|
|
24
|
+
readonly: boolean;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export const Amount = ({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
initialAmount,
|
|
29
|
+
image,
|
|
30
|
+
label,
|
|
31
|
+
description,
|
|
32
|
+
onSave,
|
|
33
|
+
readonly,
|
|
28
34
|
}: AmountProps) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const [editMode, setEditMode] = useState(false);
|
|
36
|
+
const [countdown, setCountdown] = useState(0);
|
|
37
|
+
const [amount, setAmount] = useState(initialAmount);
|
|
38
|
+
const [intId, setIntId] = useState<NodeJS.Timer | null>(null);
|
|
39
|
+
const context = useContext(ThemeCtx);
|
|
40
|
+
const styles = Stylesheet(context);
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
const startEditMode = () => {
|
|
43
|
+
setCountdown(3);
|
|
44
|
+
setEditMode(true);
|
|
45
|
+
};
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
const resetEditModeCountDown = () => {
|
|
48
|
+
setCountdown(3);
|
|
49
|
+
};
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
const updateAmount = (num: number) => {
|
|
52
|
+
setAmount(num);
|
|
53
|
+
// on update we rest the timer
|
|
54
|
+
resetEditModeCountDown();
|
|
55
|
+
};
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (editMode) {
|
|
59
|
-
const interval = setInterval(() => {
|
|
60
|
-
if (countdown > 0) {
|
|
61
|
-
setCountdown(countdown - 1);
|
|
62
|
-
} else if (countdown === 0) {
|
|
63
|
-
// Handle save when time is up.
|
|
64
|
-
saveChargedProduct();
|
|
65
|
-
}
|
|
66
|
-
}, 1000);
|
|
67
|
-
setIntId(interval);
|
|
68
|
-
|
|
69
|
-
return () => clearInterval(interval);
|
|
70
|
-
}
|
|
71
|
-
}, [countdown, editMode]);
|
|
57
|
+
const saveChargedProduct = () => {
|
|
58
|
+
onSave(amount);
|
|
59
|
+
setEditMode(false);
|
|
60
|
+
if (intId) clearInterval(intId);
|
|
61
|
+
};
|
|
72
62
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (editMode) {
|
|
65
|
+
const interval = setInterval(() => {
|
|
66
|
+
if (countdown > 0) {
|
|
67
|
+
setCountdown(countdown - 1);
|
|
68
|
+
} else if (countdown === 0) {
|
|
69
|
+
// Handle save when time is up.
|
|
70
|
+
saveChargedProduct();
|
|
78
71
|
}
|
|
72
|
+
}, 1000);
|
|
73
|
+
setIntId(interval);
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
<Icon key={label} name="photograph" style="regular" color={context.colors.ui.grey} />
|
|
82
|
-
</>
|
|
75
|
+
return () => clearInterval(interval);
|
|
83
76
|
}
|
|
77
|
+
}, [countdown, editMode]);
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<PressableIcon
|
|
93
|
-
onPress={saveChargedProduct}
|
|
94
|
-
icon={
|
|
95
|
-
<Icon key={label} name="check-circle" style="regular" />
|
|
96
|
-
}
|
|
97
|
-
/>
|
|
98
|
-
</>
|
|
99
|
-
) : (
|
|
100
|
-
<Pressable onPress={startEditMode}>
|
|
101
|
-
<Count count={amount} />
|
|
102
|
-
</Pressable>
|
|
103
|
-
)}
|
|
104
|
-
</View>
|
|
79
|
+
const renderImage = () => {
|
|
80
|
+
if (image) {
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<Image source={image} style={styles.image as ImageStyle} />
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
105
86
|
}
|
|
106
87
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
<Icon
|
|
91
|
+
key={label}
|
|
92
|
+
name="photograph"
|
|
93
|
+
style="regular"
|
|
94
|
+
color={context.colors.ui.grey}
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
110
99
|
|
|
100
|
+
const renderInput = () => {
|
|
111
101
|
return (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
102
|
+
<View style={styles.incrementContainer}>
|
|
103
|
+
{editMode ? (
|
|
104
|
+
<>
|
|
105
|
+
<View>
|
|
106
|
+
<IncrementInput value={amount} onPress={updateAmount} />
|
|
115
107
|
</View>
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
<PressableIcon
|
|
109
|
+
onPress={saveChargedProduct}
|
|
110
|
+
icon={<Icon key={label} name="check-circle" style="regular" />}
|
|
111
|
+
/>
|
|
112
|
+
</>
|
|
113
|
+
) : (
|
|
114
|
+
<Pressable onPress={startEditMode}>
|
|
115
|
+
<Count count={amount} />
|
|
116
|
+
</Pressable>
|
|
117
|
+
)}
|
|
118
|
+
</View>
|
|
122
119
|
);
|
|
123
|
-
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const renderCount = () => {
|
|
123
|
+
return <Count disabled={true} count={amount} />;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<View style={styles.rootContainer}>
|
|
128
|
+
<View style={styles.imageContainer}>{renderImage()}</View>
|
|
129
|
+
<View style={styles.container}>
|
|
130
|
+
<Paragraph bold={true} numberOfLines={1} ellipsizeMode="tail">
|
|
131
|
+
{label}
|
|
132
|
+
</Paragraph>
|
|
133
|
+
{description ? (
|
|
134
|
+
<Paragraph
|
|
135
|
+
textColor={context.colors.ui.darkgrey}
|
|
136
|
+
numberOfLines={1}
|
|
137
|
+
ellipsizeMode="tail"
|
|
138
|
+
>
|
|
139
|
+
{description}
|
|
140
|
+
</Paragraph>
|
|
141
|
+
) : (
|
|
142
|
+
<></>
|
|
143
|
+
)}
|
|
144
|
+
{readonly ? renderCount() : renderInput()}
|
|
145
|
+
</View>
|
|
146
|
+
</View>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {ScrollView} from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import {Amount} from './amount.component';
|
|
4
|
+
import {Scale} from '../../../theme/scale';
|
|
5
5
|
const {View} = require('react-native');
|
|
6
6
|
|
|
7
7
|
export const AmountPreview = ({}: {}) => {
|
|
@@ -12,17 +12,65 @@ export const AmountPreview = ({}: {}) => {
|
|
|
12
12
|
flex: 1,
|
|
13
13
|
backgroundColor: 'white',
|
|
14
14
|
padding: Scale.m,
|
|
15
|
-
overflow: 'hidden'
|
|
15
|
+
overflow: 'hidden',
|
|
16
16
|
}}
|
|
17
17
|
>
|
|
18
|
-
<Amount
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<Amount
|
|
25
|
-
|
|
18
|
+
<Amount
|
|
19
|
+
readonly={false}
|
|
20
|
+
initialAmount={9}
|
|
21
|
+
label="Maaltijd"
|
|
22
|
+
onSave={(num) => console.log(num)}
|
|
23
|
+
/>
|
|
24
|
+
<Amount
|
|
25
|
+
readonly={false}
|
|
26
|
+
initialAmount={2}
|
|
27
|
+
image={require('./../../../../assets/components/avatar/baby.png')}
|
|
28
|
+
label="Maaltijd"
|
|
29
|
+
onSave={(num) => console.log(num)}
|
|
30
|
+
/>
|
|
31
|
+
<Amount
|
|
32
|
+
readonly={false}
|
|
33
|
+
initialAmount={5}
|
|
34
|
+
label="Maaltijd veggy"
|
|
35
|
+
description="Hmm, lekker hoor"
|
|
36
|
+
onSave={(num) => console.log(num)}
|
|
37
|
+
/>
|
|
38
|
+
<Amount
|
|
39
|
+
readonly={false}
|
|
40
|
+
initialAmount={1}
|
|
41
|
+
image={require('./../../../../assets/components/avatar/baby.png')}
|
|
42
|
+
label="Maaltijd met een lekkere lange titel"
|
|
43
|
+
description="Hmm, lekker hoor. Met een sappige beschrijving"
|
|
44
|
+
onSave={(num) => console.log(num)}
|
|
45
|
+
/>
|
|
46
|
+
<Amount
|
|
47
|
+
readonly={true}
|
|
48
|
+
initialAmount={9}
|
|
49
|
+
label="Maaltijd"
|
|
50
|
+
onSave={(num) => console.log(num)}
|
|
51
|
+
/>
|
|
52
|
+
<Amount
|
|
53
|
+
readonly={true}
|
|
54
|
+
initialAmount={2}
|
|
55
|
+
image={require('./../../../../assets/components/avatar/baby.png')}
|
|
56
|
+
label="Maaltijd"
|
|
57
|
+
onSave={(num) => console.log(num)}
|
|
58
|
+
/>
|
|
59
|
+
<Amount
|
|
60
|
+
readonly={true}
|
|
61
|
+
initialAmount={5}
|
|
62
|
+
label="Maaltijd veggy"
|
|
63
|
+
description="Hmm, lekker hoor"
|
|
64
|
+
onSave={(num) => console.log(num)}
|
|
65
|
+
/>
|
|
66
|
+
<Amount
|
|
67
|
+
readonly={true}
|
|
68
|
+
initialAmount={1}
|
|
69
|
+
image={require('./../../../../assets/components/avatar/baby.png')}
|
|
70
|
+
label="Maaltijd met een lekkere lange titel"
|
|
71
|
+
description="Hmm, lekker hoor. Met een sappige beschrijving"
|
|
72
|
+
onSave={(num) => console.log(num)}
|
|
73
|
+
/>
|
|
26
74
|
</View>
|
|
27
75
|
</ScrollView>
|
|
28
76
|
);
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
export function Stylesheet(context: any): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
2
|
+
rootContainer: {
|
|
3
|
+
flexDirection: 'row';
|
|
4
|
+
borderBottomColor: any;
|
|
5
|
+
borderBottomWidth: number;
|
|
6
|
+
gap: number;
|
|
7
|
+
};
|
|
8
|
+
imageContainer: {
|
|
9
|
+
backgroundColor: any;
|
|
10
|
+
width: number;
|
|
11
|
+
alignItems: 'center';
|
|
12
|
+
justifyContent: 'center';
|
|
13
|
+
position: 'relative';
|
|
14
|
+
};
|
|
15
|
+
image: {
|
|
16
|
+
position: 'absolute';
|
|
17
|
+
width: '100%';
|
|
18
|
+
height: '100%';
|
|
19
|
+
objectFit: 'cover';
|
|
20
|
+
};
|
|
21
|
+
container: {
|
|
22
|
+
paddingBottom: number;
|
|
23
|
+
paddingTop: number;
|
|
24
|
+
paddingRight: number;
|
|
25
|
+
alignItems: 'flex-start';
|
|
26
|
+
gap: number;
|
|
27
|
+
flex: number;
|
|
28
|
+
};
|
|
29
|
+
incrementContainer: {
|
|
30
|
+
height: number;
|
|
31
|
+
flexDirection: 'row';
|
|
32
|
+
gap: number;
|
|
33
|
+
justifyContent: 'flex-start';
|
|
34
|
+
alignItems: 'center';
|
|
35
|
+
};
|
|
36
36
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {StyleSheet} from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import {Scale} from '../../../theme/scale';
|
|
3
3
|
|
|
4
4
|
export const Stylesheet = (context) =>
|
|
5
5
|
StyleSheet.create({
|
|
@@ -12,15 +12,15 @@ export const Stylesheet = (context) =>
|
|
|
12
12
|
imageContainer: {
|
|
13
13
|
backgroundColor: context.colors.ui.xlightgrey,
|
|
14
14
|
width: 120,
|
|
15
|
-
alignItems:
|
|
16
|
-
justifyContent:
|
|
17
|
-
position:
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
position: 'relative',
|
|
18
18
|
},
|
|
19
|
-
image
|
|
19
|
+
image: {
|
|
20
20
|
position: 'absolute',
|
|
21
21
|
width: '100%',
|
|
22
22
|
height: '100%',
|
|
23
|
-
objectFit: 'cover'
|
|
23
|
+
objectFit: 'cover',
|
|
24
24
|
},
|
|
25
25
|
container: {
|
|
26
26
|
paddingBottom: Scale.s,
|
|
@@ -28,7 +28,7 @@ export const Stylesheet = (context) =>
|
|
|
28
28
|
paddingRight: Scale.s,
|
|
29
29
|
alignItems: 'flex-start',
|
|
30
30
|
gap: Scale.xxs,
|
|
31
|
-
flex: 1
|
|
31
|
+
flex: 1,
|
|
32
32
|
},
|
|
33
33
|
incrementContainer: {
|
|
34
34
|
height: 50,
|
|
@@ -11,5 +11,5 @@ type AvatarProps = {
|
|
|
11
11
|
hasShadow?: boolean;
|
|
12
12
|
isBirthday?: boolean;
|
|
13
13
|
};
|
|
14
|
-
declare const Avatar: ({ source, size, isBlocked, isActive, isLoading, hasShadow, isBirthday }: AvatarProps) => React.JSX.Element;
|
|
14
|
+
declare const Avatar: ({ source, size, isBlocked, isActive, isLoading, hasShadow, isBirthday, }: AvatarProps) => React.JSX.Element;
|
|
15
15
|
export { Avatar as Avatar };
|
|
@@ -14,7 +14,7 @@ import {Size} from '../../../types/size.enum';
|
|
|
14
14
|
import {Initials} from '../../../models/initials.model';
|
|
15
15
|
import {MainGradient} from '../../../gradients/main/main.gradient';
|
|
16
16
|
import {Heading1, Heading2, Heading3} from '../../atoms/heading-components';
|
|
17
|
-
import {
|
|
17
|
+
import {CrownIcon} from '../../../icons/crown.icon';
|
|
18
18
|
|
|
19
19
|
type AvatarProps = {
|
|
20
20
|
source: ImageSourcePropType | Initials;
|
|
@@ -33,18 +33,20 @@ const Avatar = ({
|
|
|
33
33
|
isActive = true,
|
|
34
34
|
isLoading,
|
|
35
35
|
hasShadow,
|
|
36
|
-
isBirthday
|
|
36
|
+
isBirthday,
|
|
37
37
|
}: AvatarProps) => {
|
|
38
38
|
const Context = useContext(ThemeCtx);
|
|
39
39
|
const styles = Stylesheet(Context, size, isBlocked, isActive);
|
|
40
40
|
|
|
41
41
|
const renderCrown = () => {
|
|
42
42
|
if (isBirthday) {
|
|
43
|
-
return
|
|
44
|
-
<
|
|
45
|
-
|
|
43
|
+
return (
|
|
44
|
+
<View style={styles.crownContainer}>
|
|
45
|
+
<CrownIcon />
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
46
48
|
}
|
|
47
|
-
}
|
|
49
|
+
};
|
|
48
50
|
|
|
49
51
|
const renderText = (size: Size) => {
|
|
50
52
|
if (size === Size.SMALL) {
|