diff --git a/src/components/tutorial-markdown-render/index.tsx b/src/components/tutorial-markdown-render/index.tsx index bce5f2f3..69ecc528 100644 --- a/src/components/tutorial-markdown-render/index.tsx +++ b/src/components/tutorial-markdown-render/index.tsx @@ -30,11 +30,7 @@ interface Props { title: string category: string }[] - // sectionSelected: string - // sidebarfallback: any //eslint-disable-line slug: string - // parentsArray: string[] - // path: string isListed: boolean branch: string pagination: { @@ -50,6 +46,7 @@ interface Props { breadcrumbList: { slug: string; name: string; type: string }[] headings: Item[] } + const TutorialMarkdownRender = (props: Props) => { const intl = useIntl() @@ -90,11 +87,16 @@ const TutorialMarkdownRender = (props: Props) => { {props.serialized.frontmatter?.title} + {/* Adiciona a propriedade justifyContent ao Flex para alinhar o botão à direita */} + + + {props.serialized.frontmatter?.excerpt} - {props.serialized.frontmatter?.readingTime && ( = ({ -
-
- - - {serialized.frontmatter?.title} - - - - - - {createdAtDate && updatedAtDate && ( - - - - )} - - - -
- -
@@ -150,6 +126,7 @@ const AnnouncementPage: NextPage = ({ createdAt={createdAtDate} updatedAt={updatedAtDate} /> + )} diff --git a/src/pages/docs/tracks/[slug].tsx b/src/pages/docs/tracks/[slug].tsx index 6be0b5e9..f39ec71f 100644 --- a/src/pages/docs/tracks/[slug].tsx +++ b/src/pages/docs/tracks/[slug].tsx @@ -46,11 +46,11 @@ import { import { MarkdownRenderer } from '@vtexdocs/components' import { remarkReadingTime } from 'utils/remark_plugins/remarkReadingTime' -import CopyLinkButton from 'components/copy-link-button' import theme from 'styles/code-hike-theme' import TimeToRead from 'components/TimeToRead' import { getBreadcrumbsList } from 'utils/getBreadcrumbsList' +import CopyLinkButton from 'components/copy-link-button' const docsPathsGLOBAL = await getTracksPaths('tracks') @@ -140,7 +140,15 @@ const TrackPage: NextPage = ({ minutes={serialized.frontmatter.readingTime} /> )} - + {/* Adiciona a propriedade justifyContent ao Flex para alinhar o botão à direita */} + + +
@@ -211,12 +219,6 @@ export const getServerSideProps: GetServerSideProps = async ({ } } - // let documentationContent = await getGithubFile( - // 'vtexdocs', - // 'help-center-content', - // branch, - // path - // ) let documentationContent = (await fetch( `https://raw.githubusercontent.com/vtexdocs/help-center-content/${branch}/${path}` @@ -238,7 +240,6 @@ export const getServerSideProps: GetServerSideProps = async ({ .then((res) => res.json()) .then(({ users }) => { const result: ContributorsType[] = [] - // eslint-disable-next-line @typescript-eslint/no-explicit-any for (let i = 0; i < users.length; i++) { const user = users[i] if (user.id === '41898282') continue @@ -254,17 +255,6 @@ export const getServerSideProps: GetServerSideProps = async ({ }) .catch((err) => console.log(err))) || [] - // const contributors = [] - // const contributors = - // (await getFileContributors( - // 'vtexdocs', - // 'help-center-content', - // branch, - // path - // ).catch((err) => { - // console.log(err) - // })) || [] - let format: 'md' | 'mdx' = 'mdx' try { if (path.endsWith('.md')) { @@ -298,7 +288,6 @@ export const getServerSideProps: GetServerSideProps = async ({ }, }) - // Check the frontmatter status if (serialized.frontmatter?.status !== 'PUBLISHED') { return { notFound: true, @@ -331,13 +320,6 @@ export const getServerSideProps: GetServerSideProps = async ({ .then((res) => res.text()) .catch((err) => console.log(err))) || '' - // const documentationContent = await getGithubFile( - // 'vtexdocs', - // 'help-center-content',W - // 'main', - // seeAlsoPath - // ) - const serialized = await serialize(documentationContent, { parseFrontmatter: true, }) diff --git a/src/pages/faq/[slug].tsx b/src/pages/faq/[slug].tsx index 3e6d1ba5..950d732e 100644 --- a/src/pages/faq/[slug].tsx +++ b/src/pages/faq/[slug].tsx @@ -25,7 +25,6 @@ import TimeToRead from 'components/TimeToRead' import getHeadings from 'utils/getHeadings' import getNavigation from 'utils/getNavigation' -// import getGithubFile from 'utils/getGithubFile' import escapeCurlyBraces from 'utils/escapeCurlyBraces' import replaceHTMLBlocks from 'utils/replaceHTMLBlocks' import { PreviewContext } from 'utils/contexts/preview' @@ -36,7 +35,6 @@ import { ContributorsType } from 'utils/getFileContributors' import { getLogger } from 'utils/logging/log-util' import { localeType } from 'utils/navigation-utils' import { MarkdownRenderer } from '@vtexdocs/components' -// import { ParsedUrlQuery } from 'querystring' import { remarkReadingTime } from 'utils/remark_plugins/remarkReadingTime' import { getDocsPaths as getFaqPaths } from 'utils/getDocsPaths' import { getMessages } from 'utils/get-messages' @@ -57,8 +55,6 @@ interface Props { } const FaqPage: NextPage = ({ - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - //@ts-ignore serialized, headingList, contributors, @@ -114,13 +110,27 @@ const FaqPage: NextPage = ({ minutes={serialized.frontmatter.readingTime} /> )} + + {/* Verifica se as datas de criação e atualização estão disponíveis */} {createdAtDate && updatedAtDate && ( - + + + + {/* Coloca o botão à direita das datas */} + + + + )} - diff --git a/src/pages/known-issues/[slug].tsx b/src/pages/known-issues/[slug].tsx index c3ad3a35..c9909d1e 100644 --- a/src/pages/known-issues/[slug].tsx +++ b/src/pages/known-issues/[slug].tsx @@ -10,7 +10,6 @@ import hljsCurl from 'highlightjs-curl' import remarkBlockquote from 'utils/remark_plugins/rehypeBlockquote' import { remarkCodeHike } from '@code-hike/mdx' import theme from 'styles/code-hike-theme' - import remarkImages from 'utils/remark_plugins/plaiceholder' import { Box, Flex, Text } from '@vtex/brand-ui' @@ -117,7 +116,6 @@ const KnownIssuePage: NextPage = ({ minutes={serialized.frontmatter.readingTime} /> )} - @@ -127,11 +125,26 @@ const KnownIssuePage: NextPage = ({ {serialized.frontmatter?.kiStatus} + + {/* Reorganizado para colocar o botão após as datas */} {createdAtDate && updatedAtDate && ( - + + + {/* Adicionando o botão à direita das datas */} + + + + )} diff --git a/src/pages/troubleshooting/[slug].tsx b/src/pages/troubleshooting/[slug].tsx index bf01db0e..03ab2e93 100644 --- a/src/pages/troubleshooting/[slug].tsx +++ b/src/pages/troubleshooting/[slug].tsx @@ -101,13 +101,26 @@ const TroubleshootingPage: NextPage = ({ (serialized.frontmatter?.readingTime as string) ?? 0 } /> + + {/* Reorganizado para colocar o botão após as datas */} {createdAtDate && updatedAtDate && ( - + + + + + + )} -