diff --git a/native/account/registration/keyserver-selection.react.js b/native/account/registration/keyserver-selection.react.js --- a/native/account/registration/keyserver-selection.react.js +++ b/native/account/registration/keyserver-selection.react.js @@ -1,9 +1,9 @@ // @flow -import { useHeaderHeight } from '@react-navigation/elements'; import * as React from 'react'; -import { View, Text } from 'react-native'; +import { Text } from 'react-native'; +import RegistrationContainer from './registration-container.react.js'; import type { RegistrationNavigationProp } from './registration-navigator.react.js'; import type { NavigationRoute } from '../../navigation/route-names.js'; import { useStyles } from '../../themes/colors.js'; @@ -15,27 +15,14 @@ // eslint-disable-next-line no-unused-vars function KeyserverSelection(props: Props): React.Node { const styles = useStyles(unboundStyles); - - const headerHeight = useHeaderHeight(); - const backgroundStyle = React.useMemo( - () => ({ - ...styles.background, - marginTop: headerHeight, - }), - [headerHeight, styles.background], - ); - return ( - + Test Hello Test - + ); } const unboundStyles = { - background: { - backgroundColor: 'panelBackground', - }, testText: { fontSize: 24, color: 'white', diff --git a/native/account/registration/registration-container.react.js b/native/account/registration/registration-container.react.js new file mode 100644 --- /dev/null +++ b/native/account/registration/registration-container.react.js @@ -0,0 +1,33 @@ +// @flow + +import { useHeaderHeight } from '@react-navigation/elements'; +import * as React from 'react'; +import { View } from 'react-native'; + +import { useStyles } from '../../themes/colors.js'; + +type Props = { + +children: React.Node, +}; +function RegistrationContainer(props: Props): React.Node { + const styles = useStyles(unboundStyles); + + const headerHeight = useHeaderHeight(); + const backgroundStyle = React.useMemo( + () => ({ + ...styles.background, + marginTop: headerHeight, + }), + [headerHeight, styles.background], + ); + + return {props.children}; +} + +const unboundStyles = { + background: { + backgroundColor: 'panelBackground', + }, +}; + +export default RegistrationContainer;