Skip to content

Commit

Permalink
feat: add dates to faq card
Browse files Browse the repository at this point in the history
  • Loading branch information
aliceoq committed Feb 9, 2024
1 parent e2a5298 commit 8f46090
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion src/components/faq-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ import type { FaqCardDataElement } from 'utils/typings/types'

import styles from './styles'
import Tag from 'components/tag'
import DateText from 'components/date-text'

const FaqCard = ({
title,
productTeam,
slug,
createdAt,
updatedAt,
}: FaqCardDataElement) => {
const createdAtDate = new Date(createdAt)
const updatedAtDate = new Date(updatedAt)

const FaqCard = ({ title, productTeam, slug }: FaqCardDataElement) => {
return (
<Link href={`faq/${slug}`}>
<Box sx={styles.container}>
Expand All @@ -15,6 +25,7 @@ const FaqCard = ({ title, productTeam, slug }: FaqCardDataElement) => {
<Text sx={styles.title} className="title">
{title}
</Text>
<DateText createdAt={createdAtDate} updatedAt={updatedAtDate} />
</Box>
</Link>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/faq-card/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { SxStyleProp } from '@vtex/brand-ui'

const container: SxStyleProp = {
px: ['32px', '64px'],
py: ['16px', '24px'],
px: ['32px', '32px', '36px', '64px'],
py: '24px',
display: 'flex',
flexDirection: 'column',
gap: '16px',
Expand Down

0 comments on commit 8f46090

Please sign in to comment.