From e17c33a4cde4dba513ebff4b0a99535446557534 Mon Sep 17 00:00:00 2001 From: danidfra Date: Wed, 7 Aug 2024 15:30:01 -0300 Subject: [PATCH] Update steps to show up the "x" button --- src/features/onboarding/steps/avatar-selection-step.tsx | 7 +++++++ src/features/onboarding/steps/bio-step.tsx | 7 +++++++ .../onboarding/steps/cover-photo-selection-step.tsx | 7 +++++++ src/features/onboarding/steps/display-name-step.tsx | 7 +++++++ .../onboarding/steps/suggested-accounts-step.tsx | 9 +++++++++ 5 files changed, 37 insertions(+) diff --git a/src/features/onboarding/steps/avatar-selection-step.tsx b/src/features/onboarding/steps/avatar-selection-step.tsx index 2c2af64bb..a3e3c9c1b 100644 --- a/src/features/onboarding/steps/avatar-selection-step.tsx +++ b/src/features/onboarding/steps/avatar-selection-step.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { defineMessages, FormattedMessage } from 'react-intl'; import { patchMe } from 'soapbox/actions/me'; +import { endOnboarding } from 'soapbox/actions/onboarding'; import { BigCard } from 'soapbox/components/big-card'; import { Avatar, Button, Icon, Spinner, Stack } from 'soapbox/components/ui'; import { useAppDispatch, useOwnAccount } from 'soapbox/hooks'; @@ -64,10 +65,16 @@ const AvatarSelectionStep = ({ onNext }: { onNext: () => void }) => { }).catch(console.error); }; + const handleComplete = () => { + dispatch(endOnboarding()); + }; + return ( } + buttonEvent={handleComplete} subtitle={} + onClose >
diff --git a/src/features/onboarding/steps/bio-step.tsx b/src/features/onboarding/steps/bio-step.tsx index 6b2862bbb..cf236e402 100644 --- a/src/features/onboarding/steps/bio-step.tsx +++ b/src/features/onboarding/steps/bio-step.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { patchMe } from 'soapbox/actions/me'; +import { endOnboarding } from 'soapbox/actions/onboarding'; import { BigCard } from 'soapbox/components/big-card'; import { Button, FormGroup, Stack, Textarea } from 'soapbox/components/ui'; import { useAppDispatch, useOwnAccount } from 'soapbox/hooks'; @@ -43,10 +44,16 @@ const BioStep = ({ onNext }: { onNext: () => void }) => { }); }; + const handleComplete = () => { + dispatch(endOnboarding()); + }; + return ( } subtitle={} + buttonEvent={handleComplete} + onClose >
diff --git a/src/features/onboarding/steps/cover-photo-selection-step.tsx b/src/features/onboarding/steps/cover-photo-selection-step.tsx index b09b89f6a..9e93fccc2 100644 --- a/src/features/onboarding/steps/cover-photo-selection-step.tsx +++ b/src/features/onboarding/steps/cover-photo-selection-step.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { patchMe } from 'soapbox/actions/me'; +import { endOnboarding } from 'soapbox/actions/onboarding'; import { BigCard } from 'soapbox/components/big-card'; import StillImage from 'soapbox/components/still-image'; import { Avatar, Button, Icon, Spinner, Stack, Text } from 'soapbox/components/ui'; @@ -67,10 +68,16 @@ const CoverPhotoSelectionStep = ({ onNext }: { onNext: () => void }) => { }).catch(console.error); }; + const handleComplete = () => { + dispatch(endOnboarding()); + }; + return ( } subtitle={} + buttonEvent={handleComplete} + onClose >
diff --git a/src/features/onboarding/steps/display-name-step.tsx b/src/features/onboarding/steps/display-name-step.tsx index 161963942..cb4cda543 100644 --- a/src/features/onboarding/steps/display-name-step.tsx +++ b/src/features/onboarding/steps/display-name-step.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { patchMe } from 'soapbox/actions/me'; +import { endOnboarding } from 'soapbox/actions/onboarding'; import { BigCard } from 'soapbox/components/big-card'; import { Button, FormGroup, Input, Stack } from 'soapbox/components/ui'; import { useAppDispatch, useOwnAccount } from 'soapbox/hooks'; @@ -54,10 +55,16 @@ const DisplayNameStep = ({ onNext }: { onNext: () => void }) => { }); }; + const handleComplete = () => { + dispatch(endOnboarding()); + }; + return ( } subtitle={} + buttonEvent={handleComplete} + onClose > void }) => { + const dispatch = useAppDispatch(); const { data, fetchNextPage, hasNextPage, isFetching } = useOnboardingSuggestions(); const handleLoadMore = debounce(() => { @@ -19,6 +22,10 @@ const SuggestedAccountsStep = ({ onNext }: { onNext: () => void }) => { return fetchNextPage(); }, 300); + const handleComplete = () => { + dispatch(endOnboarding()); + }; + const renderSuggestions = () => { if (!data) { return null; @@ -70,6 +77,8 @@ const SuggestedAccountsStep = ({ onNext }: { onNext: () => void }) => { } subtitle={} + buttonEvent={handleComplete} + onClose > {renderBody()}