Skip to content

Commit

Permalink
[native] introduce temp onPressDisconnectKeyserver callback
Browse files Browse the repository at this point in the history
Summary:
As of Nov 2023, disconnecting from a keyserver is outside the scope of the keyserver selection screen. However, we currently have the UI for this already implemented so as a temporary solution this diff has the `onPressDisconnectKeyserver` callback display an alert to the user, informing them that this feature is not quite ready yet

Depends on D9826

Test Plan:
Please see demo video below

{F869303}

Reviewers: inka, michal, rohan, ashoat

Reviewed By: rohan

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9828
  • Loading branch information
ginsueddy committed Nov 15, 2023
1 parent 371f6f8 commit b759ac7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion native/profile/keyserver-selection-bottom-sheet.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import StatusIndicator from '../components/status-indicator.react.js';
import type { RootNavigationProp } from '../navigation/root-navigator.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
import { useColors, useStyles } from '../themes/colors.js';
import Alert from '../utils/alert.js';

export type KeyserverSelectionBottomSheetParams = {
+keyserverAdminUserInfo: GlobalAccountUserInfo,
Expand Down Expand Up @@ -81,6 +82,16 @@ function KeyserverSelectionBottomSheet(props: Props): React.Node {
[colors.panelForegroundLabel],
);

const onPressDisconnectKeyserver = React.useCallback(() => {
// TODO: update this function when we have a way to
// disconnect from a keyserver
Alert.alert(
'Disconnecting from a keyserver is still not ready.',
'Please come back later.',
[{ text: 'OK' }],
);
}, []);

const onPressRemoveKeyserver = React.useCallback(() => {
// TODO
}, []);
Expand Down Expand Up @@ -121,14 +132,15 @@ function KeyserverSelectionBottomSheet(props: Props): React.Node {
</Text>
<Button
style={styles.removeButtonContainer}
onPress={onPressRemoveKeyserver}
onPress={onPressDisconnectKeyserver}
>
<Text style={styles.removeButtonText}>Disconnect keyserver</Text>
</Button>
</>
);
}, [
keyserverInfo.connection.status,
onPressDisconnectKeyserver,
onPressRemoveKeyserver,
styles.keyserverRemoveText,
styles.removeButtonContainer,
Expand Down

0 comments on commit b759ac7

Please sign in to comment.