Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3509713
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
View Options
diff --git a/native/push/in-app-notif.react.js b/native/push/in-app-notif.react.js
index 4928ff225..bd31f6313 100644
--- a/native/push/in-app-notif.react.js
+++ b/native/push/in-app-notif.react.js
@@ -1,85 +1,93 @@
// @flow
import * as React from 'react';
-import { View, Text, StyleSheet, Platform } from 'react-native';
+import { View, StyleSheet, Platform } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { SingleLine } from '../components/single-line.react.js';
import type { GlobalTheme } from '../types/themes.js';
const edges = ['top'];
type Props = {
+title: ?string,
+message: string,
+activeTheme: ?GlobalTheme,
};
function InAppNotif(props: Props): React.Node {
const useLightStyle = Platform.OS === 'ios' && props.activeTheme !== 'dark';
let title = null;
+ const textStyle = [
+ styles.text,
+ useLightStyle ? styles.lightText : styles.darkText,
+ ];
+
if (props.title) {
title = (
- <>
- <SingleLine style={styles.title}>{props.title}</SingleLine>
- {'\n'}
- </>
+ <SingleLine style={[styles.title, ...textStyle]}>
+ {props.title}
+ </SingleLine>
);
}
- const textStyles = [
- styles.text,
- useLightStyle ? styles.lightText : styles.darkText,
- ];
const notificationContent = (
- <Text style={textStyles}>
+ <View style={styles.notificationContent}>
{title}
- {props.message}
- </Text>
+ <SingleLine style={textStyle}>{props.message}</SingleLine>
+ </View>
);
if (Platform.OS === 'android') {
return (
<SafeAreaView style={styles.notif} edges={edges}>
{notificationContent}
</SafeAreaView>
);
}
return <View style={styles.notif}>{notificationContent}</View>;
}
const styles = StyleSheet.create({
darkText: {
color: 'black',
},
lightText: {
color: 'white',
},
notif: {
alignItems: 'flex-start',
alignSelf: 'flex-start',
justifyContent: 'flex-start',
width: '100%',
},
- text: {
+ notificationContent: {
...Platform.select({
ios: {
- fontSize: 16,
marginTop: 16,
marginBottom: 6,
- color: 'black',
},
default: {
- fontSize: 18,
marginVertical: 16,
},
}),
marginHorizontal: 10,
},
+ text: {
+ ...Platform.select({
+ ios: {
+ fontSize: 16,
+ color: 'black',
+ },
+ default: {
+ fontSize: 18,
+ },
+ }),
+ },
title: {
fontWeight: 'bold',
},
});
export default InAppNotif;
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Dec 23, 7:34 AM (1 d, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690572
Default Alt Text
(2 KB)
Attached To
Mode
rCOMM Comm
Attached
Detach File
Event Timeline
Log In to Comment