diff options
author | polwex <polwex@sortug.com> | 2025-07-16 07:55:57 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-07-16 07:55:57 +0700 |
commit | e2e14e414de25904d791b503d2852c68b3ac9415 (patch) | |
tree | 051b3b0dbaa6252d9a1687d29b401d079dbafb6b /components/ScreenWrapper.tsx | |
parent | a528bd94a6e8e25010ae26a305550b211df0ddc6 (diff) |
Diffstat (limited to 'components/ScreenWrapper.tsx')
-rw-r--r-- | components/ScreenWrapper.tsx | 31 |
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; |