-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
356 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
web/components/Account/Application/Place/DetailDrawer/ApplicationDetailDrawer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { | ||
Drawer, | ||
DrawerCloseButton, | ||
DrawerContent, | ||
DrawerHeader, | ||
DrawerOverlay, | ||
VStack, | ||
Divider, | ||
Stack, | ||
Box, | ||
Grid, | ||
GridItem, | ||
} from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import ApplicationDetailHeader from '~components/Account/Application/Place/DetailDrawer/ApplicationDetailHeader' | ||
import { Application } from '~typings/api' | ||
import ApplicationRightPanel from '~components/Account/Application/Place/DetailDrawer/ApplicationRightPanel' | ||
import ApplicationPdf from '~components/Account/Application/Place/DetailDrawer/ApplicationPdf' | ||
|
||
const ApplicationDetailDrawer = ({ | ||
isOpen, | ||
onClose, | ||
application, | ||
}: { | ||
isOpen: boolean | ||
onClose: () => void | ||
application: Application | ||
}) => { | ||
const { t } = useTranslation('application') | ||
const { id } = application ?? {} | ||
|
||
if (!application) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Drawer isOpen={isOpen} placement="right" onClose={onClose} size="xl"> | ||
<DrawerOverlay /> | ||
<DrawerContent p={6} height="100%" maxW="80vw"> | ||
<DrawerCloseButton /> | ||
<DrawerHeader paddingY={0} paddingLeft={0}> | ||
{t('place.detail.title', { id })} | ||
</DrawerHeader> | ||
|
||
<VStack paddingY={4}> | ||
<ApplicationDetailHeader application={application} /> | ||
<Divider /> | ||
|
||
<Grid templateColumns={'repeat(3, 1fr)'} gap={4} width="100%"> | ||
<GridItem colSpan={{ base: 3, md: 2 }}> | ||
<ApplicationPdf /> | ||
</GridItem> | ||
|
||
<GridItem colSpan={{ base: 3, md: 1 }}> | ||
<ApplicationRightPanel application={application} /> | ||
</GridItem> | ||
</Grid> | ||
</VStack> | ||
</DrawerContent> | ||
</Drawer> | ||
) | ||
} | ||
|
||
export default ApplicationDetailDrawer |
51 changes: 51 additions & 0 deletions
51
web/components/Account/Application/Place/DetailDrawer/ApplicationDetailHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Box, Text, SimpleGrid, VStack } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import { Application } from '~typings/api' | ||
import { format } from '~utils/date' | ||
|
||
const ApplicationDetailHeader = ({ | ||
application, | ||
}: { | ||
application: Application | ||
}) => { | ||
const { t } = useTranslation('application') | ||
|
||
return ( | ||
<SimpleGrid columns={{ base: 1, sm: 3 }} spacing={4} width="100%"> | ||
<VStack | ||
borderBottom={{ base: '1px solid lightgray', sm: 'none' }} | ||
alignItems="flex-start" | ||
p={2} | ||
> | ||
<Text fontWeight="bold">{t('place.detail.header.slot')}</Text> | ||
<Text>{`${format( | ||
application?.disponibility?.start, | ||
'dd MMMM', | ||
)} - ${format(application?.disponibility?.end, 'dd MMMM yyyy')}`}</Text> | ||
</VStack> | ||
|
||
<VStack | ||
borderLeft={{ base: 'none', sm: '1px solid lightgray' }} | ||
borderBottom={{ base: '1px solid lightgray', sm: 'none' }} | ||
alignItems="flex-start" | ||
p={2} | ||
> | ||
<Text fontWeight="bold"> {t('place.detail.header.space')}</Text> | ||
{/* @ts-expect-error */} | ||
<Text>{application?.disponibility?.espace?.name}</Text> | ||
</VStack> | ||
|
||
<VStack | ||
justifyContent="space-between" | ||
alignItems="flex-start" | ||
p={2} | ||
borderLeft={{ base: 'none', sm: '1px solid lightgray' }} | ||
> | ||
<Text fontWeight="bold">{t('place.detail.header.company')}</Text> | ||
<Text>{application?.company?.structureName}</Text> | ||
</VStack> | ||
</SimpleGrid> | ||
) | ||
} | ||
|
||
export default ApplicationDetailHeader |
102 changes: 102 additions & 0 deletions
102
web/components/Account/Application/Place/DetailDrawer/ApplicationDetailInfos.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { VStack, Text, Box } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import Link from '~components/Link' | ||
import { UsersPermissionsUser } from '~typings/api' | ||
|
||
const ApplicationDetailInfos = ({ | ||
company, | ||
}: { | ||
company: UsersPermissionsUser | ||
}) => { | ||
const { t } = useTranslation('application') | ||
const { | ||
structureName, | ||
address, | ||
phone, | ||
email, | ||
website, | ||
siret, | ||
insuranceName, | ||
ape, | ||
insuranceNumber, | ||
license, | ||
} = company ?? {} | ||
|
||
return ( | ||
<VStack alignItems="stretch" fontWeight="600" spacing={4} width="100%"> | ||
<Box> | ||
<Text>{structureName}</Text> | ||
<Text>{address}</Text> | ||
</Box> | ||
|
||
<Box> | ||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.phone')}</Text> | ||
<Text as="span" pl={1}> | ||
{phone} | ||
</Text> | ||
</Box> | ||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.email')}</Text> | ||
<Text as="span" pl={1}> | ||
{email} | ||
</Text> | ||
</Box> | ||
|
||
{website && ( | ||
<Text | ||
as={Link} | ||
href={website} | ||
target="_blank" | ||
color="gray.300" | ||
fontWeight={'500'} | ||
textDecoration="underline" | ||
> | ||
{website} | ||
</Text> | ||
)} | ||
</Box> | ||
|
||
<Box> | ||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.siret')}</Text> | ||
<Text as="span" pl={1}> | ||
{siret} | ||
</Text> | ||
</Box> | ||
|
||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.ape')}</Text> | ||
<Text pl={1} as="span"> | ||
{ape} | ||
</Text> | ||
</Box> | ||
|
||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.insurance_name')}</Text> | ||
<Text pl={1} as="span"> | ||
{insuranceName} | ||
</Text> | ||
</Box> | ||
|
||
<Box> | ||
<Text as="span"> | ||
{t('place.detail.right_panel.insurance_number')} | ||
</Text> | ||
<Text pl={1} as="span"> | ||
{insuranceNumber} | ||
</Text> | ||
</Box> | ||
|
||
<Box> | ||
<Text as="span">{t('place.detail.right_panel.license')}</Text> | ||
<Text pl={1} as="span"> | ||
{license} | ||
</Text> | ||
</Box> | ||
</Box> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default ApplicationDetailInfos |
7 changes: 7 additions & 0 deletions
7
web/components/Account/Application/Place/DetailDrawer/ApplicationPdf.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Box } from '@chakra-ui/react' | ||
|
||
const ApplicationPdf = () => { | ||
return <Box>AAA</Box> | ||
} | ||
|
||
export default ApplicationPdf |
68 changes: 68 additions & 0 deletions
68
web/components/Account/Application/Place/DetailDrawer/ApplicationRightPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { VStack, Divider, Button, Text, Box } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import ApplicationDownload from 'public/assets/img/applicationDownload.svg' | ||
import ApplicationSelected from 'public/assets/img/applicationSelected.svg' | ||
import ApplicationDetailInfos from '~components/Account/Application/Place/DetailDrawer/ApplicationDetailInfos' | ||
import { Application, Espace } from '~typings/api' | ||
|
||
const ApplicationRightPanel = ({ | ||
application, | ||
}: { | ||
application: Application | ||
}) => { | ||
const { t } = useTranslation('application') | ||
return ( | ||
<VStack | ||
p={{ base: 0, md: 4 }} | ||
borderLeft={{ base: 'none', md: '1px solid lightgray' }} | ||
spacing={4} | ||
> | ||
<VStack maxW="100%" overflow="hidden" width="100%"> | ||
<Button | ||
isFullWidth | ||
borderRadius={0} | ||
leftIcon={<ApplicationDownload />} | ||
display="flex" | ||
justifyContent={'flex-start'} | ||
p={3} | ||
backgroundColor="blue.100" | ||
color="blue.500" | ||
_hover={{ | ||
backgroundColor: 'blue.200', | ||
}} | ||
_active={{ | ||
backgroundColor: 'blue.300', | ||
}} | ||
height="auto!important" | ||
> | ||
<Text pl={1}>{t('place.detail.download_pdf')}</Text> | ||
</Button> | ||
<Button | ||
isFullWidth | ||
borderRadius={0} | ||
leftIcon={<ApplicationSelected />} | ||
display="flex" | ||
justifyContent={'flex-start'} | ||
p={3} | ||
backgroundColor="rgba(110, 174, 127, 0.25)" | ||
color="black" | ||
_hover={{ | ||
backgroundColor: 'rgba(110, 174, 127, 0.4)', | ||
}} | ||
_active={{ | ||
backgroundColor: 'rgba(110, 174, 127, 0.6)', | ||
}} | ||
height="auto!important" | ||
> | ||
<Text pl={1}>{t('place.detail.preselect')}</Text> | ||
</Button> | ||
</VStack> | ||
|
||
<Divider /> | ||
{/* @ts-expect-error */} | ||
<ApplicationDetailInfos company={application?.company} /> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default ApplicationRightPanel |
Oops, something went wrong.