about summary refs log tree commit diff
path: root/src/screens/Profile/ProfileLabelerLikedBy.tsx
blob: 1d2167520829deee3707a5cb7227456d1ba28850 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react'
import {View} from 'react-native'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useFocusEffect} from '@react-navigation/native'

import {NativeStackScreenProps, CommonNavigatorParams} from '#/lib/routes/types'
import {ViewHeader} from '#/view/com/util/ViewHeader'
import {LikedByList} from '#/components/LikedByList'
import {useSetMinimalShellMode} from '#/state/shell'
import {makeRecordUri} from '#/lib/strings/url-helpers'

import {atoms as a, useBreakpoints} from '#/alf'

export function ProfileLabelerLikedByScreen({
  route,
}: NativeStackScreenProps<CommonNavigatorParams, 'ProfileLabelerLikedBy'>) {
  const setMinimalShellMode = useSetMinimalShellMode()
  const {name: handleOrDid} = route.params
  const uri = makeRecordUri(handleOrDid, 'app.bsky.labeler.service', 'self')
  const {_} = useLingui()
  const {gtMobile} = useBreakpoints()

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

  return (
    <View
      style={[
        a.mx_auto,
        a.w_full,
        a.h_full_vh,
        gtMobile && [
          {
            maxWidth: 600,
          },
        ],
      ]}>
      <ViewHeader title={_(msg`Liked By`)} />
      <LikedByList uri={uri} />
    </View>
  )
}