feat: markdown syntax highlighting

This commit is contained in:
iCrawl
2022-08-23 08:48:44 +02:00
parent 17559becef
commit c826ad3ade
8 changed files with 70 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
import { createStyles, Group, Text, NavLink, Box } from '@mantine/core';
import Link from 'next/link';
import { useRouter } from 'next/router';
import type { Dispatch, SetStateAction } from 'react';
import { type Dispatch, type SetStateAction, useEffect, useState } from 'react';
import {
VscSymbolClass,
VscSymbolEnum,
@@ -99,10 +99,13 @@ export function SidebarItems({
setOpened: Dispatch<SetStateAction<boolean>>;
}) {
const router = useRouter();
const [asPathWithoutQueryAndAnchor, setAsPathWithoutQueryAndAnchor] = useState('');
const { classes } = useStyles();
const groupItems = groupMembers(members);
const asPathWithoutQueryAndAnchor = router.asPath.split('?')[0]?.split('#')[0];
useEffect(() => {
setAsPathWithoutQueryAndAnchor(router.asPath.split('?')[0]?.split('#')[0] ?? '');
}, [router.asPath]);
return (
<Box pb="xl">