Show all communities (#109)
This commit is contained in:
parent
05e6e6aff8
commit
8d7898e9a1
|
@ -30,17 +30,15 @@ function DirectoryCard({ community }: DirectoryCardProps) {
|
|||
setCustomStyle(false)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('resize', handleResize)
|
||||
return () => window.removeEventListener('resize', handleResize)
|
||||
}, [window.innerWidth])
|
||||
|
||||
if (!community.directoryInfo) {
|
||||
return <div />
|
||||
}
|
||||
let timeLeft: string | undefined = undefined
|
||||
if (community.directoryInfo.untilNextFeature) {
|
||||
if (community?.directoryInfo?.untilNextFeature) {
|
||||
timeLeft = `${community.directoryInfo.untilNextFeature / (3600 * 24 * 7)} weeks left`
|
||||
} else {
|
||||
timeLeft = `1 weeks left`
|
||||
}
|
||||
|
||||
const { votingContract } = useContracts()
|
||||
|
@ -76,7 +74,7 @@ function DirectoryCard({ community }: DirectoryCardProps) {
|
|||
community={community}
|
||||
heading={timeLeft ? 'This community has to wait until it can be featured again' : 'Weekly Feature vote'}
|
||||
icon={timeLeft ? '⏳' : '⭐'}
|
||||
sum={community.directoryInfo.featureVotes?.toNumber()}
|
||||
sum={community?.directoryInfo?.featureVotes?.toNumber()}
|
||||
timeLeft={timeLeft}
|
||||
currentVoting={currentVoting}
|
||||
room={votingRoom}
|
||||
|
@ -90,7 +88,6 @@ export function DirectoryCards() {
|
|||
const [filterKeyword, setFilterKeyword] = useState('')
|
||||
const [sortedBy, setSortedBy] = useState(DirectorySortingEnum.IncludedRecently)
|
||||
const communities = useDirectoryCommunities(filterKeyword, sortedBy)
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageBar>
|
||||
|
|
Loading…
Reference in New Issue