Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3743754
D8158.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8158.id.diff
View Options
diff --git a/native/chat/chat.react.js b/native/chat/chat.react.js
--- a/native/chat/chat.react.js
+++ b/native/chat/chat.react.js
@@ -71,6 +71,7 @@
MessageSearchRouteName,
ChangeRolesScreenRouteName,
} from '../navigation/route-names.js';
+import ChangeRolesHeaderLeftButton from '../roles/change-roles-header-left-button.react.js';
import ChangeRolesScreen from '../roles/change-roles-screen.react.js';
import MessageSearch from '../search/message-search.react.js';
import SearchHeader from '../search/search-header.react.js';
@@ -296,6 +297,10 @@
headerBackTitleVisible: false,
};
const changeRolesScreenOptions = {
+ // eslint-disable-next-line react/display-name
+ headerLeft: headerLeftProps => (
+ <ChangeRolesHeaderLeftButton {...headerLeftProps} />
+ ),
headerTitle: 'Change Role',
presentation: 'modal',
};
diff --git a/native/roles/change-roles-header-left-button.react.js b/native/roles/change-roles-header-left-button.react.js
new file mode 100644
--- /dev/null
+++ b/native/roles/change-roles-header-left-button.react.js
@@ -0,0 +1,28 @@
+// @flow
+
+import { HeaderBackButton as BaseHeaderBackButton } from '@react-navigation/elements';
+import * as React from 'react';
+import { Text } from 'react-native';
+import { TouchableOpacity } from 'react-native-gesture-handler';
+
+import { useColors } from '../themes/colors.js';
+
+type Props = React.ElementConfig<typeof BaseHeaderBackButton>;
+function ChangeRolesHeaderLeftButton(props: Props): React.Node {
+ const { panelForegroundSecondaryLabel } = useColors();
+ const labelStyle = React.useMemo(
+ () => ({
+ color: panelForegroundSecondaryLabel,
+ marginLeft: 10,
+ }),
+ [panelForegroundSecondaryLabel],
+ );
+
+ return (
+ <TouchableOpacity onPress={props.onPress}>
+ <Text style={labelStyle}>Cancel</Text>
+ </TouchableOpacity>
+ );
+}
+
+export default ChangeRolesHeaderLeftButton;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 1:56 PM (11 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2850238
Default Alt Text
D8158.id.diff (1 KB)
Attached To
Mode
D8158: [native] Create a ChangeRolesHeaderLeftButton to cancel role changes
Attached
Detach File
Event Timeline
Log In to Comment