Skip to content

Commit

Permalink
feat: add back button on join page (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifarias authored Feb 2, 2022
1 parent ed945ef commit 2dec13a
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/pages/join/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ import JoinTableForm from '@/components/client/JoinTableForm'
import Logo from '@/components/Logo'
import { Box, Button, Flex, Text } from '@chakra-ui/react'
import React, { useState } from 'react'
import { ChevronLeftIcon } from '@chakra-ui/icons'
import { useRouter } from 'next/router'

const PageHeader = () => {
const router = useRouter()
return (
<Flex w='full' align='center' marginBottom='40%'>
<Box flex={1}>
<Button
variant='ghost'
sx={{ fontSize: '2xl', boxSize: 10 }}
onClick={() => router.back()}>
<ChevronLeftIcon />
</Button>
</Box>
<Logo />
<Box flex={1}></Box>
</Flex>
)
}

const JoinTablePage = () => {
const [showJoin, setShowJoin] = useState<boolean>(true)
Expand All @@ -12,11 +32,12 @@ const JoinTablePage = () => {
direction="column"
sx={{
alignItems: 'center',
padding: 8,
paddingY: 4,
paddingX: 5,
}}>
<Box sx={{ marginBottom: '50%' }}>
<Logo />
</Box>

<PageHeader />

{showJoin ? (
<>
<JoinTableForm />
Expand Down

0 comments on commit 2dec13a

Please sign in to comment.