Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

composer work squashme. avatar is aligned, ui done

+63 -15
+47 -7
src/view/com/composer/Composer.tsx
··· 186 186 import {type TextInputRef} from './text-input/TextInput.types' 187 187 import {getVideoMetadata} from './videos/pickVideo' 188 188 import {clearThumbnailCache} from './videos/VideoTranscodeBackdrop' 189 + import * as Menu from '#/components/Menu' 190 + import {SwitchMenuItems} from "#/view/shell/desktop/LeftNav" 191 + import {useProfilesQuery} from '#/state/queries/profile' 189 192 190 193 type CancelRef = { 191 194 onPressCancel: () => void ··· 1419 1422 onError: (error: string) => void 1420 1423 onPublish: (richtext: RichText) => void 1421 1424 }) { 1422 - const {currentAccount} = useSession() 1425 + const {currentAccount, accounts} = useSession() 1423 1426 const currentDid = currentAccount!.did 1424 1427 const {t: l} = useLingui() 1425 1428 const {data: currentProfile} = useProfileQuery({did: currentDid}) ··· 1432 1435 : l`Add another post` 1433 1436 : l`Anything but skeet` 1434 1437 const discardPromptControl = Prompt.usePromptControl() 1438 + const signOutPromptControl = Prompt.usePromptControl() 1435 1439 1436 1440 const enableSquareButtons = useEnableSquareButtons() 1437 1441 ··· 1490 1494 [post.id, onSelectVideo, onImageAdd, l], 1491 1495 ) 1492 1496 1497 + 1498 + const {isLoading, data} = useProfilesQuery({ 1499 + handles: accounts.map(acc => acc.did), 1500 + }) 1501 + const profiles = data?.profiles 1502 + 1503 + const otherAccounts = accounts 1504 + .filter(acc => acc.did !== currentAccount!.did) 1505 + .map(account => ({ 1506 + account, 1507 + profile: profiles?.find(p => p.did === account.did), 1508 + })) 1509 + 1493 1510 useHideKeyboardOnBackground() 1494 1511 1495 1512 return ( ··· 1502 1519 isTextOnly && isLastPost && IS_NATIVE && a.flex_grow, 1503 1520 ]}> 1504 1521 <View style={[a.flex_row, IS_NATIVE && a.flex_1]}> 1505 - <UserAvatar 1506 - avatar={currentProfile?.avatar} 1507 - size={42} 1508 - type={currentProfile?.associated?.labeler ? 'labeler' : 'user'} 1509 - style={[a.mt_xs]} 1510 - /> 1522 + <Menu.Root> 1523 + <Menu.Trigger label={_(msg`Switch accounts`)}> 1524 + {({props}) => ( 1525 + <Button 1526 + label={props.accessibilityLabel} 1527 + {...props} 1528 + style={[ 1529 + a.transition_color, 1530 + enableSquareButtons ? a.rounded_sm : a.rounded_full, 1531 + a.self_start 1532 + ]}> 1533 + <UserAvatar 1534 + avatar={currentProfile?.avatar} 1535 + size={42} 1536 + type={currentProfile?.associated?.labeler ? 'labeler' : 'user'} 1537 + style={[a.mt_xs]} 1538 + /> 1539 + </Button> 1540 + )} 1541 + </Menu.Trigger> 1542 + { 1543 + <SwitchMenuItems 1544 + accounts={otherAccounts} 1545 + signOutPromptControl={signOutPromptControl} 1546 + showExtraButtons={false} 1547 + />} 1548 + </Menu.Root> 1511 1549 <TextInput 1512 1550 ref={textInputRef} 1513 1551 style={[a.pt_xs]} ··· 2836 2874 </ToolbarWrapper> 2837 2875 ) 2838 2876 } 2877 + 2878 +
+16 -8
src/view/shell/desktop/LeftNav.tsx
··· 222 222 ) 223 223 } 224 224 225 - function SwitchMenuItems({ 225 + export function SwitchMenuItems({ 226 226 accounts, 227 227 signOutPromptControl, 228 + showExtraButtons 228 229 }: { 229 230 accounts: 230 231 | { ··· 233 234 }[] 234 235 | undefined 235 236 signOutPromptControl: DialogControlProps 237 + showExtraButtons?: boolean 236 238 }) { 237 239 const {_} = useLingui() 238 240 const {setShowLoggedOut} = useLoggedOutViewControls() 239 241 const closeEverything = useCloseAllActiveElements() 242 + 243 + showExtraButtons = showExtraButtons ?? true; 240 244 241 245 const onAddAnotherAccount = () => { 242 246 setShowLoggedOut(true) ··· 262 266 <Menu.Divider /> 263 267 </> 264 268 )} 265 - <SwitcherMenuProfileLink /> 269 + {showExtraButtons ? <SwitcherMenuProfileLink /> : undefined } 266 270 <Menu.Item 267 271 label={_(msg`Add another account`)} 268 272 onPress={onAddAnotherAccount}> ··· 271 275 <Trans>Add another account</Trans> 272 276 </Menu.ItemText> 273 277 </Menu.Item> 274 - <Menu.Item label={_(msg`Sign out`)} onPress={signOutPromptControl.open}> 275 - <Menu.ItemIcon icon={LeaveIcon} /> 276 - <Menu.ItemText> 277 - <Trans>Sign out</Trans> 278 - </Menu.ItemText> 279 - </Menu.Item> 278 + { 279 + showExtraButtons ? 280 + <Menu.Item label={_(msg`Sign out`)} onPress={signOutPromptControl.open}> 281 + <Menu.ItemIcon icon={LeaveIcon} /> 282 + <Menu.ItemText> 283 + <Trans>Sign out</Trans> 284 + </Menu.ItemText> 285 + </Menu.Item> 286 + : undefined 287 + } 280 288 </Menu.Outer> 281 289 ) 282 290 }