about summary refs log tree commit diff
path: root/src/view/screens/ProfileFollowers.tsx
blob: 71c0e4a9cb2a46895f59241e30458d4d27110b76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react'
import {View} from 'react-native'
import {useFocusEffect} from '@react-navigation/native'
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
import {ViewHeader} from '../com/util/ViewHeader'
import {ProfileFollowers as ProfileFollowersComponent} from '../com/profile/ProfileFollowers'
import {useSetMinimalShellMode} from '#/state/shell'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'

type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileFollowers'>
export const ProfileFollowersScreen = withAuthRequired(
  ({route}: Props) => {
    const {name} = route.params
    const setMinimalShellMode = useSetMinimalShellMode()
    const {_} = useLingui()

    useFocusEffect(
      React.useCallback(() => {
        setMinimalShellMode(false)
      }, [setMinimalShellMode]),
    )

    return (
      <View>
        <ViewHeader title={_(msg`Followers`)} />
        <ProfileFollowersComponent name={name} />
      </View>
    )
  },
  {isPublic: true},
)