Skip to content

Commit f0f5333

Browse files
authored
Merge branch 'main' into fix-frameworks-icon-not-displaying
2 parents 0063f3a + 040e478 commit f0f5333

File tree

67 files changed

+1009
-1412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1009
-1412
lines changed

.changeset/eight-poems-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
Added nebula service scope

.changeset/nice-gifts-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Adds ox for internal utilities

.changeset/serious-plants-play.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
fix enclave transaction signing for transactions with 0 maxPriorityFeePerGas

.github/workflows/linear.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
1919
echo "Pull Request Body: $pr_body"
2020
21-
if echo "$pr_body" | grep -iE "CNCT|DASH"; then
21+
if echo "$pr_body" | grep -iE "CNCT|DASH|BLOCK"; then
2222
echo "Linked issue found in the pull request body."
2323
else
2424
echo "No linked issue found in the pull request body."

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
},
2525
"[javascript]": {
2626
"editor.defaultFormatter": "biomejs.biome"
27+
},
28+
"[css]": {
29+
"editor.defaultFormatter": "biomejs.biome"
2730
}
2831
}

apps/dashboard/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@
7878
"papaparse": "^5.4.1",
7979
"pluralize": "^8.0.0",
8080
"posthog-js": "1.67.1",
81-
"prism-react-renderer": "^2.3.1",
82-
"prismjs": "^1.29.0",
8381
"qrcode": "^1.5.3",
8482
"react": "19.0.0-rc-69d4b800-20241021",
8583
"react-children-utilities": "^2.10.0",
@@ -94,6 +92,7 @@
9492
"recharts": "^2.13.3",
9593
"remark-gfm": "^4.0.0",
9694
"server-only": "^0.0.1",
95+
"shiki": "1.22.2",
9796
"sonner": "^1.7.0",
9897
"spdx-correct": "^3.2.0",
9998
"swagger-ui-react": "^5.17.14",

apps/dashboard/src/@/components/ui/CodeBlock.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

apps/dashboard/src/@/components/ui/code.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { ScrollShadow } from "@/components/ui/ScrollShadow/ScrollShadow";
2+
import { Button } from "@/components/ui/button";
3+
import { ToolTipLabel } from "@/components/ui/tooltip";
4+
import { cn } from "@/lib/utils";
5+
import { CheckIcon, CopyIcon } from "lucide-react";
6+
import { useState } from "react";
7+
8+
export function RenderCode(props: {
9+
code: string;
10+
html: string;
11+
className?: string;
12+
scrollableClassName?: string;
13+
}) {
14+
return (
15+
<div
16+
className={cn(
17+
"group relative max-w-full overflow-hidden rounded-lg border border-border bg-background",
18+
props.className,
19+
)}
20+
>
21+
<ScrollShadow
22+
scrollableClassName={cn("p-4", props.scrollableClassName)}
23+
className="text-xs md:text-sm [&_*]:leading-relaxed"
24+
shadowColor="hsl(var(--muted))"
25+
>
26+
<div
27+
// biome-ignore lint/security/noDangerouslySetInnerHtml: we know what we're doing here
28+
dangerouslySetInnerHTML={{ __html: props.html }}
29+
/>
30+
</ScrollShadow>
31+
<CopyButton
32+
text={props.code}
33+
iconClassName="size-3"
34+
className="absolute top-4 right-4 z-10 border border-border bg-background p-2 opacity-0 transition-opacity duration-300 group-hover:opacity-100"
35+
/>
36+
</div>
37+
);
38+
}
39+
40+
function CopyButton(props: {
41+
text: string;
42+
className?: string;
43+
iconClassName?: string;
44+
}) {
45+
const [isCopied, setIsCopied] = useState(false);
46+
return (
47+
<ToolTipLabel label="Copy">
48+
<Button
49+
variant="ghost"
50+
aria-label="Copy"
51+
className={cn("h-auto w-auto p-1", props.className)}
52+
onClick={() => {
53+
navigator.clipboard.writeText(props.text);
54+
setIsCopied(true);
55+
setTimeout(() => setIsCopied(false), 1000);
56+
}}
57+
>
58+
{isCopied ? (
59+
<CheckIcon
60+
className={cn("size-4 text-green-500", props.iconClassName)}
61+
/>
62+
) : (
63+
<CopyIcon
64+
className={cn("size-4 text-muted-foreground", props.iconClassName)}
65+
/>
66+
)}
67+
</Button>
68+
</ToolTipLabel>
69+
);
70+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"use client";
2+
3+
import { cn } from "@/lib/utils";
4+
import { keepPreviousData, useQuery } from "@tanstack/react-query";
5+
import type { BundledLanguage } from "shiki";
6+
import { Spinner } from "../../ui/Spinner/Spinner";
7+
import { RenderCode } from "./RenderCode";
8+
import { getCodeHtml } from "./getCodeHtml";
9+
10+
export type CodeProps = {
11+
code: string;
12+
lang: BundledLanguage;
13+
className?: string;
14+
scrollableClassName?: string;
15+
loadingClassName?: string;
16+
keepPreviousDataOnCodeChange?: boolean;
17+
};
18+
19+
export const CodeClient: React.FC<CodeProps> = ({
20+
code,
21+
lang,
22+
className,
23+
scrollableClassName,
24+
loadingClassName,
25+
keepPreviousDataOnCodeChange = false,
26+
}) => {
27+
const codeQuery = useQuery({
28+
queryKey: ["html", code],
29+
queryFn: () => getCodeHtml(code, lang),
30+
placeholderData: keepPreviousDataOnCodeChange
31+
? keepPreviousData
32+
: undefined,
33+
retry: false,
34+
});
35+
36+
if (!codeQuery.data) {
37+
return (
38+
<div
39+
className={cn(
40+
"flex min-h-[200px] items-center justify-center rounded-lg border border-border",
41+
loadingClassName,
42+
)}
43+
>
44+
<Spinner className="size-8" />
45+
</div>
46+
);
47+
}
48+
49+
return (
50+
<RenderCode
51+
code={codeQuery.data.formattedCode}
52+
html={codeQuery.data.html}
53+
className={className}
54+
scrollableClassName={scrollableClassName}
55+
/>
56+
);
57+
};

0 commit comments

Comments
 (0)