@tactics/toddle-styleguide 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.tsx +6 -0
- package/package.json +1 -1
- package/src/components/atoms/footer/footer.component.tsx +11 -7
- package/src/components/atoms/footer/footer.styles.js +5 -6
- package/src/components/organisms/day-select/day-select.component.tsx +2 -0
- package/src/components/atoms/footer/footer.styles.d.ts +0 -14
package/App.tsx
CHANGED
|
@@ -74,6 +74,10 @@ import {TabViewPreview} from './src/components/organisms/tab-view/tab-view.previ
|
|
|
74
74
|
import {LinePreview} from './src/components/atoms/line/line.preview';
|
|
75
75
|
import {JournalEntryPreview} from './src/components/organisms/journal-entry/journal-entry.preview';
|
|
76
76
|
|
|
77
|
+
import {
|
|
78
|
+
SafeAreaProvider,
|
|
79
|
+
} from 'react-native-safe-area-context';
|
|
80
|
+
|
|
77
81
|
const Stack = createNativeStackNavigator();
|
|
78
82
|
|
|
79
83
|
const HomeScreen = ({navigation}: {navigation: any}) => {
|
|
@@ -299,6 +303,7 @@ function App() {
|
|
|
299
303
|
}
|
|
300
304
|
|
|
301
305
|
return (
|
|
306
|
+
<SafeAreaProvider>
|
|
302
307
|
<ThemeCtx.Provider value={StaffMemberTheme}>
|
|
303
308
|
<NavigationContainer>
|
|
304
309
|
<Stack.Navigator>
|
|
@@ -474,6 +479,7 @@ function App() {
|
|
|
474
479
|
</Stack.Navigator>
|
|
475
480
|
</NavigationContainer>
|
|
476
481
|
</ThemeCtx.Provider>
|
|
482
|
+
</SafeAreaProvider>
|
|
477
483
|
);
|
|
478
484
|
}
|
|
479
485
|
|
package/package.json
CHANGED
|
@@ -5,6 +5,9 @@ import {ViewStyle} from 'react-native';
|
|
|
5
5
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
6
6
|
import {Stylesheet} from './footer.styles';
|
|
7
7
|
import Animated, {AnimateStyle} from 'react-native-reanimated';
|
|
8
|
+
import {
|
|
9
|
+
useSafeAreaInsets,
|
|
10
|
+
} from 'react-native-safe-area-context';
|
|
8
11
|
|
|
9
12
|
type FooterProps = {
|
|
10
13
|
children: React.ReactNode;
|
|
@@ -13,15 +16,16 @@ type FooterProps = {
|
|
|
13
16
|
|
|
14
17
|
const Footer = ({children, animatedStyle}: FooterProps) => {
|
|
15
18
|
const context = useContext(ThemeCtx);
|
|
16
|
-
const
|
|
19
|
+
const insets = useSafeAreaInsets();
|
|
20
|
+
const styles = Stylesheet(context, insets);
|
|
17
21
|
|
|
18
22
|
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
<Animated.View
|
|
24
|
+
style={[styles.container, animatedStyle]}
|
|
25
|
+
testID="footer-container"
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</Animated.View>
|
|
25
29
|
);
|
|
26
30
|
};
|
|
27
31
|
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {Platform, StyleSheet} from 'react-native';
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
3
2
|
import {Scale} from '../../../theme/scale/index';
|
|
4
3
|
|
|
5
|
-
export const Stylesheet = (context) =>
|
|
4
|
+
export const Stylesheet = (context, insets) =>
|
|
6
5
|
StyleSheet.create({
|
|
7
6
|
container: {
|
|
8
7
|
flexDirection: 'row',
|
|
9
|
-
alignItems:
|
|
8
|
+
alignItems: 'center',
|
|
10
9
|
justifyContent: 'center',
|
|
11
|
-
paddingTop: Platform.OS === 'android' ? 0 : Scale.m,
|
|
12
10
|
backgroundColor: context.colors.ui.xlightgrey,
|
|
13
11
|
borderTopColor: context.colors.ui.lightgrey,
|
|
14
12
|
borderStyle: 'solid',
|
|
15
13
|
borderTopWidth: 1,
|
|
16
|
-
|
|
14
|
+
minHeight: (Scale.xxxl + insets.bottom),
|
|
15
|
+
paddingBottom: insets.bottom,
|
|
17
16
|
width: '100%',
|
|
18
17
|
},
|
|
19
18
|
});
|
|
@@ -41,12 +41,14 @@ const DaySelect = ({onSelectDate, selectedDate, startDate}: DaySelectProps) => {
|
|
|
41
41
|
const onSwipeLeft = () => {
|
|
42
42
|
let firstDayOfWeek = weekData.shift();
|
|
43
43
|
if (!firstDayOfWeek) return;
|
|
44
|
+
onSelectDate(selectedDate.minus({weeks: 1}));
|
|
44
45
|
setWeekData(createWeekDays(firstDayOfWeek.minus({weeks: 1})));
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
const onSwipeRight = () => {
|
|
48
49
|
let firstDayOfWeek = weekData.shift();
|
|
49
50
|
if (!firstDayOfWeek) return;
|
|
51
|
+
onSelectDate(selectedDate.plus({weeks: 1}));
|
|
50
52
|
setWeekData(createWeekDays(firstDayOfWeek.plus({weeks: 1})));
|
|
51
53
|
};
|
|
52
54
|
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function Stylesheet(context: any): {
|
|
2
|
-
container: {
|
|
3
|
-
flexDirection: "row";
|
|
4
|
-
alignItems: "center" | "flex-start";
|
|
5
|
-
justifyContent: "center";
|
|
6
|
-
paddingTop: number;
|
|
7
|
-
backgroundColor: any;
|
|
8
|
-
borderTopColor: any;
|
|
9
|
-
borderStyle: "solid";
|
|
10
|
-
borderTopWidth: number;
|
|
11
|
-
height: number;
|
|
12
|
-
width: "100%";
|
|
13
|
-
};
|
|
14
|
-
};
|