nyx-dashboard/pages/controlpanel/index.js

58 lines
1.7 KiB
JavaScript
Raw Normal View History

2021-06-20 15:49:56 +02:00
import React from 'react'
import Card from '../../components/Card'
2021-06-21 05:18:30 +02:00
import Head from 'next/head'
2021-06-22 02:22:10 +02:00
import { useSession } from 'next-auth/client'
2021-06-28 02:28:53 +02:00
import { Flex, Text, Spacer } from "@chakra-ui/react"
2021-06-29 04:01:14 +02:00
import {motion} from 'framer-motion'
2021-06-28 02:28:53 +02:00
2021-06-29 04:01:14 +02:00
const container = {
hidden: { opacity: 1, scale: 0 },
visible: {
opacity: 1,
scale: 1,
transition: {
delayChildren: 0.3,
staggerChildren: 0.2
}
}
}
const item = {
hidden: { y: 20, opacity: 0 },
visible: {
y: 0,
opacity: 1
}
}
2021-06-20 15:49:56 +02:00
2021-06-22 02:24:07 +02:00
function Index() {
2021-06-22 02:22:10 +02:00
const [session, loading] = useSession()
2021-06-20 15:49:56 +02:00
return (
2021-06-29 04:01:14 +02:00
<>
2021-06-22 02:22:10 +02:00
{!session && <>
<h1>Seems like you&apos;re not logged in. Log in to get started!</h1>
</>
}
{session && <>
<Head>
<title>Cath Control Panel</title>
</Head>
2021-06-29 04:01:14 +02:00
<Text fontSize='4xl' marginBottom='15'>Control Panel</Text>
<motion.div variants={container} initial="hidden" animate="visible" exit={{opacity: 0}}>
2021-06-28 02:28:53 +02:00
<Flex direction='column'>
2021-06-29 04:01:14 +02:00
<Card title='Commands' desc='Control your commands' link='/controlpanel/commands' variants={item}/>
<Spacer />
<Card title='Commands' desc='Control your commands' link='/controlpanel/commands' variants={item}/>
<Spacer />
<Card title='Commands' desc='Control your commands' link='/controlpanel/commands' variants={item}/>
2021-06-28 02:28:53 +02:00
</Flex>
2021-06-29 04:01:14 +02:00
</motion.div>
2021-06-22 02:22:10 +02:00
</>
}
2021-06-21 05:18:30 +02:00
</>
2021-06-20 15:49:56 +02:00
)
}
2021-06-29 04:01:14 +02:00
export default Index