Skip to content

Commit

Permalink
fix(article-pagination): update type of doc name
Browse files Browse the repository at this point in the history
  • Loading branch information
RobsonOlv committed Jan 11, 2024
1 parent ccfc081 commit f52f491
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions src/components/article-pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,25 @@ interface Props {
pagination: {
previousDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null
name: string | null
}
nextDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null
name: string | null
}
}
hidePaginationPrevious: boolean
hidePaginationNext: boolean
}

import styles from './styles'
import { useIntl } from 'react-intl'

const ArticlePagination = ({
pagination,
hidePaginationNext,
hidePaginationPrevious,
}: Props) => {
const router = useRouter()
const locale = useIntl().locale as 'en' | 'pt' | 'es'

const handleClick = (e: { preventDefault: () => void }, slug: string) => {
e.preventDefault()
Expand All @@ -43,7 +41,7 @@ const ArticlePagination = ({
>
<Box sx={styles.paginationBox}>
<Text sx={styles.paginationText}>
{pagination.previousDoc.name?.[locale]}
{pagination.previousDoc.name}
</Text>
<Text sx={styles.subTitle}>« Previous</Text>
</Box>
Expand All @@ -58,9 +56,7 @@ const ArticlePagination = ({
}}
>
<Box sx={styles.paginationBox}>
<Text sx={styles.paginationText}>
{pagination.nextDoc.name?.[locale]}
</Text>
<Text sx={styles.paginationText}>{pagination.nextDoc.name}</Text>
<Text sx={styles.subTitle}>Next »</Text>
</Box>
</Link>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/tracks/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ interface Props {
pagination: {
previousDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null | null
name: string | null
}
nextDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null | null
name: string | null
}
}
isListed: boolean
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/tutorial/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ interface Props {
pagination: {
previousDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null | null
name: string | null
}
nextDoc: {
slug: string | null
name: { en: string; pt: string; es: string } | null | null
name: string | null
}
}
isListed: boolean
Expand Down

0 comments on commit f52f491

Please sign in to comment.