Page MenuHomePhabricator

D12041.id41130.diff
No OneTemporary

D12041.id41130.diff

diff --git a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
--- a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
+++ b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
@@ -3,10 +3,13 @@
import * as React from 'react';
import { View, Text } from 'react-native';
+import type { CommunityInfo } from 'lib/types/community-types.js';
+
import TagChannelButton from './tag-channel-button.react.js';
import type { TagFarcasterChannelNavigationProp } from './tag-farcaster-channel-navigator.react.js';
import { tagFarcasterChannelErrorMessages } from './tag-farcaster-channel-utils.js';
import { type NavigationRoute } from '../../navigation/route-names.js';
+import { useSelector } from '../../redux/redux-utils.js';
import { useStyles } from '../../themes/colors.js';
export type TagFarcasterChannelParams = {
@@ -23,6 +26,10 @@
const { communityID } = route.params;
+ const communityInfo: ?CommunityInfo = useSelector(
+ state => state.communityStore.communityInfos[communityID],
+ );
+
const styles = useStyles(unboundStyles);
const [error, setError] = React.useState<?string>(null);
@@ -39,6 +46,24 @@
);
}, [error, styles.error]);
+ const channelNameTextContent = React.useMemo(() => {
+ if (!communityInfo?.farcasterChannelID) {
+ return (
+ <Text style={styles.noChannelText}>No Farcaster channel tagged</Text>
+ );
+ }
+
+ return (
+ <Text style={styles.channelNameText}>
+ {`/${communityInfo.farcasterChannelID}`}
+ </Text>
+ );
+ }, [
+ communityInfo?.farcasterChannelID,
+ styles.channelNameText,
+ styles.noChannelText,
+ ]);
+
const tagFarcasterChannel = React.useMemo(
() => (
<View>
@@ -49,6 +74,10 @@
</View>
<Text style={styles.sectionHeaderText}>FARCASTER CHANNEL</Text>
<View style={styles.panelSectionContainer}>
+ <Text style={styles.sectionText}>Selected channel:</Text>
+ <View style={styles.channelNameContainer}>
+ {channelNameTextContent}
+ </View>
<TagChannelButton communityID={communityID} setError={setError} />
</View>
<View style={styles.errorContainer}>{errorMessage}</View>
@@ -58,7 +87,9 @@
styles.panelSectionContainer,
styles.sectionText,
styles.sectionHeaderText,
+ styles.channelNameContainer,
styles.errorContainer,
+ channelNameTextContent,
communityID,
errorMessage,
],
@@ -89,6 +120,20 @@
paddingBottom: 4,
marginTop: 24,
},
+ channelNameContainer: {
+ marginTop: 8,
+ marginBottom: 24,
+ height: 20,
+ },
+ channelNameText: {
+ fontSize: 16,
+ fontWeight: '600',
+ color: 'panelForegroundLabel',
+ },
+ noChannelText: {
+ fontSize: 16,
+ color: 'panelForegroundLabel',
+ },
errorContainer: {
height: 18,
},

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:32 PM (18 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682016
Default Alt Text
D12041.id41130.diff (2 KB)

Event Timeline