-
Notifications
You must be signed in to change notification settings - Fork 0
/
empty
67 lines (64 loc) · 2.03 KB
/
empty
1
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { Box, useTheme } from "./Theme";
import { Dimensions, Image, Platform, StyleSheet } from "react-native";
import React, { ReactNode } from "react";
import Constants from "expo-constants";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { useSafeAreaInsets } from "react-native-safe-area-context";
const { width, height: wHeight } = Dimensions.get("window");
const aspectRatio = 750 / 1125;
const height = width * aspectRatio;
interface containerProps {
children: ReactNode;
footer: ReactNode;
}
export const assets = [require("./assets/patterns/pattern1.png")];
const Container = ({ children, footer }: containerProps) => {
const insets = useSafeAreaInsets();
const theme = useTheme();
const statusBarHeight: number = Platform.OS ==='android' ? Constants.statusBarHeight : 0;
return (
<KeyboardAwareScrollView scrollEnabled={false}>
<Box height={wHeight + statusBarHeight} backgroundColor="secondary">
<Box backgroundColor="white">
<Box
borderBottomLeftRadius={theme.borderRedius.xl}
overflow="hidden"
height={height * 0.61}
>
<Image
source={assets[0]}
style={{
width,
height,
borderBottomLeftRadius: theme.borderRedius.xl,
}}
/>
</Box>
</Box>
<Box flex={1} overflow="hidden">
<Image
source={assets[0]}
style={{
...StyleSheet.absoluteFillObject,
width,
top: -height * 0.61,
}}
/>
<Box
flex={1}
borderRadius={theme.borderRedius.xl}
borderTopLeftRadius={0}
backgroundColor="white"
>
{children}
</Box>
</Box>
<Box backgroundColor="secondary">
{footer}
<Box height={insets.bottom} />
</Box>
</Box>
</KeyboardAwareScrollView>
);
};
export default Container;