Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Jun 23, 2022
1 parent 9b77d29 commit 72003e7
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions website/src/theme/DocCategoryGeneratedIndexPage/index.tsx
Expand Up @@ -14,25 +14,31 @@ import type {Props} from '@theme/DocCategoryGeneratedIndexPage';

import styles from './styles.module.css';

function HintFooter() {
const docPath = useLayoutDoc('guides/docs/sidebar/items', undefined)?.path;
return (
<p className={styles.footerTip}>
<Translate
values={{
guideLink: (
<Link to={`${docPath}#category-link`}>
<Translate>the generated index page guide</Translate>
</Link>
),
}}>
{'Want to implement the same page? Read {guideLink} to find out!'}
</Translate>
</p>
);
}

export default function DocCategoryGeneratedIndexPageWrapper(
props: Props,
): JSX.Element {
const docPath = useLayoutDoc('guides/docs/sidebar/items', undefined)?.path;
return (
<>
<DocCategoryGeneratedIndexPage {...props} />
<p className={styles.footerTip}>
<Translate
values={{
guideLink: (
<Link to={`${docPath}#category-link`}>
<Translate>the generated index page guide</Translate>
</Link>
),
}}>
{'Want to implement the same page? Read {guideLink} to find out!'}
</Translate>
</p>
<HintFooter />
</>
);
}

0 comments on commit 72003e7

Please sign in to comment.