@tactics/toddle-styleguide 1.2.4 → 1.2.5
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 +8 -0
- package/index.d.ts +2 -1
- package/index.tsx +2 -0
- package/package.json +2 -2
- package/src/components/atoms/backdrop/backdrop.component.d.ts +2 -1
- package/src/components/atoms/backdrop/backdrop.component.tsx +8 -2
- package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +18 -18
- package/src/components/atoms/text-input/text-input.component.d.ts +4 -5
- package/src/components/atoms/text-input/text-input.component.tsx +9 -13
- package/src/components/atoms/text-input/text-input.preview.tsx +5 -5
- package/src/components/atoms/text-input/text-input.test.js +4 -4
- package/src/components/molecules/button/__snapshots__/button.test.js.snap +144 -0
- package/src/components/molecules/button/button.component.d.ts +6 -4
- package/src/components/molecules/button/button.component.tsx +30 -9
- package/src/components/molecules/button/button.preview.tsx +16 -1
- package/src/components/molecules/button/button.styles.d.ts +13 -16
- package/src/components/molecules/button/button.styles.js +2 -4
- package/src/components/molecules/button/button.test.js +12 -0
- package/src/components/molecules/message-input/__snapshots__/message-input.test.js.snap +4 -0
- package/src/components/molecules/message-input/message-input.component.d.ts +4 -6
- package/src/components/molecules/message-input/message-input.component.tsx +10 -12
- package/src/components/molecules/message-input/message-input.preview.tsx +28 -15
- package/src/components/molecules/password-input/password-input.component.d.ts +4 -6
- package/src/components/molecules/password-input/password-input.component.tsx +11 -15
- package/src/components/molecules/swipe/__snapshots__/swipe.test.js.snap +263 -420
- package/src/components/molecules/swipe/swipe.component.d.ts +4 -4
- package/src/components/molecules/swipe/swipe.component.tsx +47 -20
- package/src/components/molecules/swipe/swipe.preview.tsx +111 -51
- package/src/components/molecules/swipe/swipe.styles.d.ts +28 -0
- package/src/components/molecules/swipe/swipe.styles.js +32 -0
- package/src/components/molecules/swipe/swipe.test.js +1 -1
- package/src/components/molecules/tag/__snapshots__/tag.test.js.snap +10 -10
- package/src/components/molecules/tag/tag.component.d.ts +3 -8
- package/src/components/molecules/tag/tag.component.tsx +7 -13
- package/src/components/molecules/tag/tag.preview.tsx +22 -19
- package/src/components/molecules/tag/tag.styles.js +4 -2
- package/src/components/molecules/tag/tag.test.js +10 -2
- package/src/components/molecules/timestamp/__snapshots__/timestamp.test.js.snap +1 -1
- package/src/components/molecules/timestamp/timestamp.component.tsx +0 -2
- package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +7 -7
- package/src/components/templates/modal/modal.component.tsx +0 -1
- package/src/components/templates/popover-action/popover-action.component.d.ts +8 -0
- package/src/components/templates/popover-action/popover-action.component.tsx +119 -0
- package/src/components/templates/popover-action/popover-action.preview.d.ts +1 -0
- package/src/components/templates/popover-action/popover-action.preview.tsx +142 -0
- package/src/components/templates/popover-action/popover-action.styles.d.ts +26 -0
- package/src/components/templates/popover-action/popover-action.styles.js +31 -0
- package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +4 -0
- package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +16 -0
- package/src/components/molecules/swipe/Swipe.styles.d.ts +0 -7
- package/src/components/molecules/swipe/Swipe.styles.js +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
type SwipeProps = {
|
|
3
|
-
children:
|
|
4
|
-
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onIndexChange?: (index: number) => void;
|
|
5
5
|
};
|
|
6
|
-
declare const Swipe: ({ children,
|
|
6
|
+
declare const Swipe: ({ children, onIndexChange }: SwipeProps) => JSX.Element;
|
|
7
7
|
export { Swipe as Swipe };
|
|
@@ -1,50 +1,77 @@
|
|
|
1
|
-
import React, {Children, useContext} from 'react';
|
|
1
|
+
import React, {Children, ReactNode, useContext, useRef, useState} from 'react';
|
|
2
2
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
3
|
-
import
|
|
4
|
-
import {View} from 'react-native';
|
|
5
|
-
import {Stylesheet} from './Swipe.styles';
|
|
3
|
+
import {Stylesheet} from './swipe.styles';
|
|
6
4
|
import {Icon} from '../../../icons/index';
|
|
5
|
+
import PagerView, {PagerViewOnPageSelectedEvent} from 'react-native-pager-view';
|
|
6
|
+
import {Pressable, View} from 'react-native';
|
|
7
7
|
|
|
8
8
|
type SwipeProps = {
|
|
9
|
-
children:
|
|
10
|
-
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onIndexChange?: (index: number) => void;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const Swipe = ({children,
|
|
13
|
+
const Swipe = ({children, onIndexChange}: SwipeProps) => {
|
|
14
14
|
const context = useContext(ThemeCtx);
|
|
15
15
|
const styles = Stylesheet();
|
|
16
|
+
const viewPagerRef = useRef<PagerView>(null);
|
|
17
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
18
|
+
|
|
16
19
|
const count = Children.count(children);
|
|
17
20
|
|
|
18
21
|
if (count > 5) {
|
|
19
22
|
console.warn(' for more then 5 child-components, use another way to show');
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
const handlePageSelected = (event: PagerViewOnPageSelectedEvent) => {
|
|
26
|
+
const currentIndex = event.nativeEvent.position;
|
|
27
|
+
setCurrentPage(currentIndex);
|
|
28
|
+
|
|
29
|
+
if (onIndexChange) {
|
|
30
|
+
onIndexChange(currentIndex);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
22
34
|
return (
|
|
23
|
-
<View style={styles.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
<View style={styles.rootContainer}>
|
|
36
|
+
{currentPage !== 0 && (
|
|
37
|
+
<Pressable
|
|
38
|
+
style={styles.leftArrowContainer}
|
|
39
|
+
onPress={() =>
|
|
40
|
+
viewPagerRef.current?.setPage(
|
|
41
|
+
currentPage != 1 ? currentPage - 1 : 0
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
>
|
|
32
45
|
<Icon
|
|
33
46
|
style={'regular'}
|
|
34
47
|
name={'chevron-left'}
|
|
35
48
|
color={context.colors.main['0']}
|
|
36
49
|
/>
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
</Pressable>
|
|
51
|
+
)}
|
|
52
|
+
|
|
53
|
+
{currentPage !== count - 1 && (
|
|
54
|
+
<Pressable
|
|
55
|
+
style={styles.rightArrowContainer}
|
|
56
|
+
onPress={() => viewPagerRef.current?.setPage(currentPage + 1)}
|
|
57
|
+
>
|
|
39
58
|
<Icon
|
|
40
59
|
style={'regular'}
|
|
41
60
|
name={'chevron-right'}
|
|
42
61
|
color={context.colors.main['0']}
|
|
43
62
|
/>
|
|
44
|
-
|
|
63
|
+
</Pressable>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
<PagerView
|
|
67
|
+
ref={viewPagerRef}
|
|
68
|
+
style={styles.swipeContainer}
|
|
69
|
+
initialPage={0}
|
|
70
|
+
collapsable={false}
|
|
71
|
+
onPageSelected={handlePageSelected}
|
|
45
72
|
>
|
|
46
73
|
{children}
|
|
47
|
-
</
|
|
74
|
+
</PagerView>
|
|
48
75
|
</View>
|
|
49
76
|
);
|
|
50
77
|
};
|
|
@@ -1,63 +1,123 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
2
|
import {Swipe} from './swipe.component';
|
|
3
3
|
import {View} from 'react-native';
|
|
4
|
+
import {Heading2} from '../../atoms/heading-components';
|
|
5
|
+
import {Icon} from '../../../icons/index';
|
|
6
|
+
import {TimePicker} from '../time-picker/time-picker.component';
|
|
7
|
+
import {Paragraph} from '../../atoms/paragraph-components';
|
|
4
8
|
import {Button} from '../button/button.component';
|
|
5
|
-
import {Pill} from '../pill/pill.component';
|
|
6
|
-
import {VisualState} from '../../../types/visual-state.enum';
|
|
7
9
|
|
|
8
10
|
export const SwipePreview = ({}: {}) => {
|
|
11
|
+
const [checkInHours, setCheckInHours] = useState('09');
|
|
12
|
+
const [checkInMinutes, setCheckInMinutes] = useState('06');
|
|
13
|
+
|
|
9
14
|
return (
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
<Button
|
|
38
|
-
label={'button 2'}
|
|
39
|
-
onPress={() => console.log('button 2 pressed')}
|
|
40
|
-
/>
|
|
15
|
+
<Swipe>
|
|
16
|
+
{/*FIRST CHILD*/}
|
|
17
|
+
<View
|
|
18
|
+
style={{
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
gap: 60,
|
|
21
|
+
}}
|
|
22
|
+
key={1}
|
|
23
|
+
>
|
|
24
|
+
<View style={{gap: 10}}>
|
|
25
|
+
<Heading2 bold={true} textAlign={'center'}>
|
|
26
|
+
Uurregistratie
|
|
27
|
+
</Heading2>
|
|
28
|
+
|
|
29
|
+
<View
|
|
30
|
+
style={{
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
gap: 16,
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<Icon style={'regular'} name={'calendar'} color={'#000000'} />
|
|
38
|
+
<View>
|
|
39
|
+
<Paragraph>17 Jan 2021</Paragraph>
|
|
40
|
+
</View>
|
|
41
|
+
</View>
|
|
41
42
|
</View>
|
|
42
|
-
<
|
|
43
|
-
|
|
43
|
+
<TimePicker
|
|
44
|
+
initialHours={checkInHours}
|
|
45
|
+
initialMinutes={checkInMinutes}
|
|
46
|
+
onChangeHours={setCheckInHours}
|
|
47
|
+
onChangeMinutes={setCheckInMinutes}
|
|
48
|
+
/>
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
{/*SECOND CHILD*/}
|
|
52
|
+
|
|
53
|
+
<View
|
|
54
|
+
style={{
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
gap: 60,
|
|
57
|
+
}}
|
|
58
|
+
key={2}
|
|
59
|
+
>
|
|
60
|
+
<View style={{gap: 12}}>
|
|
61
|
+
<Heading2 bold={true} textAlign={'center'}>
|
|
62
|
+
Uurregistratie
|
|
63
|
+
</Heading2>
|
|
64
|
+
|
|
65
|
+
<View
|
|
66
|
+
style={{
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
gap: 16,
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<Icon style={'regular'} name={'calendar'} color={'#000000'} />
|
|
74
|
+
<View>
|
|
75
|
+
<Paragraph>17 Jan 2021</Paragraph>
|
|
76
|
+
</View>
|
|
77
|
+
</View>
|
|
44
78
|
</View>
|
|
45
79
|
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
<Button label={'Test button'} onPress={() => console.log('pressed')} />
|
|
81
|
+
</View>
|
|
82
|
+
|
|
83
|
+
{/*THIRD CHILD*/}
|
|
84
|
+
|
|
85
|
+
<View
|
|
86
|
+
style={{
|
|
87
|
+
alignItems: 'center',
|
|
88
|
+
gap: 60,
|
|
89
|
+
}}
|
|
90
|
+
key={3}
|
|
91
|
+
>
|
|
92
|
+
<View style={{gap: 12}}>
|
|
93
|
+
<Heading2 bold={true} textAlign={'center'}>
|
|
94
|
+
Uurregistratie
|
|
95
|
+
</Heading2>
|
|
96
|
+
|
|
97
|
+
<View
|
|
98
|
+
style={{
|
|
99
|
+
flexDirection: 'row',
|
|
100
|
+
gap: 16,
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<Icon style={'regular'} name={'calendar'} color={'#000000'} />
|
|
106
|
+
<View>
|
|
107
|
+
<Paragraph>17 Jan 2021</Paragraph>
|
|
108
|
+
</View>
|
|
109
|
+
</View>
|
|
59
110
|
</View>
|
|
60
|
-
|
|
61
|
-
|
|
111
|
+
|
|
112
|
+
<TimePicker
|
|
113
|
+
initialHours={checkInHours}
|
|
114
|
+
initialMinutes={checkInMinutes}
|
|
115
|
+
onChangeHours={setCheckInHours}
|
|
116
|
+
onChangeMinutes={setCheckInMinutes}
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<Button label={'Test button'} onPress={() => console.log('pressed')} />
|
|
120
|
+
</View>
|
|
121
|
+
</Swipe>
|
|
62
122
|
);
|
|
63
123
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function Stylesheet(): {
|
|
2
|
+
rootContainer: {
|
|
3
|
+
flex: number;
|
|
4
|
+
};
|
|
5
|
+
leftArrowContainer: {
|
|
6
|
+
alignItems: 'center';
|
|
7
|
+
justifyContent: 'center';
|
|
8
|
+
position: 'absolute';
|
|
9
|
+
zIndex: number;
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
rightArrowContainer: {
|
|
16
|
+
alignItems: 'center';
|
|
17
|
+
justifyContent: 'center';
|
|
18
|
+
position: 'absolute';
|
|
19
|
+
zIndex: number;
|
|
20
|
+
top: number;
|
|
21
|
+
right: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
swipeContainer: {
|
|
26
|
+
flex: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {StyleSheet} from 'react-native';
|
|
3
|
+
import {Scale} from '../../../theme/scale/index';
|
|
4
|
+
export const Stylesheet = () =>
|
|
5
|
+
StyleSheet.create({
|
|
6
|
+
rootContainer: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
},
|
|
9
|
+
leftArrowContainer: {
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
zIndex: 10,
|
|
14
|
+
top: Scale.s,
|
|
15
|
+
left: 0,
|
|
16
|
+
width: 42,
|
|
17
|
+
height: 42,
|
|
18
|
+
},
|
|
19
|
+
rightArrowContainer: {
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
zIndex: 10,
|
|
24
|
+
top: Scale.s,
|
|
25
|
+
right: 0,
|
|
26
|
+
width: 42,
|
|
27
|
+
height: 42,
|
|
28
|
+
},
|
|
29
|
+
swipeContainer: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -5,7 +5,7 @@ import {View} from 'react-native';
|
|
|
5
5
|
import {Button} from '../button/button.component';
|
|
6
6
|
|
|
7
7
|
describe('Test Swipe component', () => {
|
|
8
|
-
it('should render an swipe component with
|
|
8
|
+
it('should render an swipe component with navigation arrows', () => {
|
|
9
9
|
const tree = renderer
|
|
10
10
|
.create(
|
|
11
11
|
<Swipe>
|
|
@@ -39,8 +39,10 @@ exports[`test Tag renders Tag correctly (blue, bold grey text) when isSelected i
|
|
|
39
39
|
"backgroundColor": "#E5E8EB",
|
|
40
40
|
"borderRadius": 50,
|
|
41
41
|
"justifyContent": "center",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"paddingBottom": 8,
|
|
43
|
+
"paddingLeft": 12,
|
|
44
|
+
"paddingRight": 12,
|
|
45
|
+
"paddingTop": 8,
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
>
|
|
@@ -62,9 +64,7 @@ exports[`test Tag renders Tag correctly (blue, bold grey text) when isSelected i
|
|
|
62
64
|
undefined,
|
|
63
65
|
]
|
|
64
66
|
}
|
|
65
|
-
|
|
66
|
-
Geblokkeerd
|
|
67
|
-
</Text>
|
|
67
|
+
/>
|
|
68
68
|
</View>
|
|
69
69
|
</View>
|
|
70
70
|
`;
|
|
@@ -108,8 +108,10 @@ exports[`test Tag renders Tag correctly (grey, black text) 1`] = `
|
|
|
108
108
|
"backgroundColor": "#E5E8EB",
|
|
109
109
|
"borderRadius": 50,
|
|
110
110
|
"justifyContent": "center",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
111
|
+
"paddingBottom": 8,
|
|
112
|
+
"paddingLeft": 12,
|
|
113
|
+
"paddingRight": 12,
|
|
114
|
+
"paddingTop": 8,
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
>
|
|
@@ -131,9 +133,7 @@ exports[`test Tag renders Tag correctly (grey, black text) 1`] = `
|
|
|
131
133
|
undefined,
|
|
132
134
|
]
|
|
133
135
|
}
|
|
134
|
-
|
|
135
|
-
Geblokkeerd
|
|
136
|
-
</Text>
|
|
136
|
+
/>
|
|
137
137
|
</View>
|
|
138
138
|
</View>
|
|
139
139
|
`;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
export interface TagPressEvent {
|
|
2
|
-
value: string;
|
|
3
|
-
isSelected: boolean;
|
|
4
|
-
}
|
|
5
1
|
type TagProps = {
|
|
6
2
|
value: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onPress: (event: TagPressEvent) => void;
|
|
3
|
+
label: string;
|
|
4
|
+
onPress: (event: string) => void;
|
|
10
5
|
};
|
|
11
|
-
declare const Tag: ({
|
|
6
|
+
declare const Tag: ({ label, onPress, value }: TagProps) => JSX.Element;
|
|
12
7
|
export { Tag as Tag };
|
|
@@ -6,26 +6,20 @@ import {Stylesheet} from './tag.styles';
|
|
|
6
6
|
import {View, Pressable} from 'react-native';
|
|
7
7
|
import {SmallText} from '../../atoms/paragraph-components';
|
|
8
8
|
|
|
9
|
-
export interface TagPressEvent {
|
|
10
|
-
value: string;
|
|
11
|
-
isSelected: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
9
|
type TagProps = {
|
|
15
10
|
value: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onPress: (event: TagPressEvent) => void;
|
|
11
|
+
label: string;
|
|
12
|
+
onPress: (event: string) => void;
|
|
19
13
|
};
|
|
20
14
|
|
|
21
|
-
const Tag = ({
|
|
15
|
+
const Tag = ({label, onPress, value}: TagProps) => {
|
|
16
|
+
const [isSelectedTag, setIsSelectedTag] = useState(false);
|
|
22
17
|
const context = useContext(ThemeCtx);
|
|
23
|
-
const [isSelectedTag, setIsSelectedTag] = useState(isSelected);
|
|
24
18
|
const styles = Stylesheet(context, isSelectedTag);
|
|
25
19
|
|
|
26
20
|
const onClicked = () => {
|
|
27
21
|
setIsSelectedTag((current) => !current);
|
|
28
|
-
onPress(
|
|
22
|
+
onPress(value);
|
|
29
23
|
};
|
|
30
24
|
|
|
31
25
|
return (
|
|
@@ -37,10 +31,10 @@ const Tag = ({text, isSelected, onPress, value}: TagProps) => {
|
|
|
37
31
|
textAlign={'center'}
|
|
38
32
|
textColor={context.colors.main[9]}
|
|
39
33
|
>
|
|
40
|
-
{
|
|
34
|
+
{label}
|
|
41
35
|
</SmallText>
|
|
42
36
|
) : (
|
|
43
|
-
<SmallText textAlign={'center'}>{
|
|
37
|
+
<SmallText textAlign={'center'}>{label}</SmallText>
|
|
44
38
|
)}
|
|
45
39
|
</View>
|
|
46
40
|
</Pressable>
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
2
|
import {Tag} from './tag.component';
|
|
3
3
|
import {View} from 'react-native';
|
|
4
4
|
|
|
5
5
|
export const TagPreview = ({}: {}) => {
|
|
6
|
+
const [value, setValue] = useState('');
|
|
7
|
+
|
|
8
|
+
console.log(value);
|
|
6
9
|
return (
|
|
7
|
-
<View
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
value={'
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
<View
|
|
11
|
+
style={{
|
|
12
|
+
width: '100%',
|
|
13
|
+
height: '100%',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
gap: 12,
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<View>
|
|
20
|
+
<Tag value={'tab1'} label={'Algemeen'} onPress={setValue} />
|
|
21
|
+
</View>
|
|
22
|
+
<View>
|
|
23
|
+
<Tag value={'tab2'} label={'Gezondheid'} onPress={setValue} />
|
|
24
|
+
</View>
|
|
25
|
+
<View>
|
|
26
|
+
<Tag value={'tab3'} label={'Activiteit'} onPress={setValue} />
|
|
27
|
+
</View>
|
|
25
28
|
</View>
|
|
26
29
|
);
|
|
27
30
|
};
|
|
@@ -8,8 +8,10 @@ export const Stylesheet = (context, isSelected) =>
|
|
|
8
8
|
borderRadius: 50,
|
|
9
9
|
alignItems: 'center',
|
|
10
10
|
justifyContent: 'center',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
paddingLeft: Scale.s,
|
|
12
|
+
paddingTop: Scale.xs,
|
|
13
|
+
paddingRight: Scale.s,
|
|
14
|
+
paddingBottom: Scale.xs,
|
|
13
15
|
backgroundColor: isSelected
|
|
14
16
|
? context.colors.main[5]
|
|
15
17
|
: context.colors.ui.lightgrey,
|
|
@@ -6,7 +6,11 @@ describe('test Tag', () => {
|
|
|
6
6
|
it('renders Tag correctly (grey, black text)', () => {
|
|
7
7
|
const tree = renderer
|
|
8
8
|
.create(
|
|
9
|
-
<Tag
|
|
9
|
+
<Tag
|
|
10
|
+
value={'Geblokkeerd'}
|
|
11
|
+
text={'Geblokkeerd'}
|
|
12
|
+
onPress={(value) => console.log(value)}
|
|
13
|
+
/>
|
|
10
14
|
)
|
|
11
15
|
.toJSON();
|
|
12
16
|
|
|
@@ -15,7 +19,11 @@ describe('test Tag', () => {
|
|
|
15
19
|
it('renders Tag correctly (blue, bold grey text) when isSelected is true', () => {
|
|
16
20
|
const tree = renderer
|
|
17
21
|
.create(
|
|
18
|
-
<Tag
|
|
22
|
+
<Tag
|
|
23
|
+
value={'Test2'}
|
|
24
|
+
text={'Tag2'}
|
|
25
|
+
onPress={(value) => console.log(value)}
|
|
26
|
+
/>
|
|
19
27
|
)
|
|
20
28
|
.toJSON();
|
|
21
29
|
|
|
@@ -15,8 +15,6 @@ export const Timestamp = ({sent}: TimestampProps) => {
|
|
|
15
15
|
|
|
16
16
|
const timestampToStringHandler = (timestamp: ToddleDateTime) => {
|
|
17
17
|
return timestamp.toLocaleString({
|
|
18
|
-
day: 'numeric',
|
|
19
|
-
month: 'short',
|
|
20
18
|
hourCycle: 'h24',
|
|
21
19
|
hour: 'numeric',
|
|
22
20
|
minute: '2-digit',
|
|
@@ -383,7 +383,7 @@ exports[`test text-bubble given the bubbleAlignment is SENT return a text-bubble
|
|
|
383
383
|
]
|
|
384
384
|
}
|
|
385
385
|
>
|
|
386
|
-
|
|
386
|
+
9:08
|
|
387
387
|
</Text>
|
|
388
388
|
</View>
|
|
389
389
|
</View>
|
|
@@ -772,7 +772,7 @@ exports[`test text-bubble given the visualState is DEFAULT return a light-blue c
|
|
|
772
772
|
]
|
|
773
773
|
}
|
|
774
774
|
>
|
|
775
|
-
|
|
775
|
+
9:08
|
|
776
776
|
</Text>
|
|
777
777
|
</View>
|
|
778
778
|
</View>
|
|
@@ -1161,7 +1161,7 @@ exports[`test text-bubble given the visualState is ERROR return a red colored te
|
|
|
1161
1161
|
]
|
|
1162
1162
|
}
|
|
1163
1163
|
>
|
|
1164
|
-
|
|
1164
|
+
9:08
|
|
1165
1165
|
</Text>
|
|
1166
1166
|
</View>
|
|
1167
1167
|
</View>
|
|
@@ -1546,7 +1546,7 @@ exports[`test text-bubble given the visualState is RECEIVE return a text-bubble
|
|
|
1546
1546
|
]
|
|
1547
1547
|
}
|
|
1548
1548
|
>
|
|
1549
|
-
|
|
1549
|
+
9:08
|
|
1550
1550
|
</Text>
|
|
1551
1551
|
</View>
|
|
1552
1552
|
</View>
|
|
@@ -1931,7 +1931,7 @@ exports[`test text-bubble given the visualState is RECEIVE return a textBubble w
|
|
|
1931
1931
|
]
|
|
1932
1932
|
}
|
|
1933
1933
|
>
|
|
1934
|
-
|
|
1934
|
+
9:08
|
|
1935
1935
|
</Text>
|
|
1936
1936
|
</View>
|
|
1937
1937
|
</View>
|
|
@@ -2320,7 +2320,7 @@ exports[`test text-bubble given the visualState is WARNING return an orange colo
|
|
|
2320
2320
|
]
|
|
2321
2321
|
}
|
|
2322
2322
|
>
|
|
2323
|
-
|
|
2323
|
+
9:08
|
|
2324
2324
|
</Text>
|
|
2325
2325
|
</View>
|
|
2326
2326
|
</View>
|
|
@@ -2767,7 +2767,7 @@ exports[`test text-bubble return a text bubble, that will be send, but does not
|
|
|
2767
2767
|
]
|
|
2768
2768
|
}
|
|
2769
2769
|
>
|
|
2770
|
-
|
|
2770
|
+
9:08
|
|
2771
2771
|
</Text>
|
|
2772
2772
|
</View>
|
|
2773
2773
|
</View>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type PopOverActionProps = {
|
|
3
|
+
isVisible: boolean;
|
|
4
|
+
touchBackDrop: (value: boolean) => void;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const PopOverAction: ({ isVisible, children, touchBackDrop, }: PopOverActionProps) => JSX.Element;
|
|
8
|
+
export {};
|