cleanup
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {
|
||||||
ColorValue,
|
|
||||||
FlatList,
|
FlatList,
|
||||||
FlatListProps,
|
FlatListProps,
|
||||||
ListRenderItemInfo,
|
ListRenderItemInfo,
|
||||||
@@ -13,12 +12,10 @@ import {msg, Trans} from '@lingui/macro'
|
|||||||
|
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Button, ButtonText, ButtonIcon} from '#/components/Button'
|
import {Button, ButtonText, ButtonIcon} from '#/components/Button'
|
||||||
import {News2_Stroke2_Corner0_Rounded as News} from '#/components/icons/News2'
|
|
||||||
import {StreamingLive_Stroke2_Corner0_Rounded as StreamingLive} from '#/components/icons/StreamingLive'
|
import {StreamingLive_Stroke2_Corner0_Rounded as StreamingLive} from '#/components/icons/StreamingLive'
|
||||||
import {Camera_Stroke2_Corner0_Rounded as Camera} from '#/components/icons/Camera'
|
import {Camera_Stroke2_Corner0_Rounded as Camera} from '#/components/icons/Camera'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {useOnboardingDispatch} from '#/state/shell'
|
// import {useOnboardingDispatch} from '#/state/shell'
|
||||||
import {Loader} from '#/components/Loader'
|
|
||||||
import {useAnalytics} from '#/lib/analytics/analytics'
|
import {useAnalytics} from '#/lib/analytics/analytics'
|
||||||
|
|
||||||
import {Context} from '#/screens/Onboarding/state'
|
import {Context} from '#/screens/Onboarding/state'
|
||||||
@@ -30,13 +27,9 @@ import {
|
|||||||
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron'
|
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron'
|
||||||
import {IconCircle} from '#/components/IconCircle'
|
import {IconCircle} from '#/components/IconCircle'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
|
||||||
import {configurableLabelGroups} from 'state/queries/preferences'
|
|
||||||
import {usePhotoLibraryPermission} from 'lib/hooks/usePermissions'
|
import {usePhotoLibraryPermission} from 'lib/hooks/usePermissions'
|
||||||
import {openCropper, openPicker} from 'lib/media/picker'
|
import {openCropper, openPicker} from 'lib/media/picker'
|
||||||
|
|
||||||
type AvatarPlaceholder = 'thinking' | 'heart' | 'laughing'
|
|
||||||
|
|
||||||
interface Avatar {
|
interface Avatar {
|
||||||
image?: {
|
image?: {
|
||||||
path: string
|
path: string
|
||||||
@@ -58,10 +51,8 @@ const useSetAvatar = () => React.useContext(SetAvatarContext)
|
|||||||
|
|
||||||
export function StepProfile() {
|
export function StepProfile() {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const t = useTheme()
|
|
||||||
const {track} = useAnalytics()
|
const {track} = useAnalytics()
|
||||||
const {state, dispatch} = React.useContext(Context)
|
const {state, dispatch} = React.useContext(Context)
|
||||||
const onboardDispatch = useOnboardingDispatch()
|
|
||||||
const [avatar, setAvatar] = React.useState<Avatar>({
|
const [avatar, setAvatar] = React.useState<Avatar>({
|
||||||
placeholder: 'smile',
|
placeholder: 'smile',
|
||||||
backgroundColor: '#338388',
|
backgroundColor: '#338388',
|
||||||
@@ -207,8 +198,6 @@ function EmojiItem({emoji}: {emoji: Emoji}) {
|
|||||||
}))
|
}))
|
||||||
}, [emoji, setAvatar])
|
}, [emoji, setAvatar])
|
||||||
|
|
||||||
const onSelectAvatar = React.useCallback(() => {}, [])
|
|
||||||
|
|
||||||
const onCameraPress = React.useCallback(async () => {
|
const onCameraPress = React.useCallback(async () => {
|
||||||
if (!(await requestPhotoAccessIfNeeded())) {
|
if (!(await requestPhotoAccessIfNeeded())) {
|
||||||
return
|
return
|
||||||
@@ -232,7 +221,7 @@ function EmojiItem({emoji}: {emoji: Emoji}) {
|
|||||||
...prev,
|
...prev,
|
||||||
image: croppedImage,
|
image: croppedImage,
|
||||||
}))
|
}))
|
||||||
}, [avatar])
|
}, [requestPhotoAccessIfNeeded, setAvatar])
|
||||||
|
|
||||||
if (emoji === 'camera') {
|
if (emoji === 'camera') {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user