Skip to content

Commit

Permalink
fix(#83): side nav links (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabishnaqvi1311 authored Mar 10, 2024
1 parent 4b2bee1 commit 314325c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/components/doc-route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useDelegatedReactRouterLinks } from "./delegate-markdown-links";
import iconsHref from "~/icons.svg";
import { type loader as rootLoader } from "~/root";
import { type loader as langRefLoader } from "~/routes/$lang.$ref";
import { Link } from "react-router-dom";

export let loader = async ({ params, request }: LoaderFunctionArgs) => {
await whyDoWeNotHaveGoodMiddleWareYetRyan(request);
Expand Down Expand Up @@ -131,8 +132,8 @@ function LargeOnThisPage({ doc }: { doc: SerializeFrom<Doc> }) {
<ul>
{doc.headings.map((heading, i) => (
<li key={i}>
<a
href={`#${heading.slug}`}
<Link
to={`#${heading.slug}`}
dangerouslySetInnerHTML={{ __html: heading.html || "" }}
className="block py-1 text-sm text-gray-400 hover:text-gray-900 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand"
/>
Expand Down Expand Up @@ -160,8 +161,8 @@ function SmallOnThisPage({ doc }: { doc: SerializeFrom<Doc> }) {
<ul className="pl-9">
{doc.headings.map((heading, i) => (
<li key={i}>
<a
href={`#${heading.slug}`}
<Link
to={`#${heading.slug}`}
dangerouslySetInnerHTML={{ __html: heading.html || "" }}
className="block py-2 text-sm text-gray-400 hover:text-gray-900 active:text-red-brand dark:text-gray-400 dark:hover:text-gray-50 dark:active:text-red-brand"
/>
Expand Down

0 comments on commit 314325c

Please sign in to comment.