Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hide translate/copy text options when `!no-unauthenticated` (#3573)

* hide translate/copy text options when no-pwi

* only do this for no-unauth

* always show if logged in

* swap order of OR

authored by

Samuel Newman and committed by
GitHub
6980cc7f f771a596

+21 -17
+21 -17
src/view/com/util/forms/PostDropdownBtn.tsx
··· 172 172 hidePost({uri: postUri}) 173 173 }, [postUri, hidePost]) 174 174 175 - const shouldShowLoggedOutWarning = React.useMemo(() => { 175 + const hideInPWI = React.useMemo(() => { 176 176 return !!postAuthor.labels?.find( 177 177 label => label.val === '!no-unauthenticated', 178 178 ) ··· 183 183 shareUrl(url) 184 184 }, [href]) 185 185 186 - const canEmbed = isWeb && gtMobile && !shouldShowLoggedOutWarning 186 + const canEmbed = isWeb && gtMobile && !hideInPWI 187 187 188 188 return ( 189 189 <EventStopper onKeyDown={false}> ··· 215 215 216 216 <Menu.Outer> 217 217 <Menu.Group> 218 - <Menu.Item 219 - testID="postDropdownTranslateBtn" 220 - label={_(msg`Translate`)} 221 - onPress={onOpenTranslate}> 222 - <Menu.ItemText>{_(msg`Translate`)}</Menu.ItemText> 223 - <Menu.ItemIcon icon={Translate} position="right" /> 224 - </Menu.Item> 218 + {(!hideInPWI || hasSession) && ( 219 + <> 220 + <Menu.Item 221 + testID="postDropdownTranslateBtn" 222 + label={_(msg`Translate`)} 223 + onPress={onOpenTranslate}> 224 + <Menu.ItemText>{_(msg`Translate`)}</Menu.ItemText> 225 + <Menu.ItemIcon icon={Translate} position="right" /> 226 + </Menu.Item> 225 227 226 - <Menu.Item 227 - testID="postDropdownCopyTextBtn" 228 - label={_(msg`Copy post text`)} 229 - onPress={onCopyPostText}> 230 - <Menu.ItemText>{_(msg`Copy post text`)}</Menu.ItemText> 231 - <Menu.ItemIcon icon={ClipboardIcon} position="right" /> 232 - </Menu.Item> 228 + <Menu.Item 229 + testID="postDropdownCopyTextBtn" 230 + label={_(msg`Copy post text`)} 231 + onPress={onCopyPostText}> 232 + <Menu.ItemText>{_(msg`Copy post text`)}</Menu.ItemText> 233 + <Menu.ItemIcon icon={ClipboardIcon} position="right" /> 234 + </Menu.Item> 235 + </> 236 + )} 233 237 234 238 <Menu.Item 235 239 testID="postDropdownShareBtn" 236 240 label={isWeb ? _(msg`Copy link to post`) : _(msg`Share`)} 237 241 onPress={() => { 238 - if (shouldShowLoggedOutWarning) { 242 + if (hideInPWI) { 239 243 loggedOutWarningPromptControl.open() 240 244 } else { 241 245 onSharePost()