-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1633 from decentdao/reskin/home-page
`Reskin` - home page
- Loading branch information
Showing
19 changed files
with
886 additions
and
349 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,61 @@ | ||
import { BoxProps, Center, Flex } from '@chakra-ui/react'; | ||
import { Box, Flex, Text } from '@chakra-ui/react'; | ||
import { ReactNode } from 'react'; | ||
import { StyledBox } from '../../ui/containers/StyledBox'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
interface Props extends BoxProps { | ||
leftSlot: ReactNode; | ||
rightSlot: ReactNode; | ||
} | ||
|
||
export function CTABox({ leftSlot, rightSlot, ...rest }: Props) { | ||
export default function CTABox({ | ||
Icon, | ||
titleKey, | ||
descKey, | ||
titleColor = 'white-0', | ||
descColor = 'neutral-7', | ||
bg = 'neutral-3', | ||
to, | ||
target, | ||
pr, | ||
iconContainerJustify, | ||
}: { | ||
Icon: ReactNode; | ||
titleKey: string; | ||
descKey: string; | ||
titleColor?: string; | ||
descColor?: string; | ||
bg?: string; | ||
to: string; | ||
target?: string; | ||
pr?: string | number; | ||
iconContainerJustify?: string; | ||
}) { | ||
const { t } = useTranslation('home'); | ||
return ( | ||
<StyledBox | ||
w="100%" | ||
{...rest} | ||
<Flex | ||
gap="3rem" | ||
px="1.5rem" | ||
w={{ base: '100%', lg: 'calc(50% - 0.75rem)' }} | ||
h="10rem" | ||
bg={bg} | ||
alignItems="center" | ||
borderRadius={8} | ||
as={Link} | ||
pr={pr} | ||
to={to} | ||
target={target} | ||
> | ||
<Center> | ||
<Flex | ||
padding="0.5rem" | ||
alignItems="center" | ||
flexWrap="wrap" | ||
gap="2rem" | ||
<Box width="50%"> | ||
<Text | ||
textStyle="display-2xl" | ||
color={titleColor} | ||
> | ||
{leftSlot} | ||
{rightSlot} | ||
</Flex> | ||
</Center> | ||
</StyledBox> | ||
{t(titleKey)} | ||
</Text> | ||
<Text color={descColor}>{t(descKey)}</Text> | ||
</Box> | ||
<Flex | ||
width="50%" | ||
justifyContent={iconContainerJustify} | ||
> | ||
{Icon} | ||
</Flex> | ||
</Flex> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,59 +1,77 @@ | ||
import { Text, BoxProps, Image, HStack, Spacer, Flex, Box, Link } from '@chakra-ui/react'; | ||
import { Text, VStack, Flex, Image } from '@chakra-ui/react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link as RouterLink } from 'react-router-dom'; | ||
import { DAO_ROUTES } from '../../../constants/routes'; | ||
import { Badge } from '../../ui/badges/Badge'; | ||
import { StyledBox } from '../../ui/containers/StyledBox'; | ||
interface DAOFeatureProps extends BoxProps { | ||
|
||
export interface FeaturedDAO { | ||
iconSrc: string; | ||
title: string; | ||
desc: string; | ||
iconBg?: string; | ||
iconRounded?: boolean; | ||
titleKey: string; | ||
network: string; | ||
networkName: string; | ||
votingStrategy: string; | ||
address: string; | ||
} | ||
|
||
interface FeaturedDAOCardProps extends FeaturedDAO {} | ||
|
||
export default function FeaturedDAOCard({ | ||
iconSrc, | ||
title, | ||
desc, | ||
iconBg = 'lilac-0', | ||
iconRounded = false, | ||
titleKey, | ||
network, | ||
address, | ||
...rest | ||
}: DAOFeatureProps) { | ||
networkName, | ||
votingStrategy, | ||
}: FeaturedDAOCardProps) { | ||
const { t } = useTranslation('home'); | ||
return ( | ||
<Box {...rest}> | ||
<StyledBox | ||
height="full" | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="space-between" | ||
<StyledBox | ||
width={{ base: '100%', md: 'calc(50% - 0.75rem)', xl: 'calc(25% - 0.75rem)' }} | ||
to={DAO_ROUTES.dao.relative(network, address)} | ||
> | ||
<VStack | ||
justifyContent="center" | ||
gap="0.5rem" | ||
> | ||
<Box> | ||
<HStack paddingBottom="1rem"> | ||
<Image | ||
width="1.5rem" | ||
height="1.5rem" | ||
src={iconSrc} | ||
alt={title} | ||
/> | ||
<Text paddingStart="1.25rem">{title}</Text> | ||
</HStack> | ||
<Text marginBottom="0.5rem">{desc}</Text> | ||
</Box> | ||
<Flex> | ||
<Spacer /> | ||
<Link | ||
as={RouterLink} | ||
color="celery-0" | ||
_hover={{ color: 'celery--6' }} | ||
alignSelf="end" | ||
textStyle="display-xl" | ||
to={DAO_ROUTES.dao.relative(network, address)} | ||
<Flex | ||
width="80px" | ||
height="80px" | ||
bg={iconBg} | ||
justifyContent="center" | ||
alignItems="center" | ||
borderRadius="50%" | ||
> | ||
<Image | ||
src={iconSrc} | ||
alt={t(titleKey)} | ||
width="auto" | ||
height="auto" | ||
borderRadius={iconRounded ? '50%' : '0'} | ||
/> | ||
</Flex> | ||
<Text textStyle="display-xl">{t(titleKey)}</Text> | ||
<Flex | ||
gap="0.5rem" | ||
mt="1rem" | ||
> | ||
<Badge | ||
labelKey="ownerApproved" | ||
size="sm" | ||
> | ||
{networkName} | ||
</Badge> | ||
<Badge | ||
labelKey="ownerApproved" | ||
size="sm" | ||
> | ||
{t('featureLink')} | ||
</Link> | ||
{votingStrategy} | ||
</Badge> | ||
</Flex> | ||
</StyledBox> | ||
</Box> | ||
</VStack> | ||
</StyledBox> | ||
); | ||
} |
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
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.