@tactics/toddle-styleguide 1.2.8 → 1.3.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.
Files changed (106) hide show
  1. package/App.tsx +11 -0
  2. package/index.d.ts +2 -1
  3. package/index.tsx +2 -0
  4. package/package.json +1 -1
  5. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +18 -18
  6. package/src/components/atoms/line/line.component.d.ts +12 -0
  7. package/src/components/atoms/line/line.component.tsx +23 -0
  8. package/src/components/atoms/line/line.preview.d.ts +1 -0
  9. package/src/components/atoms/line/line.preview.tsx +54 -0
  10. package/src/components/atoms/line/line.styles.d.ts +12 -0
  11. package/src/components/atoms/line/line.styles.js +10 -0
  12. package/src/components/atoms/quick-message/__snapshots__/quick-message.test.js.snap +72 -1
  13. package/src/components/atoms/quick-message/quick-message.component.d.ts +2 -0
  14. package/src/components/atoms/quick-message/quick-message.component.tsx +3 -1
  15. package/src/components/atoms/quick-message/quick-message.preview.tsx +10 -1
  16. package/src/components/atoms/quick-message/quick-message.styles.d.ts +4 -1
  17. package/src/components/atoms/quick-message/quick-message.styles.js +4 -2
  18. package/src/components/atoms/quick-message/quick-message.test.js +38 -6
  19. package/src/components/atoms/text-input/__snapshots__/text-input.test.js.snap +38 -78
  20. package/src/components/atoms/text-input/text-input.component.tsx +6 -9
  21. package/src/components/atoms/text-input/text-input.preview.tsx +3 -3
  22. package/src/components/atoms/text-input/text-input.styles.d.ts +9 -25
  23. package/src/components/atoms/text-input/text-input.styles.js +7 -13
  24. package/src/components/molecules/day/__snapshots__/day.test.js.snap +24 -24
  25. package/src/components/molecules/day/day.component.tsx +17 -4
  26. package/src/components/molecules/day/day.styles.d.ts +33 -42
  27. package/src/components/molecules/day/day.styles.js +14 -17
  28. package/src/components/molecules/failed-to-send/failed-bubble.component.d.ts +2 -2
  29. package/src/components/molecules/failed-to-send/failed-bubble.component.tsx +39 -22
  30. package/src/components/molecules/password-input/__snapshots__/password-input.test.js.snap +53 -68
  31. package/src/components/molecules/password-input/password-input.component.tsx +7 -9
  32. package/src/components/molecules/password-input/password-input.styles.d.ts +8 -7
  33. package/src/components/molecules/password-input/password-input.styles.js +6 -6
  34. package/src/components/molecules/search-input/__snapshots__/search.test.js.snap +30 -31
  35. package/src/components/molecules/search-input/search.component.d.ts +9 -11
  36. package/src/components/molecules/search-input/search.component.tsx +19 -30
  37. package/src/components/molecules/search-input/search.preview.tsx +8 -6
  38. package/src/components/molecules/search-input/search.styles.d.ts +12 -11
  39. package/src/components/molecules/search-input/search.styles.js +14 -8
  40. package/src/components/molecules/search-input/search.test.js +3 -1
  41. package/src/components/molecules/send-bubble/__snapshots__/send-text-bubble.test.js.snap +12 -32
  42. package/src/components/molecules/send-bubble/send-text-bubble.component.d.ts +4 -4
  43. package/src/components/molecules/send-bubble/send-text-bubble.component.tsx +36 -25
  44. package/src/components/molecules/send-bubble/send-text-bubble.styles.d.ts +4 -7
  45. package/src/components/molecules/send-bubble/send-text-bubble.styles.js +2 -8
  46. package/src/components/molecules/timeline/__snapshots__/timeline.test.js.snap +4 -4
  47. package/src/components/molecules/timeline/timeline.styles.d.ts +1 -1
  48. package/src/components/molecules/timeline/timeline.styles.js +2 -2
  49. package/src/components/molecules/timestamp/__snapshots__/timestamp.test.js.snap +2 -1
  50. package/src/components/molecules/timestamp/timestamp.component.d.ts +2 -1
  51. package/src/components/molecules/timestamp/timestamp.component.tsx +4 -7
  52. package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +165 -10
  53. package/src/components/organisms/child-list-item/child-list-item.component.d.ts +2 -0
  54. package/src/components/organisms/child-list-item/child-list-item.component.tsx +24 -1
  55. package/src/components/organisms/child-list-item/child-list-item.preview.tsx +11 -0
  56. package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +0 -3
  57. package/src/components/organisms/child-list-item/child-list-item.styles.js +2 -3
  58. package/src/components/organisms/child-list-item/child-list-item.test.js +9 -4
  59. package/src/components/organisms/child-list-item/components/child-list-tag.component.d.ts +9 -0
  60. package/src/components/organisms/child-list-item/components/child-list-tag.component.tsx +28 -0
  61. package/src/components/organisms/child-list-item/components/child-list-tag.styles.d.ts +13 -0
  62. package/src/components/organisms/child-list-item/components/child-list-tag.styles.js +16 -0
  63. package/src/components/organisms/day-select/day-select.preview.tsx +9 -5
  64. package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.d.ts +9 -0
  65. package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.styles.d.ts +13 -0
  66. package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.styles.js +17 -0
  67. package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.test.js +21 -0
  68. package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.tsx +97 -0
  69. package/src/components/organisms/journal-entry/components/index.d.ts +2 -0
  70. package/src/components/organisms/journal-entry/components/index.ts +2 -0
  71. package/src/components/organisms/journal-entry/components/journal-entry-type/__snapshots__/journal-entry-type.test.js.snap +304 -0
  72. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +16 -0
  73. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +60 -0
  74. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.styles.d.ts +13 -0
  75. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.styles.js +16 -0
  76. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.test.js +48 -0
  77. package/src/components/organisms/journal-entry/journal-entry.component.d.ts +38 -0
  78. package/src/components/organisms/journal-entry/journal-entry.component.tsx +139 -0
  79. package/src/components/organisms/journal-entry/journal-entry.preview.d.ts +1 -0
  80. package/src/components/organisms/journal-entry/journal-entry.preview.tsx +212 -0
  81. package/src/components/organisms/journal-entry/journal-entry.styles.d.ts +42 -0
  82. package/src/components/organisms/journal-entry/journal-entry.styles.js +35 -0
  83. package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +143 -399
  84. package/src/components/organisms/my-child-list-item/my-child-list-item.component.d.ts +5 -7
  85. package/src/components/organisms/my-child-list-item/my-child-list-item.component.tsx +32 -59
  86. package/src/components/organisms/my-child-list-item/my-child-list-item.preview.tsx +36 -24
  87. package/src/components/organisms/my-child-list-item/my-child-list-item.styles.d.ts +15 -11
  88. package/src/components/organisms/my-child-list-item/my-child-list-item.styles.js +16 -11
  89. package/src/components/organisms/my-child-list-item/my-child-list-item.test.js +5 -22
  90. package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +45 -29
  91. package/src/components/organisms/text-bubble/text-bubble.component.d.ts +8 -6
  92. package/src/components/organisms/text-bubble/text-bubble.component.tsx +14 -12
  93. package/src/components/organisms/text-bubble/text-bubble.preview.tsx +14 -19
  94. package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +14 -3
  95. package/src/components/organisms/text-bubble/text-bubble.styles.js +6 -0
  96. package/src/components/organisms/text-bubble/text-bubble.test.js +7 -7
  97. package/src/components/templates/modal/components/fade-panel.component.tsx +1 -1
  98. package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.d.ts +4 -0
  99. package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.tsx +6 -0
  100. package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +14 -1
  101. package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +31 -2
  102. package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +114 -84
  103. package/src/utilities/toddle-datetime/types/{duration-like.type.d.ts → duration.type.d.ts} +2 -0
  104. package/src/utilities/toddle-datetime/types/{duration-like.type.tsx → duration.type.tsx} +3 -0
  105. package/src/utilities/toddle-datetime/types/toddle-datetime.type.d.ts +1 -0
  106. package/src/utilities/toddle-datetime/types/toddle-datetime.type.tsx +8 -1
