Page MenuHomePhabricator

D11597.id38948.diff
No OneTemporary

D11597.id38948.diff

diff --git a/native/components/farcaster-prompt.react.js b/native/components/farcaster-prompt.react.js
--- a/native/components/farcaster-prompt.react.js
+++ b/native/components/farcaster-prompt.react.js
@@ -1,27 +1,25 @@
// @flow
-import invariant from 'invariant';
import * as React from 'react';
import { View, Text } from 'react-native';
-import { FIDContext } from 'lib/components/fid-provider.react.js';
-
import { useStyles } from '../themes/colors.js';
import FarcasterLogo from '../vectors/farcaster-logo.react.js';
-function FarcasterPrompt(): React.Node {
- const fidContext = React.useContext(FIDContext);
- invariant(fidContext, 'fidContext is missing');
+type Props = {
+ +showDisconnectText?: boolean,
+};
- const { fid } = fidContext;
+function FarcasterPrompt(props: Props): React.Node {
+ const { showDisconnectText } = props;
const styles = useStyles(unboundStyles);
- const headerText = fid
+ const headerText = showDisconnectText
? 'Disconnect from Farcaster'
: 'Do you want to connect your Farcaster account';
- const bodyText = fid
+ const bodyText = showDisconnectText
? 'You can disconnect your Farcaster account at any time.'
: 'Connecting your Farcaster account lets you see your mutual follows ' +
'on Comm. We’ll also surface communities based on your Farcaster ' +
diff --git a/native/profile/farcaster-account-settings.react.js b/native/profile/farcaster-account-settings.react.js
--- a/native/profile/farcaster-account-settings.react.js
+++ b/native/profile/farcaster-account-settings.react.js
@@ -74,7 +74,7 @@
() => (
<View style={styles.connectContainer}>
<View style={styles.promptContainer}>
- <FarcasterPrompt />
+ <FarcasterPrompt showDisconnectText={!!fid} />
</View>
<FarcasterWebView onSuccess={onSuccess} webViewState={webViewState} />
<View style={styles.buttonContainer}>{button}</View>
@@ -82,6 +82,7 @@
),
[
button,
+ fid,
onSuccess,
styles.buttonContainer,
styles.connectContainer,

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 9:13 AM (19 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611138
Default Alt Text
D11597.id38948.diff (2 KB)

Event Timeline