Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3247240
D9756.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
D9756.diff
View Options
diff --git a/native/profile/keyserver-selection-list-item.react.js b/native/profile/keyserver-selection-list-item.react.js
--- a/native/profile/keyserver-selection-list-item.react.js
+++ b/native/profile/keyserver-selection-list-item.react.js
@@ -1,13 +1,15 @@
// @flow
+import { useNavigation } from '@react-navigation/native';
import * as React from 'react';
-import { View } from 'react-native';
+import { TouchableOpacity } from 'react-native';
import type { KeyserverInfo } from 'lib/types/keyserver-types.js';
import CommIcon from '../components/comm-icon.react.js';
import Pill from '../components/pill.react.js';
import StatusIndicator from '../components/status-indicator.react.js';
+import { KeyserverSelectionBottomSheetRouteName } from '../navigation/route-names.js';
import { useStyles, useColors } from '../themes/colors.js';
type Props = {
@@ -21,6 +23,18 @@
const styles = useStyles(unboundStyles);
const colors = useColors();
+ const { navigate } = useNavigation();
+
+ const onPress = React.useCallback(() => {
+ navigate<'KeyserverSelectionBottomSheet'>({
+ name: KeyserverSelectionBottomSheetRouteName,
+ params: {
+ keyserverAdminUsername,
+ keyserverInfo,
+ },
+ });
+ }, [keyserverAdminUsername, keyserverInfo, navigate]);
+
const cloudIcon = React.useMemo(
() => (
<CommIcon
@@ -34,20 +48,24 @@
const keyserverListItem = React.useMemo(
() => (
- <View style={styles.keyserverListItemContainer}>
+ <TouchableOpacity
+ style={styles.keyserverListItemContainer}
+ onPress={onPress}
+ >
<Pill
label={keyserverAdminUsername}
backgroundColor={colors.codeBackground}
icon={cloudIcon}
/>
<StatusIndicator connectionInfo={keyserverInfo.connection} />
- </View>
+ </TouchableOpacity>
),
[
cloudIcon,
colors.codeBackground,
keyserverAdminUsername,
keyserverInfo.connection,
+ onPress,
styles.keyserverListItemContainer,
],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 4:08 AM (19 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2496361
Default Alt Text
D9756.diff (2 KB)
Attached To
Mode
D9756: [native] add onPress function to keyserver selection list item
Attached
Detach File
Event Timeline
Log In to Comment