@@ -1,16 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`test input texts show an input field with a border and placeholder text 1`] = `
4
- <View
4
+ <TextInput
5
+ keyboardType="email-address"
6
+ onChangeText={[Function]}
7
+ placeholder="Text input field with a border"
8
+ placeholderTextColor="#9AA5B1"
5
9
  style={
6
10
  [
7
11
  {
8
- "alignItems": "flex-start",
9
12
  "backgroundColor": "#FFFFFF",
10
13
  "borderRadius": 8,
14
+ "color": "#1F2933",
15
+ "fontFamily": "SourceSansPro",
16
+ "fontSize": 16,
11
17
  "height": 44,
12
18
  "justifyContent": "center",
13
- "overflow": "hidden",
19
+ "lineHeight": 20,
14
20
  "paddingBottom": 8,
15
21
  "paddingLeft": 16,
16
22
  "paddingRight": 16,
@@ -24,36 +30,25 @@ exports[`test input texts show an input field with a border and placeholder text
24
30
  },
25
31
  ]
26
32
  }
27
- >
28
- <TextInput
29
- keyboardType="email-address"
30
- onChangeText={[Function]}
31
- placeholder="Text input field with a border"
32
- placeholderTextColor="#9AA5B1"
33
- style={
34
- {
35
- "color": "#1F2933",
36
- "fontFamily": "SourceSansPro",
37
- "fontSize": 16,
38
- "lineHeight": 20,
39
- "width": "100%",
40
- }
41
- }
42
- />
43
- </View>
33
+ />
44
34
  `;
45
35
 
46
36
  exports[`test input texts show an input field with a border and without placeholder text 1`] = `
