about summary refs log tree commit diff
path: root/src/view/screens/PostDownvotedBy.tsx
blob: 570482598176e73234310712f77b92a15b568f71 (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
import React, {useEffect} from 'react'
import {View} from 'react-native'
import {ViewHeader} from '../com/util/ViewHeader'
import {PostVotedBy as PostLikedByComponent} from '../com/post-thread/PostVotedBy'
import {ScreenParams} from '../routes'
import {useStores} from 'state/index'
import {makeRecordUri} from 'lib/strings/url-helpers'

export const PostDownvotedBy = ({navIdx, visible, params}: ScreenParams) => {
  const store = useStores()
  const {name, rkey} = params
  const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)

  useEffect(() => {
    if (visible) {
      store.nav.setTitle(navIdx, 'Downvoted by')
      store.shell.setMinimalShellMode(false)
    }
  }, [store, visible, navIdx])

  return (
    <View>
      <ViewHeader title="Downvoted by" />
      <PostLikedByComponent uri={uri} direction="down" />
    </View>
  )
}