this repo has no description
0
fork

Configure Feed

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

Add back starter packs button in ProfileMenu (#10069)

authored by

Eric Bailey and committed by
GitHub
bfd2d201 dc8570c5

+20 -13
+11 -2
src/components/dialogs/StarterPackDialog.tsx
··· 19 19 useListMembershipRemoveMutation, 20 20 } from '#/state/queries/list-memberships' 21 21 import {useProfileQuery} from '#/state/queries/profile' 22 + import {useSession} from '#/state/session' 22 23 import {atoms as a, native, platform, useTheme} from '#/alf' 23 24 import {AvatarStack} from '#/components/AvatarStack' 24 25 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 260 261 const t = useTheme() 261 262 const ax = useAnalytics() 262 263 const {_} = useLingui() 264 + const {currentAccount} = useSession() 265 + const isSelf = subject?.did === currentAccount?.did 263 266 264 267 const starterPack = starterPackWithMembership.starterPack 265 268 const isInPack = !!starterPackWithMembership.listItem ··· 373 376 label={isInPack ? _(msg`Remove`) : _(msg`Add`)} 374 377 color={isInPack ? 'secondary' : 'primary_subtle'} 375 378 size="tiny" 376 - disabled={isPending} 379 + disabled={isPending || isSelf} 377 380 onPress={handleToggleMembership}> 378 381 {isPending && <ButtonIcon icon={Loader} />} 379 382 <ButtonText> 380 - {isInPack ? <Trans>Remove</Trans> : <Trans>Add</Trans>} 383 + {isSelf ? ( 384 + <Trans>Owner</Trans> 385 + ) : isInPack ? ( 386 + <Trans>Remove</Trans> 387 + ) : ( 388 + <Trans>Add</Trans> 389 + )} 381 390 </ButtonText> 382 391 </Button> 383 392 </View>
+9 -11
src/view/com/profile/ProfileMenu.tsx
··· 341 341 )} 342 342 </> 343 343 )} 344 - {!isSelf && ( 345 - <Menu.Item 346 - testID="profileHeaderDropdownStarterPackAddRemoveBtn" 347 - label={_(msg`Add to starter packs`)} 348 - onPress={onPressAddToStarterPacks}> 349 - <Menu.ItemText> 350 - <Trans>Add to starter packs</Trans> 351 - </Menu.ItemText> 352 - <Menu.ItemIcon icon={StarterPack} /> 353 - </Menu.Item> 354 - )} 344 + <Menu.Item 345 + testID="profileHeaderDropdownStarterPackAddRemoveBtn" 346 + label={_(msg`Add to starter packs`)} 347 + onPress={onPressAddToStarterPacks}> 348 + <Menu.ItemText> 349 + <Trans>Add to starter packs</Trans> 350 + </Menu.ItemText> 351 + <Menu.ItemIcon icon={StarterPack} /> 352 + </Menu.Item> 355 353 <Menu.Item 356 354 testID="profileHeaderDropdownListAddRemoveBtn" 357 355 label={_(msg`Add to lists`)}