import React from 'react' import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {interests, useInterestsDisplayNames} from '#/lib/interests' import {capitalize} from '#/lib/strings/capitalize' import {logger} from '#/logger' import { OnboardingControls, OnboardingDescriptionText, OnboardingPosition, OnboardingTitleText, } from '#/screens/Onboarding/Layout' import {useOnboardingInternalState} from '#/screens/Onboarding/state' import {InterestButton} from '#/screens/Onboarding/StepInterests/InterestButton' import {atoms as a} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Toggle from '#/components/forms/Toggle' import {Loader} from '#/components/Loader' import {useAnalytics} from '#/analytics' export function StepInterests() { const {_} = useLingui() const ax = useAnalytics() const interestsDisplayNames = useInterestsDisplayNames() const {state, dispatch} = useOnboardingInternalState() const [saving, setSaving] = React.useState(false) const [selectedInterests, setSelectedInterests] = React.useState( state.interestsStepResults.selectedInterests.map(i => i), ) const saveInterests = React.useCallback(async () => { setSaving(true) try { setSaving(false) dispatch({ type: 'setInterestsStepResults', selectedInterests, }) dispatch({type: 'next'}) ax.metric('onboarding:interests:nextPressed', { selectedInterests, selectedInterestsLength: selectedInterests.length, }) } catch (e: any) { logger.info(`onboading: error saving interests`) logger.error(e) } }, [ax, selectedInterests, setSaving, dispatch]) return ( What are your interests? We'll use this to help customize your experience. {interests.map(interest => ( ))} ) }