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