summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/pages/projects/index.js
blob: bea9ad93a733c42812610b32925ebdb74a72073e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, { useEffect } from 'react'
import Head from 'next/head'
import { useDispatch } from 'react-redux'
import { fetchAuthorizationsOfCurrentUser } from '../../actions/users'
import ProjectFilterPanel from '../../components/projects/FilterPanel'
import NewProjectModal from '../../containers/modals/NewProjectModal'
import NewProjectButtonContainer from '../../containers/projects/NewProjectButtonContainer'
import VisibleProjectList from '../../containers/projects/VisibleProjectAuthList'
import AppNavbarContainer from '../../containers/navigation/AppNavbarContainer'
import { useRequireAuth } from '../../auth/hook'

function Projects() {
    const dispatch = useDispatch()

    useRequireAuth()
    useEffect(() => dispatch(fetchAuthorizationsOfCurrentUser()))

    return (
        <>
            <Head>
                <title>My Projects - OpenDC</title>
            </Head>
            <div className="full-height">
                <AppNavbarContainer fullWidth={false} />
                <div className="container text-page-container full-height">
                    <ProjectFilterPanel />
                    <VisibleProjectList />
                    <NewProjectButtonContainer />
                </div>
                <NewProjectModal />
            </div>
        </>
    )
}

export default Projects