@tactics/toddle-styleguide 1.2.3 → 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 +202 -191
- 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 +1821 -641
- 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/avatar/__snapshots__/avatar.test.js.snap +70 -62
- package/src/components/molecules/avatar/avatar.component.d.ts +2 -1
- package/src/components/molecules/avatar/avatar.component.tsx +22 -11
- package/src/components/molecules/avatar/avatar.preview.tsx +58 -44
- package/src/components/molecules/avatar/avatar.styles.d.ts +54 -15
- package/src/components/molecules/avatar/avatar.styles.js +33 -5
- 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/date-input/date-input.preview.tsx +25 -23
- 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/time-picker/__snapshots__/time-picker.test.js.snap +1868 -1776
- package/src/components/molecules/time-picker/time-picker.component.tsx +49 -23
- package/src/components/molecules/time-picker/time-picker.preview.tsx +5 -4
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +16 -4
- package/src/components/molecules/time-picker/time-picker.styles.js +18 -6
- 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/child-list-item/__snapshots__/child-list-item.test.js.snap +174 -162
- package/src/components/organisms/contact-item/__snapshots__/contact-item.test.js.snap +70 -127
- package/src/components/organisms/contact-item/contact-item.component.tsx +10 -9
- package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +97 -89
- package/src/components/organisms/person-info-card/__snapshots__/person-info-card.test.js.snap +233 -209
- 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/components/modal/modal.component.tsx +0 -1
- package/src/components/templates/popover/components/modal/modal.styles.d.ts +2 -1
- package/src/components/templates/popover/components/modal/modal.styles.js +2 -2
- package/src/components/templates/popover/popover.component.tsx +27 -14
- package/src/components/templates/popover/popover.preview.tsx +63 -97
- package/src/components/templates/popover/popover.styles.d.ts +1 -1
- package/src/components/templates/popover/popover.styles.js +3 -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 +5 -0
- package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +23 -0
- package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +15 -1
- package/src/utilities/toddle-datetime/toddle-datetime.test.js +10 -0
- package/src/components/molecules/swipe/Swipe.styles.d.ts +0 -7
- package/src/components/molecules/swipe/Swipe.styles.js +0 -10
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { TextInputProps as NativeTextInputProps } from 'react-native';
|
|
1
2
|
import { KeyBoardTypes } from '../../../types/keyboard-types.enum';
|
|
2
|
-
|
|
3
|
-
placeholder?: string;
|
|
4
|
-
onchangeText?: (text: string) => void;
|
|
3
|
+
interface TextInputProps extends NativeTextInputProps {
|
|
5
4
|
keyboardType: KeyBoardTypes;
|
|
6
5
|
border?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const TextInput: ({
|
|
6
|
+
}
|
|
7
|
+
declare const TextInput: ({ keyboardType, border, ...props }: TextInputProps) => JSX.Element;
|
|
9
8
|
export { TextInput as TextInput };
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {useContext} from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
View,
|
|
6
|
+
TextInput as NativeTextInput,
|
|
7
|
+
TextInputProps as NativeTextInputProps,
|
|
8
|
+
} from 'react-native';
|
|
5
9
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
6
10
|
import {Stylesheet} from './text-input.styles';
|
|
7
11
|
import {KeyBoardTypes} from '../../../types/keyboard-types.enum';
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
onchangeText?: (text: string) => void;
|
|
13
|
+
interface TextInputProps extends NativeTextInputProps {
|
|
12
14
|
keyboardType: KeyBoardTypes;
|
|
13
15
|
border?: boolean;
|
|
14
|
-
}
|
|
16
|
+
}
|
|
15
17
|
|
|
16
|
-
const TextInput = ({
|
|
17
|
-
placeholder,
|
|
18
|
-
onchangeText,
|
|
19
|
-
keyboardType,
|
|
20
|
-
border,
|
|
21
|
-
}: TextInputProps) => {
|
|
18
|
+
const TextInput = ({keyboardType, border, ...props}: TextInputProps) => {
|
|
22
19
|
const context = useContext(ThemeCtx);
|
|
23
20
|
const styles = Stylesheet(context, border);
|
|
24
21
|
|
|
25
22
|
return (
|
|
26
23
|
<View style={styles.container}>
|
|
27
24
|
<NativeTextInput
|
|
28
|
-
placeholder={placeholder}
|
|
29
25
|
placeholderTextColor={context.colors.ui.grey}
|
|
30
26
|
style={styles.input}
|
|
31
|
-
onChangeText={onchangeText}
|
|
32
27
|
keyboardType={keyboardType}
|
|
28
|
+
{...props}
|
|
33
29
|
/>
|
|
34
30
|
</View>
|
|
35
31
|
);
|
|
@@ -7,33 +7,33 @@ export const TextInputPreview = ({} = {}) => {
|
|
|
7
7
|
return (
|
|
8
8
|
<SafeAreaView style={{flex: 1, justifyContent: 'space-around'}}>
|
|
9
9
|
<TextInput
|
|
10
|
-
|
|
10
|
+
onChangeText={(text: string) =>
|
|
11
11
|
console.log('text is changed to: ' + text)
|
|
12
12
|
}
|
|
13
13
|
keyboardType={KeyBoardTypes.DECIMAL_PAD}
|
|
14
14
|
/>
|
|
15
15
|
<TextInput
|
|
16
16
|
placeholder={'placeholder text'}
|
|
17
|
-
|
|
17
|
+
onChangeText={(text: string) =>
|
|
18
18
|
console.log('text is changed to: ' + text)
|
|
19
19
|
}
|
|
20
20
|
keyboardType={KeyBoardTypes.DEFAULT}
|
|
21
21
|
/>
|
|
22
22
|
<TextInput
|
|
23
|
-
|
|
23
|
+
onChangeText={(text: string) =>
|
|
24
24
|
console.log('text is changed to: ' + text)
|
|
25
25
|
}
|
|
26
26
|
keyboardType={KeyBoardTypes.EMAIL_ADDRESS}
|
|
27
27
|
/>
|
|
28
28
|
<TextInput
|
|
29
29
|
keyboardType={KeyBoardTypes.DEFAULT}
|
|
30
|
-
|
|
30
|
+
onChangeText={(text: string) => console.log('text: ' + text)}
|
|
31
31
|
placeholder={'with border'}
|
|
32
32
|
border={true}
|
|
33
33
|
/>
|
|
34
34
|
<TextInput
|
|
35
35
|
keyboardType={KeyBoardTypes.DEFAULT}
|
|
36
|
-
|
|
36
|
+
onChangeText={(text: string) => console.log('text: ' + text)}
|
|
37
37
|
border={true}
|
|
38
38
|
/>
|
|
39
39
|
</SafeAreaView>
|
|
@@ -10,7 +10,7 @@ describe('test input texts', () => {
|
|
|
10
10
|
<TextInput
|
|
11
11
|
keyboardType={KeyBoardTypes.DEFAULT}
|
|
12
12
|
placeholder="dummy placeholder"
|
|
13
|
-
|
|
13
|
+
onChangeText={() => console.log('text changed')}
|
|
14
14
|
/>
|
|
15
15
|
)
|
|
16
16
|
.toJSON();
|
|
@@ -22,7 +22,7 @@ describe('test input texts', () => {
|
|
|
22
22
|
.create(
|
|
23
23
|
<TextInput
|
|
24
24
|
keyboardType={KeyBoardTypes.EMAIL_ADDRESS}
|
|
25
|
-
|
|
25
|
+
onChangeText={() => console.log('text changed')}
|
|
26
26
|
/>
|
|
27
27
|
)
|
|
28
28
|
.toJSON();
|
|
@@ -34,7 +34,7 @@ describe('test input texts', () => {
|
|
|
34
34
|
.create(
|
|
35
35
|
<TextInput
|
|
36
36
|
keyboardType={KeyBoardTypes.EMAIL_ADDRESS}
|
|
37
|
-
|
|
37
|
+
onChangeText={() => console.log('text changed')}
|
|
38
38
|
border={true}
|
|
39
39
|
/>
|
|
40
40
|
)
|
|
@@ -47,7 +47,7 @@ describe('test input texts', () => {
|
|
|
47
47
|
.create(
|
|
48
48
|
<TextInput
|
|
49
49
|
keyboardType={KeyBoardTypes.EMAIL_ADDRESS}
|
|
50
|
-
|
|
50
|
+
onChangeText={() => console.log('text changed')}
|
|
51
51
|
border={true}
|
|
52
52
|
placeholder={'Text input field with a border'}
|
|
53
53
|
/>
|
|
@@ -2,88 +2,96 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`test avatar given the isBlocked is true, and provide image source is empty return a red colored avatar 1`] = `
|
|
4
4
|
<View
|
|
5
|
-
style={
|
|
6
|
-
[
|
|
7
|
-
{
|
|
8
|
-
"alignItems": "center",
|
|
9
|
-
"backgroundColor": "#647ACB",
|
|
10
|
-
"justifyContent": "center",
|
|
11
|
-
"overflow": "hidden",
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"borderRadius": 20,
|
|
15
|
-
"height": 40,
|
|
16
|
-
"width": 40,
|
|
17
|
-
},
|
|
18
|
-
false,
|
|
19
|
-
false,
|
|
20
|
-
]
|
|
21
|
-
}
|
|
5
|
+
style={null}
|
|
22
6
|
>
|
|
23
|
-
<
|
|
7
|
+
<View
|
|
24
8
|
style={
|
|
25
9
|
[
|
|
26
|
-
[
|
|
27
|
-
{
|
|
28
|
-
"fontFamily": "SourceSansProBold",
|
|
29
|
-
"fontSize": 18,
|
|
30
|
-
"lineHeight": 22.6,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
10
|
{
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
11
|
+
"alignItems": "center",
|
|
12
|
+
"backgroundColor": "#647ACB",
|
|
13
|
+
"justifyContent": "center",
|
|
14
|
+
"overflow": "hidden",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"borderRadius": 20,
|
|
18
|
+
"height": 40,
|
|
19
|
+
"width": 40,
|
|
37
20
|
},
|
|
38
|
-
|
|
21
|
+
false,
|
|
22
|
+
false,
|
|
39
23
|
]
|
|
40
24
|
}
|
|
41
25
|
>
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
<Text
|
|
27
|
+
style={
|
|
28
|
+
[
|
|
29
|
+
[
|
|
30
|
+
{
|
|
31
|
+
"fontFamily": "SourceSansProBold",
|
|
32
|
+
"fontSize": 18,
|
|
33
|
+
"lineHeight": 22.6,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
{
|
|
37
|
+
"color": "#FFFFFF",
|
|
38
|
+
"textAlign": "center",
|
|
39
|
+
"width": "100%",
|
|
40
|
+
},
|
|
41
|
+
undefined,
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
JD
|
|
46
|
+
</Text>
|
|
47
|
+
</View>
|
|
44
48
|
</View>
|
|
45
49
|
`;
|
|
46
50
|
|
|
47
51
|
exports[`test avatar renders correctly when provided image source is empty 1`] = `
|
|
48
52
|
<View
|
|
49
|
-
style={
|
|
50
|
-
[
|
|
51
|
-
{
|
|
52
|
-
"alignItems": "center",
|
|
53
|
-
"backgroundColor": "#647ACB",
|
|
54
|
-
"justifyContent": "center",
|
|
55
|
-
"overflow": "hidden",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"borderRadius": 20,
|
|
59
|
-
"height": 40,
|
|
60
|
-
"width": 40,
|
|
61
|
-
},
|
|
62
|
-
false,
|
|
63
|
-
false,
|
|
64
|
-
]
|
|
65
|
-
}
|
|
53
|
+
style={null}
|
|
66
54
|
>
|
|
67
|
-
<
|
|
55
|
+
<View
|
|
68
56
|
style={
|
|
69
57
|
[
|
|
70
|
-
[
|
|
71
|
-
{
|
|
72
|
-
"fontFamily": "SourceSansProBold",
|
|
73
|
-
"fontSize": 18,
|
|
74
|
-
"lineHeight": 22.6,
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
58
|
{
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
59
|
+
"alignItems": "center",
|
|
60
|
+
"backgroundColor": "#647ACB",
|
|
61
|
+
"justifyContent": "center",
|
|
62
|
+
"overflow": "hidden",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"borderRadius": 20,
|
|
66
|
+
"height": 40,
|
|
67
|
+
"width": 40,
|
|
81
68
|
},
|
|
82
|
-
|
|
69
|
+
false,
|
|
70
|
+
false,
|
|
83
71
|
]
|
|
84
72
|
}
|
|
85
73
|
>
|
|
86
|
-
|
|
87
|
-
|
|
74
|
+
<Text
|
|
75
|
+
style={
|
|
76
|
+
[
|
|
77
|
+
[
|
|
78
|
+
{
|
|
79
|
+
"fontFamily": "SourceSansProBold",
|
|
80
|
+
"fontSize": 18,
|
|
81
|
+
"lineHeight": 22.6,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
{
|
|
85
|
+
"color": "#FFFFFF",
|
|
86
|
+
"textAlign": "center",
|
|
87
|
+
"width": "100%",
|
|
88
|
+
},
|
|
89
|
+
undefined,
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
>
|
|
93
|
+
JD
|
|
94
|
+
</Text>
|
|
95
|
+
</View>
|
|
88
96
|
</View>
|
|
89
97
|
`;
|
|
@@ -7,6 +7,7 @@ type AvatarProps = {
|
|
|
7
7
|
isBlocked?: boolean;
|
|
8
8
|
isActive?: boolean;
|
|
9
9
|
isLoading?: boolean;
|
|
10
|
+
hasShadow?: boolean;
|
|
10
11
|
};
|
|
11
|
-
declare const Avatar: ({ source, size, isBlocked, isActive, isLoading, }: AvatarProps) => JSX.Element;
|
|
12
|
+
declare const Avatar: ({ source, size, isBlocked, isActive, isLoading, hasShadow, }: AvatarProps) => JSX.Element;
|
|
12
13
|
export { Avatar as Avatar };
|
|
@@ -21,6 +21,7 @@ type AvatarProps = {
|
|
|
21
21
|
isBlocked?: boolean;
|
|
22
22
|
isActive?: boolean;
|
|
23
23
|
isLoading?: boolean;
|
|
24
|
+
hasShadow?: boolean;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const Avatar = ({
|
|
@@ -29,6 +30,7 @@ const Avatar = ({
|
|
|
29
30
|
isBlocked,
|
|
30
31
|
isActive = true,
|
|
31
32
|
isLoading,
|
|
33
|
+
hasShadow,
|
|
32
34
|
}: AvatarProps) => {
|
|
33
35
|
const Context = useContext(ThemeCtx);
|
|
34
36
|
const styles = Stylesheet(Context, size, isBlocked, isActive);
|
|
@@ -69,21 +71,30 @@ const Avatar = ({
|
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
return source instanceof Initials ? (
|
|
72
|
-
<View style={styles.
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
<View style={hasShadow ? styles.shadow : null}>
|
|
75
|
+
<View style={styles.container}>
|
|
76
|
+
{isLoading ? (
|
|
77
|
+
<ActivityIndicator size={'small'} color={Context.colors.ui.white} />
|
|
78
|
+
) : (
|
|
79
|
+
renderText(size)
|
|
80
|
+
)}
|
|
81
|
+
</View>
|
|
78
82
|
</View>
|
|
79
83
|
) : isLoading ? (
|
|
80
|
-
<View style={styles.
|
|
81
|
-
<
|
|
84
|
+
<View style={hasShadow ? styles.shadow : null}>
|
|
85
|
+
<View style={styles.container}>
|
|
86
|
+
{!isBlocked ? <MainGradient isActive={isActive} /> : null}
|
|
87
|
+
<View style={{zIndex: 100, position: 'absolute'}}>
|
|
88
|
+
<ActivityIndicator size={'small'} color={Context.colors.ui.white} />
|
|
89
|
+
</View>
|
|
90
|
+
</View>
|
|
82
91
|
</View>
|
|
83
92
|
) : (
|
|
84
|
-
<View style={styles.
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
<View style={hasShadow ? styles.shadow : null}>
|
|
94
|
+
<View style={styles.container}>
|
|
95
|
+
{!isBlocked ? <MainGradient isActive={isActive} /> : null}
|
|
96
|
+
<Image source={source} style={styles.image as ImageStyle} />
|
|
97
|
+
</View>
|
|
87
98
|
</View>
|
|
88
99
|
);
|
|
89
100
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import {ScrollView} from 'react-native';
|
|
2
3
|
|
|
3
4
|
const {Avatar} = require('./avatar.component');
|
|
4
5
|
const {Size} = require('../../../types/size.enum');
|
|
@@ -7,49 +8,62 @@ const {View} = require('react-native');
|
|
|
7
8
|
|
|
8
9
|
export const AvatarPreview = ({}: {}) => {
|
|
9
10
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
11
|
+
<ScrollView>
|
|
12
|
+
<View
|
|
13
|
+
style={{
|
|
14
|
+
flex: 1,
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
backgroundColor: 'white',
|
|
17
|
+
gap: 16,
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<Avatar
|
|
21
|
+
size={Size.LARGE}
|
|
22
|
+
source={require('./../../../../assets/components/avatar/baby.png')}
|
|
23
|
+
hasShadow={true}
|
|
24
|
+
isLoading={true}
|
|
25
|
+
/>
|
|
26
|
+
<Avatar
|
|
27
|
+
size={Size.MEDIUM}
|
|
28
|
+
source={require('./../../../../assets/components/avatar/baby.png')}
|
|
29
|
+
hasShadow={true}
|
|
30
|
+
/>
|
|
31
|
+
<Avatar
|
|
32
|
+
size={Size.SMALL}
|
|
33
|
+
source={require('./../../../../assets/components/avatar/baby.png')}
|
|
34
|
+
/>
|
|
35
|
+
<Avatar
|
|
36
|
+
size={Size.LARGE}
|
|
37
|
+
source={Initials.for('John', 'Doe')}
|
|
38
|
+
hasShadow={true}
|
|
39
|
+
/>
|
|
40
|
+
<Avatar
|
|
41
|
+
size={Size.MEDIUM}
|
|
42
|
+
source={Initials.for('John', 'Doe')}
|
|
43
|
+
isBlocked={true}
|
|
44
|
+
hasShadow={true}
|
|
45
|
+
/>
|
|
46
|
+
<Avatar size={Size.SMALL} source={Initials.for('John', 'Doe')} />
|
|
47
|
+
<Avatar
|
|
48
|
+
size={Size.LARGE}
|
|
49
|
+
source={require('./../../../../assets/components/avatar/baby.png')}
|
|
50
|
+
isActive={false}
|
|
51
|
+
hasShadow={true}
|
|
52
|
+
/>
|
|
53
|
+
<Avatar
|
|
54
|
+
size={Size.MEDIUM}
|
|
55
|
+
source={Initials.for('John', 'Doe')}
|
|
56
|
+
isActive={false}
|
|
57
|
+
hasShadow={true}
|
|
58
|
+
/>
|
|
59
|
+
<Avatar
|
|
60
|
+
size={Size.SMALL}
|
|
61
|
+
source={Initials.for('John', 'Doe')}
|
|
62
|
+
isBlocked={true}
|
|
63
|
+
isActive={false}
|
|
64
|
+
hasShadow={true}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
</ScrollView>
|
|
54
68
|
);
|
|
55
69
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function Stylesheet(
|
|
2
|
-
|
|
2
|
+
context: any,
|
|
3
3
|
size: any,
|
|
4
4
|
isBlocked: any,
|
|
5
5
|
isActive: any
|
|
@@ -26,24 +26,63 @@ export function Stylesheet(
|
|
|
26
26
|
alignItems?: undefined;
|
|
27
27
|
}
|
|
28
28
|
)[];
|
|
29
|
+
shadow: (
|
|
30
|
+
| {
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
shadowColor?: undefined;
|
|
33
|
+
shadowOpacity?: undefined;
|
|
34
|
+
shadowRadius?: undefined;
|
|
35
|
+
shadowOffset?: undefined;
|
|
36
|
+
elevation?: undefined;
|
|
37
|
+
width?: undefined;
|
|
38
|
+
height?: undefined;
|
|
39
|
+
borderRadius?: undefined;
|
|
40
|
+
}
|
|
41
|
+
| {
|
|
42
|
+
shadowColor: any;
|
|
43
|
+
shadowOpacity: number;
|
|
44
|
+
shadowRadius: number;
|
|
45
|
+
shadowOffset: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
};
|
|
49
|
+
backgroundColor?: undefined;
|
|
50
|
+
elevation?: undefined;
|
|
51
|
+
width?: undefined;
|
|
52
|
+
height?: undefined;
|
|
53
|
+
borderRadius?: undefined;
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
elevation: number;
|
|
57
|
+
shadowColor: any;
|
|
58
|
+
backgroundColor?: undefined;
|
|
59
|
+
shadowOpacity?: undefined;
|
|
60
|
+
shadowRadius?: undefined;
|
|
61
|
+
shadowOffset?: undefined;
|
|
62
|
+
width?: undefined;
|
|
63
|
+
height?: undefined;
|
|
64
|
+
borderRadius?: undefined;
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
borderRadius: number;
|
|
70
|
+
backgroundColor?: undefined;
|
|
71
|
+
shadowColor?: undefined;
|
|
72
|
+
shadowOpacity?: undefined;
|
|
73
|
+
shadowRadius?: undefined;
|
|
74
|
+
shadowOffset?: undefined;
|
|
75
|
+
elevation?: undefined;
|
|
76
|
+
}
|
|
77
|
+
)[];
|
|
29
78
|
image: {
|
|
30
79
|
position: string;
|
|
31
80
|
width: string;
|
|
32
81
|
height: string;
|
|
33
82
|
borderRadius: number;
|
|
34
83
|
}[];
|
|
35
|
-
text:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
textTransform: string;
|
|
39
|
-
}
|
|
40
|
-
| {
|
|
41
|
-
fontFamily: string;
|
|
42
|
-
fontSize: number;
|
|
43
|
-
lineHeight: number;
|
|
44
|
-
color?: undefined;
|
|
45
|
-
textTransform?: undefined;
|
|
46
|
-
}
|
|
47
|
-
)[];
|
|
84
|
+
text: {
|
|
85
|
+
textTransform: 'uppercase';
|
|
86
|
+
};
|
|
48
87
|
}>;
|
|
49
|
-
import {StyleSheet} from 'react-native';
|
|
88
|
+
import {StyleSheet} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
1
|
+
import {StyleSheet, Platform} from 'react-native';
|
|
2
2
|
import {Size} from '../../../types/size.enum';
|
|
3
3
|
|
|
4
|
-
export const Stylesheet = (
|
|
4
|
+
export const Stylesheet = (context, size, isBlocked, isActive) =>
|
|
5
5
|
StyleSheet.create({
|
|
6
6
|
container: [
|
|
7
7
|
{
|
|
8
8
|
overflow: 'hidden',
|
|
9
9
|
backgroundColor: isBlocked
|
|
10
|
-
?
|
|
10
|
+
? context.colors.ui.error.default
|
|
11
11
|
: isActive
|
|
12
|
-
?
|
|
13
|
-
:
|
|
12
|
+
? context.colors.main['5']
|
|
13
|
+
: context.colors.ui.lightgrey,
|
|
14
14
|
justifyContent: 'center',
|
|
15
15
|
alignItems: 'center',
|
|
16
16
|
},
|
|
@@ -30,6 +30,34 @@ export const Stylesheet = (Context, size, isBlocked, isActive) =>
|
|
|
30
30
|
borderRadius: 120 / 2,
|
|
31
31
|
},
|
|
32
32
|
],
|
|
33
|
+
shadow: [
|
|
34
|
+
{backgroundColor: 'white'},
|
|
35
|
+
Platform.OS === 'ios' && {
|
|
36
|
+
shadowColor: context.colors.ui.black,
|
|
37
|
+
shadowOpacity: 0.25,
|
|
38
|
+
shadowRadius: 4,
|
|
39
|
+
shadowOffset: {width: 0, height: 4},
|
|
40
|
+
},
|
|
41
|
+
Platform.OS === 'android' && {
|
|
42
|
+
elevation: 6,
|
|
43
|
+
shadowColor: context.colors.ui.black,
|
|
44
|
+
},
|
|
45
|
+
size === Size.SMALL && {
|
|
46
|
+
width: 40,
|
|
47
|
+
height: 40,
|
|
48
|
+
borderRadius: 40 / 2,
|
|
49
|
+
},
|
|
50
|
+
size === Size.MEDIUM && {
|
|
51
|
+
width: 72,
|
|
52
|
+
height: 72,
|
|
53
|
+
borderRadius: 72 / 2,
|
|
54
|
+
},
|
|
55
|
+
size === Size.LARGE && {
|
|
56
|
+
width: 120,
|
|
57
|
+
height: 120,
|
|
58
|
+
borderRadius: 120 / 2,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
33
61
|
image: [
|
|
34
62
|
{
|
|
35
63
|
position: 'absolute',
|