Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356734
D5718.id18828.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
D5718.id18828.diff
View Options
diff --git a/native/navigation/expand-buttons.react.js b/native/navigation/expand-buttons.react.js
new file mode 100644
--- /dev/null
+++ b/native/navigation/expand-buttons.react.js
@@ -0,0 +1,66 @@
+// @flow
+
+import * as React from 'react';
+import { View, TouchableOpacity } from 'react-native';
+import Icon from 'react-native-vector-icons/FontAwesome';
+
+import { useStyles } from '../themes/colors';
+
+const ICON_SIZE = 20;
+const PADDING_HORIZONTAL = 7.5;
+
+type Props = {
+ +onPress: () => void,
+};
+
+function ExpandButton(props: Props): React.Node {
+ const styles = useStyles(unboundStyles);
+ return (
+ <TouchableOpacity onPress={props.onPress}>
+ <View>
+ <Icon name="caret-right" size={ICON_SIZE} style={styles.expandButton} />
+ </View>
+ </TouchableOpacity>
+ );
+}
+
+function ExpandButtonDisabled(): React.Node {
+ const styles = useStyles(unboundStyles);
+ return (
+ <Icon
+ name="caret-right"
+ size={ICON_SIZE}
+ style={styles.expandButtonDisabled}
+ />
+ );
+}
+
+function ExpandButtonExpanded(props: Props): React.Node {
+ const styles = useStyles(unboundStyles);
+ return (
+ <TouchableOpacity onPress={props.onPress}>
+ <Icon
+ name="caret-down"
+ size={ICON_SIZE}
+ style={styles.expandButtonExpanded}
+ />
+ </TouchableOpacity>
+ );
+}
+
+const unboundStyles = {
+ expandButton: {
+ color: 'drawerExpandButton',
+ paddingHorizontal: PADDING_HORIZONTAL,
+ },
+ expandButtonDisabled: {
+ color: 'drawerExpandButtonDisabled',
+ paddingHorizontal: PADDING_HORIZONTAL,
+ },
+ expandButtonExpanded: {
+ color: 'drawerExpandButton',
+ paddingHorizontal: PADDING_HORIZONTAL,
+ },
+};
+
+export { ExpandButton, ExpandButtonDisabled, ExpandButtonExpanded };
diff --git a/native/themes/colors.js b/native/themes/colors.js
--- a/native/themes/colors.js
+++ b/native/themes/colors.js
@@ -155,6 +155,8 @@
vibrantGreenButton: '#00C853',
vibrantRedButton: '#F53100',
tooltipBackground: '#1F1F1F',
+ drawerExpandButton: '#808080',
+ drawerExpandButtonDisabled: '#404040',
});
const colors = { light, dark };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 8:22 PM (20 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577228
Default Alt Text
D5718.id18828.diff (2 KB)
Attached To
Mode
D5718: [native] Add expand button for drawer elemennts
Attached
Detach File
Event Timeline
Log In to Comment