47
- <View
37
+ <TextInput
38
+ keyboardType="email-address"
39
+ onChangeText={[Function]}
40
+ placeholderTextColor="#9AA5B1"
48
41
  style={
49
42
  [
50
43
  {
51
- "alignItems": "flex-start",
52
44
  "backgroundColor": "#FFFFFF",
53
45
  "borderRadius": 8,
46
+ "color": "#1F2933",
47
+ "fontFamily": "SourceSansPro",
48
+ "fontSize": 16,
54
49
  "height": 44,
55
50
  "justifyContent": "center",
56
- "overflow": "hidden",
51
+ "lineHeight": 20,
57
52
  "paddingBottom": 8,
58
53
  "paddingLeft": 16,
59
54
  "paddingRight": 16,
@@ -67,35 +62,26 @@ exports[`test input texts show an input field with a border and without placehol
67
62
  },
68
63
  ]
69
64
  }
70
- >
71
- <TextInput
72
- keyboardType="email-address"
73
- onChangeText={[Function]}
74
- placeholderTextColor="#9AA5B1"
75
- style={
76
- {
77
- "color": "#1F2933",
78
- "fontFamily": "SourceSansPro",
79
- "fontSize": 16,
80
- "lineHeight": 20,
81
- "width": "100%",
82
- }
83
- }
84
- />
85
- </View>
65
+ />
86
66
  `;
87
67
 
88
68
  exports[`test input texts shows placeholder when provided 1`] = `
89
- <View
69
+ <TextInput
70
+ keyboardType="default"
71
+ onChangeText={[Function]}
72
+ placeholder="dummy placeholder"
73
+ placeholderTextColor="#9AA5B1"
90
74
  style={
91
75
  [
92
76
  {
93
- "alignItems": "flex-start",
94
77
  "backgroundColor": "#FFFFFF",
95
78
  "borderRadius": 8,
79
+ "color": "#1F2933",
80
+ "fontFamily": "SourceSansPro",
81
+ "fontSize": 16,
96
82
  "height": 44,
97
83
  "justifyContent": "center",
98
- "overflow": "hidden",
84
+ "lineHeight": 20,
99
85
  "paddingBottom": 8,
100
86
  "paddingLeft": 16,
101
87
  "paddingRight": 16,
@@ -105,36 +91,25 @@ exports[`test input texts shows placeholder when provided 1`] = `
105
91
  undefined,
106
92
  ]
107
93
  }
108
- >
109
- <TextInput
110
- keyboardType="default"
111
- onChangeText={[Function]}
112
- placeholder="dummy placeholder"
113
- placeholderTextColor="#9AA5B1"
114
- style={
115
- {
116
- "color": "#1F2933",
117
- "fontFamily": "SourceSansPro",
118
- "fontSize": 16,
119
- "lineHeight": 20,
120
- "width": "100%",
121
- }
122
- }
123
- />
124
- </View>
94
+ />
125
95
  `;
126
96
 
127
97
  exports[`test input texts text input field without placeholder text 1`] = `
128
- <View
98
+ <TextInput
99
+ keyboardType="email-address"
100
+ onChangeText={[Function]}
101
+ placeholderTextColor="#9AA5B1"
129
102
  style={
130
103
  [
131
104
  {
132
- "alignItems": "flex-start",
133
105
  "backgroundColor": "#FFFFFF",
134
106
  "borderRadius": 8,
107
+ "color": "#1F2933",
108
+ "fontFamily": "SourceSansPro",
109
+ "fontSize": 16,
135
110
  "height": 44,
136
111
  "justifyContent": "center",
137
- "overflow": "hidden",
112
+ "lineHeight": 20,
138
113
  "paddingBottom": 8,
139
114
  "paddingLeft": 16,
140
115
  "paddingRight": 16,
@@ -144,20 +119,5 @@ exports[`test input texts text input field without placeholder text 1`] = `
144
119
  undefined,
145
120
  ]
146
121
  }
147
- >
148
- <TextInput
149
- keyboardType="email-address"
150
- onChangeText={[Function]}
151
- placeholderTextColor="#9AA5B1"
152
- style={
153
- {
154
- "color": "#1F2933",
155
- "fontFamily": "SourceSansPro",
156
- "fontSize": 16,
157
- "lineHeight": 20,
158
- "width": "100%",
159
- }
160
- }
161
- />
162
- </View>
122
+ />
163
123
  `;
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import {useContext} from 'react';
3
3
 
4
4
  import {
5
- View,
6
5
  TextInput as NativeTextInput,
7
6
  TextInputProps as NativeTextInputProps,
8
7
  } from 'react-native';
@@ -20,14 +19,12 @@ const TextInput = ({keyboardType, border, ...props}: TextInputProps) => {
20
19
  const styles = Stylesheet(context, border);
21
20
 
22
21
  return (
23
- <View style={styles.container}>
24
- <NativeTextInput
25
- placeholderTextColor={context.colors.ui.grey}
26
- style={styles.input}
27
- keyboardType={keyboardType}
28
- {...props}
29
- />
30
- </View>
22
+ <NativeTextInput
23
+ placeholderTextColor={context.colors.ui.grey}
24
+ style={styles.input}
25
+ keyboardType={keyboardType}
26
+ {...props}
27
+ />
31
28
  );
32
29
  };
33
30
  export {TextInput as TextInput};
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import {TextInput} from './text-input.component';
3
3
  import {KeyBoardTypes} from '../../../types/keyboard-types.enum';
4
- import {SafeAreaView} from 'react-native';
4
+ import {View} from 'react-native';
5
5
 
6
6
  export const TextInputPreview = ({} = {}) => {
7
7
  return (
8
- <SafeAreaView style={{flex: 1, justifyContent: 'space-around'}}>
8
+ <View style={{flex: 1, justifyContent: 'space-around', padding: 32}}>
9
9
  <TextInput
10
10
  onChangeText={(text: string) =>
11
11
  console.log('text is changed to: ' + text)
@@ -36,6 +36,6 @@ export const TextInputPreview = ({} = {}) => {
36
36
  onChangeText={(text: string) => console.log('text: ' + text)}
37
37
  border={true}
38
38
  />
39
- </SafeAreaView>
39
+ </View>
40
40
  );
41
41
  };
@@ -4,19 +4,21 @@ export function Stylesheet(
4
4
  ):
5
5
  | StyleSheet.NamedStyles<any>
6
6
  | StyleSheet.NamedStyles<{
7
- container: (
7
+ input: (
8
8
  | {
9
- width: string;
10
- height: number;
11
- borderRadius: number;
12
- overflow: string;
9
+ lineHeight: number;
10
+ color: any;
13
11
  paddingLeft: number;
14
12
  paddingTop: number;
15
13
  paddingRight: number;
16
14
  paddingBottom: number;
17
15
  backgroundColor: any;
16
+ borderRadius: number;
17
+ fontFamily: string;
18
+ fontSize: number;
19
+ height: number;
20
+ width: string;
18
21
  justifyContent: string;
19
- alignItems: string;
20
22
  borderStyle?: undefined;
21
23
  borderWidth?: undefined;
22
24
  borderColor?: undefined;
@@ -25,25 +27,7 @@ export function Stylesheet(
25
27
  borderStyle: string;
26
28
  borderWidth: number;
27
29
  borderColor: any;
28
- width?: undefined;
29
- height?: undefined;
30
- borderRadius?: undefined;
31
- overflow?: undefined;
32
- paddingLeft?: undefined;
33
- paddingTop?: undefined;
34
- paddingRight?: undefined;
35
- paddingBottom?: undefined;
36
- backgroundColor?: undefined;
37
- justifyContent?: undefined;
38
- alignItems?: undefined;
39
30
  }
40
31
  )[];
41
- input: {
42
- lineHeight: number;
43
- color: any;
44
- fontFamily: string;
45
- fontSize: number;
46
- width: string;
47
- };
48
32
  }>;
49
- import {StyleSheet} from 'react-native';
33
+ import {StyleSheet} from 'react-native/Libraries/StyleSheet/StyleSheet';
@@ -1,24 +1,24 @@
1
1
  import React from 'react';
2
-
3
2
  import {StyleSheet} from 'react-native';
4
3
  import {Scale} from '../../../theme/scale';
5
4
  import {Font} from '../../../theme/font';
6
5
 
7
6
  export const Stylesheet = (context, border) =>
8
7
  StyleSheet.create({
9
- container: [
8
+ input: [
10
9
  {
10
+ height: Scale.m * 2.75,
11
11
  width: '100%',
12
- height: 44,
13
- borderRadius: Scale.xs,
14
- overflow: 'hidden',
12
+ justifyContent: 'center',
13
+ ...Font.medium,
14
+ lineHeight: 20,
15
+ color: context.colors.ui.black,
15
16
  paddingLeft: Scale.m,
16
17
  paddingTop: Scale.xs,
17
18
  paddingRight: Scale.m,
18
19
  paddingBottom: Scale.xs,
19
20
  backgroundColor: context.colors.ui.white,
20
- justifyContent: 'center',
21
- alignItems: 'flex-start',
21
+ borderRadius: Scale.xs,
22
22
  },
23
23
  border && {
24
24
  borderStyle: 'solid',
@@ -26,10 +26,4 @@ export const Stylesheet = (context, border) =>
26
26
  borderColor: context.colors.ui.lightgrey,
27
27
  },
28
28
  ],
29
- input: {
30
- width: '100%',
31
- ...Font.medium,
32
- lineHeight: 20,
33
- color: context.colors.ui.black,
34
- },
35
29
  });
@@ -5,7 +5,6 @@ exports[`Test for the day component renders a day component that is also selecte
5
5
  style={
6
6
  {
7
7
  "alignItems": "center",
8
- "backgroundColor": "#F5F7FA",
9
8
  "justifyContent": "center",
10
9
  }
11
10
  }
@@ -71,17 +70,19 @@ exports[`Test for the day component renders a day component that is also selecte
71
70
  onResponderTerminationRequest={[Function]}
72
71
  onStartShouldSetResponder={[Function]}
73
72
  style={
74
- {
75
- "alignItems": "center",
76
- "backgroundColor": "#647ACB",
77
- "borderColor": "#F5F7FA",
78
- "borderRadius": 24,
79
- "borderWidth": 1,
80
- "height": 48,
81
- "justifyContent": "center",
82
- "padding": 12,
83
- "width": 48,
84
- }
73
+ [
74
+ {
75
+ "alignItems": "center",
76
+ "borderRadius": 24,
77
+ "height": 48,
78
+ "justifyContent": "center",
79
+ "padding": 12,
80
+ "width": 48,
81
+ },
82
+ {
83
+ "backgroundColor": "#647ACB",
84
+ },
85
+ ]
85
86
  }
86
87
  >
87
88
  <Text
@@ -136,7 +137,6 @@ exports[`Test for the day component renders a day component that is not selected
136
137
  style={
137
138
  {
138
139
  "alignItems": "center",
139
- "backgroundColor": "#F5F7FA",
140
140
  "justifyContent": "center",
141
141
  }
142
142
  }
@@ -202,17 +202,17 @@ exports[`Test for the day component renders a day component that is not selected
202
202
  onResponderTerminationRequest={[Function]}
203
203
  onStartShouldSetResponder={[Function]}
204
204
  style={
205
- {
206
- "alignItems": "center",
207
- "backgroundColor": "#F5F7FA",
208
- "borderColor": "#F5F7FA",
209
- "borderRadius": 24,
210
- "borderWidth": 1,
211
- "height": 48,
212
- "justifyContent": "center",
213
- "padding": 12,
214
- "width": 48,
215
- }
205
+ [
206
+ {
207
+ "alignItems": "center",
208
+ "borderRadius": 24,
209
+ "height": 48,
210
+ "justifyContent": "center",
211
+ "padding": 12,
212
+ "width": 48,
213
+ },
214
+ false,
215
+ ]
216
216
  }
217
217
  >
218
218
  <Text
@@ -20,12 +20,17 @@ const Day = ({onSelect, date, isSelected}: DayProps) => {
20
20
  ToddleDateTime.now().toFormat('yyyy-MM-dd')
21
21
  );
22
22
  };
23
- const styles = Stylesheet(context, isSelected, isToday());
23
+ const styles = Stylesheet(context, isSelected);
24
24
 
25
25
  return (
26
26
  <View style={styles.container}>
27
27
  <View style={styles.dayNameContainer}>
28
- <Heading4 textColor={context.colors.ui.grey}>
28
+ <Heading4
29
+ textColor={
30
+ isToday() ? context.colors.main[5] : context.colors.ui.grey
31
+ }
32
+ bold={isToday()}
33
+ >
29
34
  {date.weekdayShort.toUpperCase().slice(0, 2)}
30
35
  </Heading4>
31
36
  </View>
@@ -33,7 +38,11 @@ const Day = ({onSelect, date, isSelected}: DayProps) => {
33
38
  <Pressable style={styles.dayCircle} onPress={() => onSelect(date)}>
34
39
  <Heading4
35
40
  textColor={
36
- isSelected ? context.colors.main[9] : context.colors.ui.grey
41
+ isSelected
42
+ ? context.colors.main[9]
43
+ : !isSelected && isToday()
44
+ ? context.colors.main[5]
45
+ : context.colors.ui.grey
37
46
  }
38
47
  textAlign={'center'}
39
48
  >
@@ -42,7 +51,11 @@ const Day = ({onSelect, date, isSelected}: DayProps) => {
42
51
 
43
52
  <TinyText
44
53
  textColor={
45
- isSelected ? context.colors.main[9] : context.colors.ui.grey
54
+ isSelected
55
+ ? context.colors.main[9]
56
+ : !isSelected && isToday()
57
+ ? context.colors.main[5]
58
+ : context.colors.ui.grey
46
59
  }
47
60
  textAlign={'center'}
48
61
  >
@@ -1,44 +1,35 @@
1
1
  export function Stylesheet(
2
2
  context: any,
3
- isSelected: any,
4
- isToday: any
5
- ): {
6
- container: {
7
- alignItems: 'center';
8
- justifyContent: 'center';
9
- backgroundColor: any;
10
- };
11
- dayCircle: {
12
- width: number;
13
- height: number;
14
- borderRadius: number;
15
- padding: number;
16
- alignItems: 'center';
17
- justifyContent: 'center';
18
- backgroundColor: any;
19
- borderColor: any;
20
- borderWidth: number;
21
- };
22
- dayNumber: {
23
- fontFamily: string;
24
- fontSize: number;
25
- lineHeight: number;
26
- };
27
- monthNumber: {
28
- fontFamily: string;
29
- fontSize: number;
30
- lineHeight: number;
31
- };
32
- selectedDate: {
33
- color: any;
34
- };
35
- dayNameContainer: {
36
- marginBottom: number;
37
- };
38
- dayName: {
39
- color: any;
40
- fontFamily: string;
41
- fontSize: number;
42
- lineHeight: number;
43
- };
44
- };
3
+ isSelected: any
4
+ ):
5
+ | StyleSheet.NamedStyles<any>
6
+ | StyleSheet.NamedStyles<{
7
+ container: {
8
+ alignItems: 'center';
9
+ justifyContent: 'center';
10
+ };
11
+ dayCircle: (
12
+ | {
13
+ width: number;
14
+ height: number;
15
+ borderRadius: number;
16
+ padding: number;
17
+ alignItems: string;
18
+ justifyContent: string;
19
+ backgroundColor?: undefined;
20
+ }
21
+ | {
22
+ backgroundColor: any;
23
+ width?: undefined;
24
+ height?: undefined;
25
+ borderRadius?: undefined;
26
+ padding?: undefined;
27
+ alignItems?: undefined;
28
+ justifyContent?: undefined;
29
+ }
30
+ )[];
31
+ dayNameContainer: {
32
+ marginBottom: number;
33
+ };
34
+ }>;
35
+ import {StyleSheet} from 'react-native/Libraries/StyleSheet/StyleSheet';
@@ -2,28 +2,25 @@ import React from 'react';
2
2
  import {StyleSheet} from 'react-native';
3
3
  import {Scale} from '../../../theme/scale';
4
4
 
5
- export const Stylesheet = (context, isSelected, isToday) =>
5
+ export const Stylesheet = (context, isSelected) =>
6
6
  StyleSheet.create({
7
7
  container: {
8
8
  alignItems: 'center',
9
9
  justifyContent: 'center',
10
- backgroundColor: context.colors.ui.xlightgrey,
11
- },
12
- dayCircle: {
13
- width: Scale.xxl,
14
- height: Scale.xxl,
15
- borderRadius: Scale.xxl / 2,
16
- padding: Scale.s,
17
- alignItems: 'center',
18
- justifyContent: 'center',
19
- backgroundColor: isSelected
20
- ? context.colors.main[5]
21
- : context.colors.ui.xlightgrey,
22
- borderColor: isToday
23
- ? context.colors.ui.grey
24
- : context.colors.ui.xlightgrey,
25
- borderWidth: 1,
26
10
  },
11
+ dayCircle: [
12
+ {
13
+ width: Scale.xxl,
14
+ height: Scale.xxl,
15
+ borderRadius: Scale.xxl / 2,
16
+ padding: Scale.s,
17
+ alignItems: 'center',
18
+ justifyContent: 'center',
19
+ },
20
+ isSelected && {
21
+ backgroundColor: context.colors.main[5],
22
+ },
23
+ ],
27
24
  dayNameContainer: {
28
25
  marginBottom: Scale.s,
29
26
  },
@@ -1,8 +1,8 @@
1
1
  type FailedBubbleProps = {
2
2
  id: string;
3
3
  text: string;
4
- onPressRefresh: (id: string) => void;
5
- onPressDelete: (id: string) => void;
4
+ onPressRefresh?: (id: string) => void;
5
+ onPressDelete?: (id: string) => void;
6
6
  };
7
7
  declare const FailedTextBubble: ({
8
8
  id,
@@ -12,8 +12,8 @@ import {SmallText} from '../../atoms/paragraph-components';
12
12
  type FailedBubbleProps = {
13
13
  id: string;
14
14
  text: string;
15
- onPressRefresh: (id: string) => void;
16
- onPressDelete: (id: string) => void;
15
+ onPressRefresh?: (id: string) => void;
16
+ onPressDelete?: (id: string) => void;
17
17
  };
18
18
 
19
19
  const FailedTextBubble = ({
@@ -37,24 +37,32 @@ const FailedTextBubble = ({
37
37
 
38
38
  return (
39
39
  <View style={styles.swipedRow}>
40
- <Animated.View style={[styles.swipedIcon, {opacity}]}>
41
- <Pressable onPress={() => onPressRefresh(id)} testID="refresh-button">
42
- <Icon
43
- style={'regular'}
44
- name={'refresh'}
45
- color={context.colors.ui.error.xlight}
46
- />
47
- </Pressable>
48
- </Animated.View>
49
- <Animated.View style={[styles.swipedIcon, {opacity}]}>
50
- <Pressable onPress={() => onPressDelete(id)} testID="delete-button">
51
- <Icon
52
- style={'regular'}
53
- name={'trash'}
54
- color={context.colors.ui.error.xlight}
55
- />
56
- </Pressable>
57
- </Animated.View>
40
+ {onPressRefresh && (
41
+ <Animated.View style={[styles.swipedIcon, {opacity}]}>
42
+ <Pressable
43
+ onPress={() => onPressRefresh(id)}
44
+ testID="refresh-button"
45
+ >
46
+ <Icon
47
+ style={'regular'}
48
+ name={'refresh'}
49
+ color={context.colors.ui.error.xlight}
50
+ />
51
+ </Pressable>
52
+ </Animated.View>
53
+ )}
54
+
55
+ {onPressDelete && (
56
+ <Animated.View style={[styles.swipedIcon, {opacity}]}>
57
+ <Pressable onPress={() => onPressDelete(id)} testID="delete-button">
58
+ <Icon
59
+ style={'regular'}
60
+ name={'trash'}
61
+ color={context.colors.ui.error.xlight}
62
+ />
63
+ </Pressable>
64
+ </Animated.View>
65
+ )}
58
66
  </View>
59
67
  );
60
68
  };
@@ -71,11 +79,20 @@ const FailedTextBubble = ({
71
79
  </View>
72
80
 
73
81
  <View style={styles.textBubbleContainer}>
74
- <Swipeable renderRightActions={RenderRefreshDeleteAction}>
82
+ {onPressRefresh && onPressDelete ? (
83
+ <Swipeable renderRightActions={RenderRefreshDeleteAction}>
84
+ <SmallText
85
+ textColor={context.colors.ui.white}
86
+ addStyle={styles.text}
87
+ >
88
+ {text}
89
+ </SmallText>
90
+ </Swipeable>
91
+ ) : (
75
92
  <SmallText textColor={context.colors.ui.white} addStyle={styles.text}>
76
93
  {text}
77
94
  </SmallText>
78
- </Swipeable>
95
+ )}
79
96
  </View>
80
97
  </GestureHandlerRootView>
81
98
  );