-
Notifications
You must be signed in to change notification settings - Fork 0
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 #20 from vtexdocs/feat/homepage-documentation
Homepage Documentation, Support Resources, Announcements and FAQ sections
- Loading branch information
Showing
61 changed files
with
1,530 additions
and
820 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
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,90 @@ | ||
import Link from 'next/link' | ||
import { Box, Flex, Text, Timeline } from '@vtex/brand-ui' | ||
|
||
import { getDaysElapsed } from '../../utils/get-days-elapsed' | ||
import { useIntl } from 'react-intl' | ||
|
||
import styles from './styles' | ||
import MegaphoneIcon from 'components/icons/megaphone-icon' | ||
import NewIcon from 'components/icons/new-icon' | ||
|
||
export interface CardProps { | ||
title: string | ||
description: string | ||
date: Date | ||
first?: boolean | ||
} | ||
|
||
const AnnouncementTimelineItem = ({ | ||
title, | ||
date, | ||
first = false, | ||
}: CardProps) => { | ||
const intl = useIntl() | ||
|
||
return ( | ||
<Flex sx={styles.releaseContainer}> | ||
<Timeline.Event | ||
sx={styles.timeLineBar} | ||
title={ | ||
first ? ( | ||
<Text sx={styles.newTitle}>New</Text> | ||
) : ( | ||
<Box sx={styles.placeholder}></Box> | ||
) | ||
} | ||
icon={first ? <NewIcon sx={styles.icon} /> : null} | ||
> | ||
<Text sx={styles.timelineTitle}>{title}</Text> | ||
<Text sx={styles.content}> | ||
{`${getDaysElapsed(date)} ${intl.formatMessage({ | ||
id: 'relese-note-days-elapsed', | ||
})}`} | ||
</Text> | ||
</Timeline.Event> | ||
</Flex> | ||
) | ||
} | ||
|
||
interface Props { | ||
announcements: CardProps[] | ||
} | ||
|
||
const AnnouncementCard = ({ announcements }: Props) => { | ||
const intl = useIntl() | ||
return ( | ||
<Link href={'/announcements'} legacyBehavior> | ||
<Flex sx={styles.cardContainer}> | ||
<Box> | ||
<Flex sx={styles.title}> | ||
<MegaphoneIcon /> | ||
<Text> | ||
{intl.formatMessage({ | ||
id: 'landing_page_announcements.title', | ||
})} | ||
</Text> | ||
</Flex> | ||
<Text sx={styles.description}> | ||
{intl.formatMessage({ | ||
id: 'landing_page_announcements.description', | ||
})} | ||
</Text> | ||
</Box> | ||
<Box sx={styles.timelineContainer}> | ||
{announcements.map((announcement, index) => { | ||
return index === 0 ? ( | ||
<AnnouncementTimelineItem | ||
key={index} | ||
{...{ ...announcement, first: true }} | ||
/> | ||
) : ( | ||
<AnnouncementTimelineItem key={index} {...announcement} /> | ||
) | ||
})} | ||
</Box> | ||
</Flex> | ||
</Link> | ||
) | ||
} | ||
|
||
export default AnnouncementCard |
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,123 @@ | ||
import { SxStyleProp } from '@vtex/brand-ui' | ||
|
||
const cardContainer: SxStyleProp = { | ||
mt: ['16px', '24px', '24px', '32px'], | ||
px: ['16px', '24px', '24px', '96px'], | ||
py: ['16px', '64px', '64px'], | ||
justifyContent: 'center', | ||
backgroundColor: 'white', | ||
borderRadius: '8px', | ||
border: '1px solid #E7E9EE', | ||
transition: 'all 0.3s ease-out', | ||
color: '#5E6E84', | ||
columnGap: '50px', | ||
rowGap: '64px', | ||
flexWrap: 'wrap', | ||
|
||
':active, :hover': { | ||
cursor: 'pointer', | ||
borderColor: '#CCCED8', | ||
transition: 'all 0.3s ease-out', | ||
}, | ||
|
||
':active': { | ||
boxShadow: '0px 0px 0px 1px #FFFFFF, 0px 0px 0px 3px #96B2F2', | ||
}, | ||
|
||
':hover': { | ||
boxShadow: '0px 0px 16px rgba(0, 0, 0, 0.1)', | ||
}, | ||
} | ||
|
||
const title: SxStyleProp = { | ||
fontSize: '22px', | ||
fontWeight: '400', | ||
lineHeight: '22px', | ||
gap: '10px', | ||
textAlign: 'top', | ||
} | ||
|
||
const description: SxStyleProp = { | ||
color: 'muted.1', | ||
fontSize: '16px', | ||
lineHeight: '22px', | ||
ml: '34px', | ||
mt: '4px', | ||
} | ||
|
||
const icon: SxStyleProp = { | ||
height: '18px', | ||
width: '18px', | ||
minWidth: '18px', | ||
minHeight: '18px', | ||
} | ||
|
||
const releaseContainer: SxStyleProp = { | ||
width: '100%', | ||
} | ||
|
||
const timelineContainer: SxStyleProp = { | ||
display: ['none', 'block', 'block', 'block', 'block', 'block'], | ||
} | ||
|
||
const timeLineBar: SxStyleProp = { | ||
'& > :first-of-type': { | ||
'& > :first-of-type': { | ||
'& > :first-of-type': { | ||
height: '16px', | ||
width: '16px', | ||
}, | ||
mb: '4px', | ||
}, | ||
'& > :nth-of-type(2)': { | ||
width: '1px', | ||
borderRadius: '0.5rem', | ||
}, | ||
mr: '8px', | ||
}, | ||
|
||
'& > :nth-of-type(2)': { | ||
padding: '0', | ||
'& > :nth-of-type(2)': { | ||
mt: '10px', | ||
}, | ||
}, | ||
} | ||
|
||
const timelineTitle: SxStyleProp = { | ||
fontSize: '18px', | ||
color: 'muted.0', | ||
} | ||
|
||
const content: SxStyleProp = { | ||
color: 'muted.1', | ||
fontSize: '16px', | ||
lineHeight: '22px', | ||
flexDirection: 'column', | ||
} | ||
|
||
const newTitle: SxStyleProp = { | ||
margin: '0', | ||
color: '#F71963', | ||
fontSize: '16px', | ||
lineHeight: '18px', | ||
} | ||
|
||
const placeholder: SxStyleProp = { | ||
height: '18px', | ||
width: '1px', | ||
} | ||
|
||
export default { | ||
cardContainer, | ||
title, | ||
description, | ||
icon, | ||
releaseContainer, | ||
timeLineBar, | ||
timelineTitle, | ||
newTitle, | ||
content, | ||
placeholder, | ||
timelineContainer, | ||
} |
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,59 @@ | ||
import { Box, Button, Flex, Text } from '@vtex/brand-ui' | ||
|
||
import { CardProps } from '../announcement-card' | ||
import { useIntl } from 'react-intl' | ||
|
||
import styles from './styles' | ||
import AnnouncementCard from '../announcement-card' | ||
|
||
const lastAnnouncements: CardProps[] = [ | ||
{ | ||
title: 'Black Week: VTEX Dashboards Analysis Strategies', | ||
description: 'Deprecation of [email protected]', | ||
date: new Date('03/02/2023'), | ||
}, | ||
{ | ||
title: 'Black Week: VTEX Dashboards Analysis Strategies', | ||
description: 'Deprecation of [email protected]', | ||
date: new Date('03/02/2023'), | ||
}, | ||
{ | ||
title: 'Black Week: VTEX Dashboards Analysis Strategies', | ||
description: 'Deprecation of [email protected]', | ||
date: new Date('03/02/2023'), | ||
}, | ||
{ | ||
title: 'Black Week: VTEX Dashboards Analysis Strategies', | ||
description: 'Deprecation of [email protected]', | ||
date: new Date('03/02/2023'), | ||
}, | ||
{ | ||
title: 'Black Week: VTEX Dashboards Analysis Strategies', | ||
description: 'Deprecation of [email protected]', | ||
date: new Date('03/02/2023'), | ||
}, | ||
] | ||
|
||
const AnnouncementSection = () => { | ||
const intl = useIntl() | ||
|
||
return ( | ||
<Flex sx={styles.sectionContainer}> | ||
<Flex> | ||
<Text sx={styles.title}> | ||
{intl.formatMessage({ | ||
id: 'landing_page_announcements.title', | ||
})} | ||
</Text> | ||
</Flex> | ||
<Box sx={styles.cardsContainer}> | ||
<AnnouncementCard announcements={lastAnnouncements} /> | ||
</Box> | ||
<Button sx={styles.button}> | ||
{intl.formatMessage({ id: 'landing_page_announcements.button' })} | ||
</Button> | ||
</Flex> | ||
) | ||
} | ||
|
||
export default AnnouncementSection |
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.