chore: update lastModified code

pull/26460/head^2
Nicolás Quiroz 2 years ago
parent ec7773916b
commit 37537d0520
  1. 8
      src/components/UI/downloads/DownloadsTable.tsx
  2. 11
      src/pages/[...slug].tsx

@ -45,7 +45,7 @@ export const DownloadsTable: FC<Props> = ({
if (/iPhone/i.test(OS)) return 3;
if (/Android/i.test(userAgent)) return 4;
return 0;
}, [])
}, []);
return (
<Stack
@ -56,7 +56,11 @@ export const DownloadsTable: FC<Props> = ({
: 'none'
}
>
<Tabs variant='unstyled' onChange={idx => setTotalReleases(totalReleases[idx])} defaultIndex={getDefaultIndex}>
<Tabs
variant='unstyled'
onChange={idx => setTotalReleases(totalReleases[idx])}
defaultIndex={getDefaultIndex}
>
<TabList color='primary' bg='button-bg'>
{DOWNLOADS_TABLE_TABS.map((tab, idx) => {
return (

@ -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 {

Loading…
Cancel
Save