-
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.
Messages improvements + places helper
- Loading branch information
Showing
11 changed files
with
457 additions
and
392 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
39 changes: 39 additions & 0 deletions
39
web/components/Campaign/PlaceAdmin/PlacesCampaignHelper.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,39 @@ | ||
import { Box, HStack, Text } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import Pin from 'public/assets/img/pin-helper.svg' | ||
import useCampaignContext from '~components/Campaign/useCampaignContext' | ||
import { format } from '~utils/date' | ||
|
||
const PlacesCampaignHelper = () => { | ||
const { t } = useTranslation('place') | ||
const { currentCampaign } = useCampaignContext() | ||
|
||
if ( | ||
!currentCampaign || | ||
!['disponibilities', 'applications']?.includes(currentCampaign?.mode) | ||
) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Box paddingY={4}> | ||
<HStack backgroundColor="grayBackground" paddingX={6} paddingY={4}> | ||
<Box> | ||
<Pin stroke="black" height="26px" width="26px" /> | ||
</Box> | ||
<Text> | ||
<Text as="span" fontWeight="bold" marginRight={1}> | ||
{t(`campaign.helpers.${currentCampaign.mode}.title`, { | ||
title: currentCampaign?.title, | ||
})} | ||
</Text> | ||
{t(`campaign.helpers.${currentCampaign.mode}.description`, { | ||
date: format(currentCampaign?.limitDate, 'dd/MM/yyyy'), | ||
})} | ||
</Text> | ||
</HStack> | ||
</Box> | ||
) | ||
} | ||
|
||
export default PlacesCampaignHelper |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.