-
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.
* Fix messages and listings * Clean import
- Loading branch information
Showing
20 changed files
with
537 additions
and
289 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
78 changes: 78 additions & 0 deletions
78
web/components/Campaign/Home/ApplicationsCampaignInsert.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,78 @@ | ||
import { VStack, Text, Box, Button, HStack, Stack } from '@chakra-ui/react' | ||
import Hands from 'public/assets/img/hands-outline.svg' | ||
import theme from '~theme' | ||
import { useTranslation } from 'next-i18next' | ||
import { ROUTE_PLACES } from '~constants' | ||
import Tag from '~components/Tag' | ||
import Link from '~components/Link' | ||
import useCampaignContext from '~components/Campaign/useCampaignContext' | ||
import { format } from '~utils/date' | ||
import ApplicationCounter from '~components/Campaign/ApplicationCounter' | ||
|
||
const ApplicationsCampaignInsert = () => { | ||
const { currentCampaign } = useCampaignContext() | ||
const { title, limitDate } = currentCampaign || {} | ||
const { t } = useTranslation('home') | ||
|
||
return ( | ||
<VStack | ||
bgColor="white" | ||
borderRadius={{ base: 'none', lg: 'lg' }} | ||
p={4} | ||
alignItems="flex-start" | ||
height={'100%'} | ||
> | ||
<Box> | ||
<Tag status="campaign">{title}</Tag> | ||
</Box> | ||
|
||
<Box width="100%"> | ||
<Stack | ||
mx="auto" | ||
width="100%" | ||
flexDirection={{ base: 'column', md: 'row' }} | ||
alignItems="flex-start" | ||
> | ||
<HStack w="100%" p={2} alignItems="flex-start"> | ||
<Hands | ||
stroke={theme.colors.campaign['dark']} | ||
width="22px" | ||
height="22px" | ||
/> | ||
<Box flex={1}> | ||
<Text fontWeight="bold"> | ||
{t(`campaign.insert.applications.title`)} | ||
</Text> | ||
<Text opacity={0.5}> | ||
{t(`campaign.insert.applications.subtitle`, { | ||
date: format(new Date(limitDate), 'd MMMM'), | ||
})} | ||
</Text> | ||
</Box> | ||
</HStack> | ||
|
||
<Box> | ||
<Button | ||
size="lg" | ||
alignSelf="center" | ||
variant="campaign" | ||
as={Link} | ||
href={`${ROUTE_PLACES}?tab=1`} | ||
> | ||
{t(`campaign.insert.applications.cta`)} | ||
</Button> | ||
</Box> | ||
</Stack> | ||
<Box paddingLeft={{ base: 0, md: 10 }} paddingTop={{ base: 4, md: 0 }}> | ||
<ApplicationCounter | ||
isFullButton | ||
borderTop="1px solid" | ||
borderColor={'gray.100'} | ||
/> | ||
</Box> | ||
</Box> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default ApplicationsCampaignInsert |
70 changes: 70 additions & 0 deletions
70
web/components/Campaign/Home/DisponibilitiesCampaignInsert.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,70 @@ | ||
import { VStack, Text, Box, Button, HStack, Stack } from '@chakra-ui/react' | ||
import Hands from 'public/assets/img/hands-outline.svg' | ||
import theme from '~theme' | ||
import { useTranslation } from 'next-i18next' | ||
import { ROUTE_ACCOUNT_PLACES } from '~constants' | ||
import Tag from '~components/Tag' | ||
import Link from '~components/Link' | ||
import useCampaignContext from '~components/Campaign/useCampaignContext' | ||
import { format } from '~utils/date' | ||
|
||
const DisponibilitiesCampaingInsert = () => { | ||
const { currentCampaign } = useCampaignContext() | ||
const { title, limitDate } = currentCampaign || {} | ||
const { t } = useTranslation('home') | ||
|
||
return ( | ||
<VStack | ||
bgColor="white" | ||
borderRadius={{ base: 'none', lg: 'lg' }} | ||
p={4} | ||
alignItems="flex-start" | ||
height={'100%'} | ||
> | ||
<Box> | ||
<Tag status="campaign">{title}</Tag> | ||
</Box> | ||
|
||
<Box width="100%"> | ||
<Stack | ||
mx="auto" | ||
width="100%" | ||
flexDirection={{ base: 'column', md: 'row' }} | ||
alignItems="flex-start" | ||
> | ||
<HStack w="100%" p={2} alignItems="flex-start"> | ||
<Hands | ||
stroke={theme.colors.campaign['dark']} | ||
width="22px" | ||
height="22px" | ||
/> | ||
<Box flex={1}> | ||
<Text fontWeight="bold"> | ||
{t(`campaign.insert.disponibilities.title`)} | ||
</Text> | ||
<Text opacity={0.5}> | ||
{t(`campaign.insert.disponibilities.subtitle`, { | ||
date: format(new Date(limitDate), 'd MMMM'), | ||
})} | ||
</Text> | ||
</Box> | ||
</HStack> | ||
|
||
<Box> | ||
<Button | ||
size="lg" | ||
alignSelf="center" | ||
variant="campaign" | ||
as={Link} | ||
href={ROUTE_ACCOUNT_PLACES} | ||
> | ||
{t(`campaign.insert.disponibilities.cta`)} | ||
</Button> | ||
</Box> | ||
</Stack> | ||
</Box> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default DisponibilitiesCampaingInsert |
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
import { Text, Flex, Button, StackProps, VStack, Stack } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import useCampaignContext from '~components/Campaign/useCampaignContext' | ||
import Link from '~components/Link' | ||
import { ROUTE_PLACES } from '~constants' | ||
|
||
const HomeHelperCampaign = (props: StackProps) => { | ||
const { t } = useTranslation('common') | ||
const { currentCampaign } = useCampaignContext() | ||
|
||
return ( | ||
<VStack | ||
backgroundColor={'campaign.light'} | ||
borderRadius="4px" | ||
borderTopLeftRadius={undefined} | ||
paddingX={8} | ||
paddingY={4} | ||
marginBottom={4} | ||
spacing={'1rem'} | ||
height={'auto'} | ||
{...props} | ||
> | ||
<Stack width="100%" spacing={6} direction={{ base: 'column', sm: 'row' }}> | ||
<VStack flex={4} justifyContent="flex-start" alignItems="flex-start"> | ||
<Text as="span" fontWeight="bold" marginRight={1}> | ||
{t('campaign.helper_title', { title: currentCampaign?.title })} | ||
</Text> | ||
<Text noOfLines={{ base: 4, md: 3, lg: 2 }}> | ||
{currentCampaign.description} | ||
</Text> | ||
</VStack> | ||
<Flex | ||
flex={1} | ||
justifyContent={{ base: 'flex-start', sm: 'flex-end' }} | ||
alignItems="center" | ||
> | ||
<Button | ||
variant={'campaign'} | ||
as={Link} | ||
href={currentCampaign?.article_link || `${ROUTE_PLACES}?tab=1`} | ||
> | ||
{t('show')} | ||
</Button> | ||
</Flex> | ||
</Stack> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default HomeHelperCampaign |
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 { Text, Flex, Button, StackProps, VStack, Stack } from '@chakra-ui/react' | ||
import { useTranslation } from 'next-i18next' | ||
import Link from '~components/Link' | ||
import { ROUTE_PROJECT } from '~constants' | ||
|
||
const HomeHelperSolidarity = ({ | ||
limitLines, | ||
isHome, | ||
...props | ||
}: { | ||
limitLines?: boolean | ||
isHome?: boolean | ||
} & StackProps) => { | ||
const { t } = useTranslation('common') | ||
|
||
return ( | ||
<VStack | ||
backgroundColor={'blue.200'} | ||
borderRadius="4px" | ||
borderTopLeftRadius={undefined} | ||
paddingX={8} | ||
paddingY={4} | ||
marginBottom={4} | ||
spacing={'1rem'} | ||
height={'auto'} | ||
{...props} | ||
> | ||
<Stack width="100%" spacing={6} direction={{ base: 'column', sm: 'row' }}> | ||
<VStack flex={4} justifyContent="flex-start" alignItems="flex-start"> | ||
<Text as="span" fontWeight="bold" marginRight={1}> | ||
{t('solidarity.helper_title')} | ||
</Text> | ||
<Text noOfLines={limitLines ? { base: 4, md: 3, lg: 2 } : undefined}> | ||
{t('solidarity.helper')} | ||
</Text> | ||
</VStack> | ||
<Flex | ||
flex={1} | ||
justifyContent={{ base: 'flex-start', sm: 'flex-end' }} | ||
alignItems="center" | ||
> | ||
<Button variant={'blueFill'} as={Link} href={ROUTE_PROJECT}> | ||
{t('show')} | ||
</Button> | ||
</Flex> | ||
</Stack> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default HomeHelperSolidarity |
Oops, something went wrong.