8802b0fd68
* 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
78 lines
2.1 KiB
TypeScript
78 lines
2.1 KiB
TypeScript
'use client'
|
|
import Button from '@/components/ui/Button'
|
|
import ButtonGroup from '@/components/ui/ButtonGroup'
|
|
import useSession from '@/hooks/useSession'
|
|
import { css } from '@/styled-system/css'
|
|
import { AnimatePresence, motion } from 'framer-motion'
|
|
import { useState, type FC } from 'react'
|
|
import UpdateEmail from './UpdateEmail'
|
|
import UpdatePassword from './UpdatePassword'
|
|
import UpdateUserName from './UpdateUserName'
|
|
import UpdateUserPreferences from './UpdateUserPreferences'
|
|
|
|
type Tab = 'perfil' | 'login'
|
|
|
|
const CuentaTabs: FC = () => {
|
|
useSession('/login')
|
|
const [currentTab, setCurrentTab] = useState<Tab>('perfil')
|
|
|
|
return (
|
|
<>
|
|
<ButtonGroup
|
|
fullWidth={true}
|
|
>
|
|
<Button
|
|
fullWidth
|
|
onClick={() => { setCurrentTab('perfil') }}
|
|
disabled={currentTab === 'perfil'}
|
|
>
|
|
Perfil
|
|
</Button>
|
|
<Button
|
|
fullWidth
|
|
onClick={() => { setCurrentTab('login') }}
|
|
disabled={currentTab === 'login'}
|
|
>
|
|
Login
|
|
</Button>
|
|
</ButtonGroup>
|
|
<div
|
|
className={css({
|
|
overflow: 'hidden',
|
|
marginTop: 'medium'
|
|
})}
|
|
>
|
|
<AnimatePresence
|
|
initial={false}
|
|
mode='wait'
|
|
>
|
|
{currentTab === 'login' && (
|
|
<motion.div
|
|
transition={{ duration: 0.15, ease: 'easeInOut' }}
|
|
initial={{ opacity: 0, x: '-100%' }}
|
|
animate={{ opacity: 1, x: 0 }}
|
|
exit={{ opacity: 0, x: '100%' }}
|
|
key="login">
|
|
<UpdateEmail />
|
|
<UpdatePassword />
|
|
</motion.div>
|
|
)}
|
|
{currentTab === 'perfil' && (
|
|
<motion.div
|
|
transition={{ duration: 0.15, ease: 'easeInOut' }}
|
|
initial={{ opacity: 0, x: '-100%' }}
|
|
animate={{ opacity: 1, x: 0 }}
|
|
exit={{ opacity: 0, x: '100%' }}
|
|
key="perfil">
|
|
<UpdateUserName />
|
|
<UpdateUserPreferences />
|
|
</motion.div>
|
|
)}
|
|
</AnimatePresence>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default CuentaTabs
|