* Rework 'navIdx' variables from number arrays to strings to avoid equality-check failures in react hooks * Resolve all remaining lint issues * Fix tests * Use node v18 in gh action test
27 lines
842 B
TypeScript
27 lines
842 B
TypeScript
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'
|
|
import {makeRecordUri} from '../../lib/strings'
|
|
|
|
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>
|
|
)
|
|
}
|