mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
Edit LeftPanelButton to add variants
Took 8 minutes
This commit is contained in:
@@ -7,10 +7,14 @@ import {
|
|||||||
Spacer,
|
Spacer,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import {useRouter} from 'next/router';
|
import {useRouter} from 'next/router';
|
||||||
|
|
||||||
import {AiFillMessage} from 'react-icons/ai';
|
import {AiFillMessage} from 'react-icons/ai';
|
||||||
import {BsFillPersonFill} from 'react-icons/bs';
|
import {BsFillPersonFill} from 'react-icons/bs';
|
||||||
|
import {BiLogOut} from 'react-icons/bi';
|
||||||
|
|
||||||
import LeftPanelButton
|
import LeftPanelButton
|
||||||
from '@/components/layout/dashboard/left_panel/LeftPanelButton';
|
from '@/components/layout/dashboard/left_panel/LeftPanelButton';
|
||||||
|
import {signOut} from 'next-auth/react';
|
||||||
|
|
||||||
export default function LeftPanel(props) {
|
export default function LeftPanel(props) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -42,6 +46,10 @@ export default function LeftPanel(props) {
|
|||||||
onClickHandler={() => router.push('/dashboard')}>
|
onClickHandler={() => router.push('/dashboard')}>
|
||||||
Profile
|
Profile
|
||||||
</LeftPanelButton>
|
</LeftPanelButton>
|
||||||
|
<LeftPanelButton variant={"outline"} leftIcon={<BiLogOut/>}
|
||||||
|
onClickHandler={() => signOut()}>
|
||||||
|
Deconnexion
|
||||||
|
</LeftPanelButton>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
import {Button} from '@chakra-ui/react';
|
import {Button, ResponsiveValue} from '@chakra-ui/react';
|
||||||
import {ReactJSXElement} from '@emotion/react/types/jsx-namespace';
|
import {ReactJSXElement} from '@emotion/react/types/jsx-namespace';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children?: ReactJSXElement
|
children?: ReactJSXElement
|
||||||
onClickHandler: () => void
|
onClickHandler: () => void
|
||||||
leftIcon ?: ReactJSXElement
|
leftIcon?: ReactJSXElement,
|
||||||
|
variant?: ResponsiveValue<'link' | 'outline' | string | 'ghost' | 'solid' | 'unstyled'>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function LeftPanelButton(props: Props) {
|
export default function LeftPanelButton(props: Props) {
|
||||||
const {children, onClickHandler, leftIcon: icon} = props;
|
const {children, onClickHandler, leftIcon: icon, variant = "ghost"} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
colorScheme={'purple'}
|
colorScheme={'purple'}
|
||||||
variant={'ghost'}
|
variant={variant}
|
||||||
width={'100%'}
|
width={'100%'}
|
||||||
justifyContent={'left'}
|
justifyContent={'left'}
|
||||||
onClick={onClickHandler}
|
onClick={onClickHandler}
|
||||||
|
|||||||
Reference in New Issue
Block a user