summaryrefslogtreecommitdiff
path: root/components/ScreenWrapper.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'components/ScreenWrapper.tsx')
-rw-r--r--components/ScreenWrapper.tsx31
1 files changed, 31 insertions, 0 deletions
diff --git a/components/ScreenWrapper.tsx b/components/ScreenWrapper.tsx
new file mode 100644
index 0000000..49c698f
--- /dev/null
+++ b/components/ScreenWrapper.tsx
@@ -0,0 +1,31 @@
+import React from "react";
+import { View, StyleSheet, Platform } from "react-native";
+
+type Props = {
+ children: React.ReactNode;
+ style?: object;
+};
+
+const ScreenWrapper = ({ children, style }: Props) => {
+ return (
+ <View style={styles.outer}>
+ <View style={[styles.inner, style]}>{children}</View>
+ </View>
+ );
+};
+
+const styles = StyleSheet.create({
+ outer: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "flex-start",
+ },
+ inner: {
+ width: "100%",
+
+ maxWidth: Platform.OS === "web" ? 420 : "100%",
+ flexGrow: 1,
+ },
+});
+
+export default ScreenWrapper;