[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
1.0 KiB

import React, { FC, useEffect } from 'react'
import { Link } from 'react-router-dom'
import { setTitle } from 'src/utils'
import { Group } from 'src/types'
import PageHeader from 'src/components/page-header'
import GroupList from 'src/components/group-list'
interface Props {
groups: Group[]
fetchGroups: () => void
}
const Directory: FC<Props> = ({ groups, fetchGroups }) => {
useEffect(() => {
fetchGroups()
}, [])
useEffect(() => {
setTitle('Communities')
})
return (
<div>
<PageHeader title="Communities" />
<div className="main-content">
<GroupList groups={groups} />
{groups.length === 0 && <p>No Communities</p>}
<br /><br />
<p className="has-text-centered">
<Link className="has-text-primary" to="/register">Create your own Community</Link>
</p>
</div>
</div>
)
}
export default Directory