Merge pull request #54 from ethereum/remove-breadcrumbs-param

chore: removes non-required param
This commit is contained in:
Corwin Smith 2022-11-28 06:31:02 +01:00 committed by GitHub
commit 4ac6c56177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 14 deletions

View File

@ -1,12 +1,11 @@
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink } from '@chakra-ui/react';
import NextLink from 'next/link';
import { useRouter } from 'next/router';
import { FC } from 'react';
interface Props {
router: any;
}
export const Breadcrumbs: FC = () => {
const router = useRouter();
export const Breadcrumbs: FC<Props> = ({ router }) => {
let pathSplit = router.asPath.split('/');
pathSplit = pathSplit.splice(1, pathSplit.length);

View File

@ -6,12 +6,10 @@ import { Heading, Stack } from '@chakra-ui/react';
import MDXComponents from '../components/';
import { ParsedUrlQuery } from 'querystring';
import type { GetStaticPaths, GetStaticProps, NextPage } from 'next';
import { useRouter } from 'next/router';
import { Breadcrumbs } from '../components/docs'
import { Breadcrumbs } from '../components/docs';
import { PageMetadata } from '../components/UI';
const MATTER_OPTIONS = {
engines: {
yaml: (s: any) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object
@ -73,18 +71,13 @@ interface Props {
}
const DocPage: NextPage<Props> = ({ frontmatter, content }) => {
const router = useRouter()
return (
<>
<PageMetadata
title={frontmatter.title}
description={frontmatter.description}
/>
<PageMetadata title={frontmatter.title} description={frontmatter.description} />
<main>
<Stack py={8} px={4}>
<Breadcrumbs router={router} />
<Breadcrumbs />
<Heading as='h1'>{frontmatter.title}</Heading>