From 37537d0520226476bcc2c2770cbfcd98298da9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Quiroz?= Date: Fri, 16 Dec 2022 16:07:30 -0300 Subject: [PATCH] chore: update lastModified code --- src/components/UI/downloads/DownloadsTable.tsx | 8 ++++++-- src/pages/[...slug].tsx | 11 ++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx index feb14bc9c4..c21e4865a4 100644 --- a/src/components/UI/downloads/DownloadsTable.tsx +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -45,7 +45,7 @@ export const DownloadsTable: FC = ({ if (/iPhone/i.test(OS)) return 3; if (/Android/i.test(userAgent)) return 4; return 0; - }, []) + }, []); return ( = ({ : 'none' } > - setTotalReleases(totalReleases[idx])} defaultIndex={getDefaultIndex}> + setTotalReleases(totalReleases[idx])} + defaultIndex={getDefaultIndex} + > {DOWNLOADS_TABLE_TABS.map((tab, idx) => { return ( diff --git a/src/pages/[...slug].tsx b/src/pages/[...slug].tsx index 7165047455..873891067d 100644 --- a/src/pages/[...slug].tsx +++ b/src/pages/[...slug].tsx @@ -11,16 +11,15 @@ import rehypeRaw from 'rehype-raw'; import { ParsedUrlQuery } from 'querystring'; import type { GetStaticPaths, GetStaticProps, NextPage } from 'next'; -import MDComponents from '../components/UI/docs'; -import { Breadcrumbs, DocsNav, DocumentNav } from '../components/UI/docs'; +import MDComponents, { Breadcrumbs, DocsNav, DocumentNav } from '../components/UI/docs'; import { PageMetadata } from '../components/UI'; -import { NavLink } from '../types'; - import { getFileList } from '../utils/getFileList'; +import { getLastModifiedDate, getParsedDate } from '../utils'; + +import { NavLink } from '../types'; import { textStyles } from '../theme/foundations'; -import { getLastModifiedDate, getParsedDate } from '../utils'; const MATTER_OPTIONS = { engines: { @@ -53,9 +52,7 @@ export const getStaticProps: GetStaticProps = async context => { file = fs.readFileSync(`${filePath}.md`, 'utf-8'); } - // get last commit on file date const lastModified = await getLastModifiedDate(filePath); - const { data: frontmatter, content } = matter(file, MATTER_OPTIONS); return {