Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3516290
D7501.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7501.diff
View Options
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 (
- <View style={backgroundStyle}>
+ <RegistrationContainer>
<Text style={styles.testText}>Test Hello Test</Text>
- </View>
+ </RegistrationContainer>
);
}
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 <View style={backgroundStyle}>{props.children}</View>;
+}
+
+const unboundStyles = {
+ background: {
+ backgroundColor: 'panelBackground',
+ },
+};
+
+export default RegistrationContainer;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 1:26 PM (19 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694787
Default Alt Text
D7501.diff (2 KB)
Attached To
Mode
D7501: [native] Introduce RegistrationContainer
Attached
Detach File
Event Timeline
Log In to Comment