feat: nextjs 14 (#20)

* feat: eslint update

* feat: start over and layout

* feat: nextjs13 boilerplate

* feat: static homepage

* feat: static pages

* feat: static unirse

* chore: remove old mui types

* chore: moving from yarn to bun

* chore: update dependencies

* feat: static equipo unirse

* feat: move appwrite to entgamers-database package

* feat: improve ui components

* feat: update dependencies

* feat: static login & register pages

* fix: remove unused logs

* feat: state redux toolkit & feedback slice

* fix: equipo div inside p

* feat: session

* feat: metadataBase

* feat: basic apply form

* feat: http verbs

* feat: recover password flow

* chore: updated dependencies

* fix: fix image config

* fix: api team-applications route

* fix: remove not longer used fonts

* feat: session with current user

* fix: login form recuperar contraseña

* feat: equipo pages now uses data from database package

* feat: useManageErrors hook

* feat: updated cuenta page

* chore: updated old formik forms to use hooks

* feat: updated dependencies &package name

* fix: session related bugs

* fix: missing helper texts

* feat: static applications dashboard

* chore: update dependencies

* refactor: team applications

* fix: session api update
This commit is contained in:
2024-07-30 18:23:15 -06:00
committed by GitHub
parent 14b52a7800
commit 8802b0fd68
175 changed files with 4485 additions and 8638 deletions
@@ -0,0 +1,73 @@
'use client'
import TeamApplications from '@/app/dashboard/_components/TeamApplications'
import Button from '@/components/ui/Button'
import ButtonGroup from '@/components/ui/ButtonGroup'
import Typography from '@/components/ui/Typography'
import useSession from '@/hooks/useSession'
import { css } from '@/styled-system/css'
import { ADMIN_CLAN_ID } from 'entgamers-database/frontend/clanes/administrative'
import { AnimatePresence, motion } from 'framer-motion'
import { useState, type FC } from 'react'
type Tab = undefined | 'teamApplications'
const DashboardTabs: FC = () => {
const { clanes, belongToClan } = useSession('/login')
const [currentTab, setCurrentTab] = useState<Tab>(undefined)
return (
<>
{clanes !== undefined && (
<ButtonGroup
fullWidth
>
<Button fullWidth onClick={() => { setCurrentTab(undefined) }} disabled={currentTab === undefined}>
Panel
</Button>
{belongToClan(ADMIN_CLAN_ID) && (
<Button fullWidth onClick={() => { setCurrentTab('teamApplications') }} disabled={currentTab === 'teamApplications'}>
Aplicaciones
</Button>
)}
</ButtonGroup>
)}
<div
className={css({
overflow: 'hidden',
marginTop: 'medium'
})}
>
<AnimatePresence
initial={false}
mode='wait'
>
{currentTab === undefined && (
<motion.div
transition={{ duration: 0.15, ease: 'easeInOut' }}
initial={{ opacity: 0, x: '-100%' }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: '100%' }}
key="dashboard"
>
<Typography variant="body1">Selecciona una de las opciones de arriba para comenzar.</Typography>
</motion.div>
)}
{currentTab === 'teamApplications' && (
<motion.div
transition={{ duration: 0.15, ease: 'easeInOut' }}
initial={{ opacity: 0, x: '-100%' }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: '100%' }}
key="teamApplications"
>
<TeamApplications />
</motion.div>
)}
</AnimatePresence>
</div>
</>
)
}
export default DashboardTabs