From 3bf87eb1f274ea2a4bd382f365fe1ee81dd6bf6a Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 12 Jun 2024 15:57:10 -0700 Subject: [PATCH] replace button with checkbox --- .../StarterPack/Wizard/WizardFeedCard.tsx | 47 +++++++++-------- .../StarterPack/Wizard/WizardProfileCard.tsx | 51 ++++++++++++------- 2 files changed, 60 insertions(+), 38 deletions(-) diff --git a/src/components/StarterPack/Wizard/WizardFeedCard.tsx b/src/components/StarterPack/Wizard/WizardFeedCard.tsx index caf7c77046..f2de278ced 100644 --- a/src/components/StarterPack/Wizard/WizardFeedCard.tsx +++ b/src/components/StarterPack/Wizard/WizardFeedCard.tsx @@ -1,13 +1,15 @@ import React from 'react' -import {Keyboard, View} from 'react-native' +import {Keyboard, Pressable, View} from 'react-native' import {GeneratorView} from '@atproto/api/dist/client/types/app/bsky/feed/defs' -import {msg, Trans} from '@lingui/macro' +import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {isWeb} from 'platform/detection' import {UserAvatar} from 'view/com/util/UserAvatar' import {WizardAction, WizardState} from '#/screens/StarterPack/Wizard/State' import {atoms as a, useTheme} from '#/alf' -import {Button, ButtonText} from '#/components/Button' +import * as Toggle from '#/components/forms/Toggle' +import {Checkbox} from '#/components/forms/Toggle' import {Text} from '#/components/Typography' export function WizardFeedCard({ @@ -23,7 +25,7 @@ export function WizardFeedCard({ const t = useTheme() const includesFeed = state.feeds.some(f => f.uri === generator.uri) - const onAdd = () => { + const onPressAddRemove = () => { Keyboard.dismiss() if (includesFeed) { dispatch({type: 'RemoveFeed', feedUri: generator.uri}) @@ -33,16 +35,22 @@ export function WizardFeedCard({ } return ( - + // @ts-expect-error web only + isWeb && { + cursor: 'default', + }, + ]} + onPress={onPressAddRemove}> @@ -54,18 +62,17 @@ export function WizardFeedCard({ {_(msg`Feed by @${generator.creator.handle}`)} - - + + + + ) } diff --git a/src/components/StarterPack/Wizard/WizardProfileCard.tsx b/src/components/StarterPack/Wizard/WizardProfileCard.tsx index cd07c91236..a8a99675a8 100644 --- a/src/components/StarterPack/Wizard/WizardProfileCard.tsx +++ b/src/components/StarterPack/Wizard/WizardProfileCard.tsx @@ -1,14 +1,16 @@ import React from 'react' -import {Keyboard, View} from 'react-native' +import {Keyboard, Pressable, View} from 'react-native' import {AppBskyActorDefs} from '@atproto/api' -import {msg, Trans} from '@lingui/macro' +import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {isWeb} from 'platform/detection' import {useSession} from 'state/session' import {UserAvatar} from 'view/com/util/UserAvatar' import {WizardAction, WizardState} from '#/screens/StarterPack/Wizard/State' import {atoms as a, useTheme} from '#/alf' -import {Button, ButtonText} from '#/components/Button' +import * as Toggle from '#/components/forms/Toggle' +import {Checkbox} from '#/components/forms/Toggle' import {Text} from '#/components/Typography' export function WizardProfileCard({ @@ -36,7 +38,8 @@ export function WizardProfileCard({ } return ( - + // @ts-expect-error web only + isWeb && { + cursor: 'default', + }, + ]} + onPress={onPressAddRemove}> @@ -58,19 +66,26 @@ export function WizardProfileCard({ {profile.did !== currentAccount?.did && ( - + + + )} - + ) }