feat: add repostList hook
This commit is contained in:
parent
df5ebdb37f
commit
e0394ab0fd
@ -4,6 +4,7 @@ export * from './useFilteredMods'
|
||||
export * from './useGames'
|
||||
export * from './useMuteLists'
|
||||
export * from './useNSFWList'
|
||||
export * from './useRepostList'
|
||||
export * from './useReactions'
|
||||
export * from './useNDKContext'
|
||||
export * from './useScrollDisable'
|
||||
|
19
src/hooks/useRepostList.tsx
Normal file
19
src/hooks/useRepostList.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { useState } from 'react'
|
||||
import { useDidMount } from './useDidMount'
|
||||
import { useNDKContext } from './useNDKContext'
|
||||
import { CurationSetIdentifiers, getReportingSet } from 'utils'
|
||||
|
||||
export const useRepostList = () => {
|
||||
const ndkContext = useNDKContext()
|
||||
const [repostList, setRepostList] = useState<string[]>([])
|
||||
|
||||
useDidMount(async () => {
|
||||
const list = await getReportingSet(
|
||||
CurationSetIdentifiers.Repost,
|
||||
ndkContext
|
||||
)
|
||||
setRepostList(list)
|
||||
})
|
||||
|
||||
return repostList
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user