From ba68e845b7d22c4edc021a828c8f04e767a7bdf4 Mon Sep 17 00:00:00 2001 From: Miss Pasture Date: Thu, 22 Sep 2022 21:49:10 -0400 Subject: [PATCH] onboarding: add information about the Fediverse to the onboarding process if the server federates --- .../features/onboarding/onboarding-wizard.tsx | 10 ++- .../onboarding/steps/fediverse-step.tsx | 88 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 app/soapbox/features/onboarding/steps/fediverse-step.tsx diff --git a/app/soapbox/features/onboarding/onboarding-wizard.tsx b/app/soapbox/features/onboarding/onboarding-wizard.tsx index 7b82e8862..ae3c3c74c 100644 --- a/app/soapbox/features/onboarding/onboarding-wizard.tsx +++ b/app/soapbox/features/onboarding/onboarding-wizard.tsx @@ -6,16 +6,19 @@ import ReactSwipeableViews from 'react-swipeable-views'; import { endOnboarding } from 'soapbox/actions/onboarding'; import LandingGradient from 'soapbox/components/landing-gradient'; import { HStack } from 'soapbox/components/ui'; +import { useFeatures } from 'soapbox/hooks'; import AvatarSelectionStep from './steps/avatar-selection-step'; import BioStep from './steps/bio-step'; import CompletedStep from './steps/completed-step'; import CoverPhotoSelectionStep from './steps/cover-photo-selection-step'; import DisplayNameStep from './steps/display-name-step'; +import FediverseStep from './steps/fediverse-step'; import SuggestedAccountsStep from './steps/suggested-accounts-step'; const OnboardingWizard = () => { const dispatch = useDispatch(); + const features = useFeatures(); const [currentStep, setCurrentStep] = React.useState(0); @@ -41,9 +44,14 @@ const OnboardingWizard = () => { , , , - , ]; + if (features.federating){ + steps.push(); + } + + steps.push(); + const handleKeyUp = ({ key }: KeyboardEvent): void => { switch (key) { case 'ArrowLeft': diff --git a/app/soapbox/features/onboarding/steps/fediverse-step.tsx b/app/soapbox/features/onboarding/steps/fediverse-step.tsx new file mode 100644 index 000000000..6dbb26620 --- /dev/null +++ b/app/soapbox/features/onboarding/steps/fediverse-step.tsx @@ -0,0 +1,88 @@ +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; + +import Account from 'soapbox/components/account'; +import { Button, Card, CardBody, Icon, Stack, Text } from 'soapbox/components/ui'; +import { useAppSelector, useOwnAccount } from 'soapbox/hooks'; + +import type { Account as AccountEntity } from 'soapbox/types/entities'; + +const FediverseStep = ({ onNext }: { onNext: () => void }) => { + const siteTitle = useAppSelector((state) => state.instance.title); + const account = useOwnAccount() as AccountEntity; + + return ( + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + +
+
+ +
+ + + +
+
+
+ ); +}; + +export default FediverseStep;