Skip to content

Commit

Permalink
⬆️ Upgrade latest docs site UI libs
Browse files Browse the repository at this point in the history
the prism-react-renderer upgrade includes some breaking changes, so Fence.tsx and Hero.tsx have been updated to work with those changes as well
  • Loading branch information
acusti committed Jul 25, 2024
1 parent 00917fb commit 61df979
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 44 deletions.
9 changes: 2 additions & 7 deletions apps/site/app/components/Fence.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment } from "react";
import Highlight, { defaultProps, type Language } from "prism-react-renderer";
import { Highlight, type Language } from "prism-react-renderer";

export function Fence({
children,
Expand All @@ -9,12 +9,7 @@ export function Fence({
language: Language;
}) {
return (
<Highlight
{...defaultProps}
code={children.trimEnd()}
language={language}
theme={undefined}
>
<Highlight code={children.trimEnd()} language={language} theme={undefined}>
{({ className, style, tokens, getTokenProps }) => (
<pre className={className} style={style}>
<code>
Expand Down
3 changes: 1 addition & 2 deletions apps/site/app/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Fragment, useState } from "react";
import clsx from "clsx";
import Highlight, { defaultProps } from "prism-react-renderer";
import { Highlight } from "prism-react-renderer";

import { Button } from "~/components/Button";
import { HeroBackground } from "~/components/HeroBackground";
Expand Down Expand Up @@ -153,7 +153,6 @@ export function Hero() {
))}
</div>
<Highlight
{...defaultProps}
code={activeTab.code}
language={codeLanguage}
theme={undefined}
Expand Down
6 changes: 3 additions & 3 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"browserslist": "defaults, not ie <= 11",
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.3.4",
"@docsearch/react": "^3.2.1",
"@headlessui/react": "^1.7.11",
"@docsearch/react": "^3.6.1",
"@headlessui/react": "^2.1.2",
"@markdoc/markdoc": "0.4.0",
"@remix-run/cloudflare": "^2",
"@remix-run/react": "^2",
Expand All @@ -32,7 +32,7 @@
"js-yaml": "^4.1.0",
"postcss-focus-visible": "^6.0.4",
"postcss-import": "^14.1.0",
"prism-react-renderer": "^1.3.5",
"prism-react-renderer": "^2.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"superflare": "workspace:*",
Expand Down
Loading

0 comments on commit 61df979

Please sign in to comment.