Skip to content

Commit 1e21f14

Browse files
committed
fix: adjust height in OG image generation and replace SVG logo with LogoMark component
1 parent c5341ff commit 1e21f14

3 files changed

Lines changed: 5 additions & 33 deletions

File tree

app/og/docs/[...slug]/route.tsx

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { notFound } from "next/navigation";
22
import { ImageResponse } from "next/og";
33

4+
import { LogoMark } from "@/components/logo";
45
import { getPageImage, source } from "@/lib/source";
56

67
export const revalidate = false;
@@ -24,36 +25,7 @@ export const GET = async (
2425
<div tw="flex border absolute border-stone-700 inset-x-0 h-[1px] top-16" />
2526
<div tw="flex border absolute border-stone-700 inset-x-0 h-[1px] bottom-16" />
2627
<div tw="flex absolute flex-row bottom-24 right-24 text-white">
27-
<svg
28-
xmlns="http://www.w3.org/2000/svg"
29-
viewBox="0 0 256 256"
30-
width={48}
31-
height={48}
32-
>
33-
<rect width="256" height="256" fill="none" />
34-
<line
35-
x1="208"
36-
y1="128"
37-
x2="128"
38-
y2="208"
39-
fill="none"
40-
stroke="currentColor"
41-
stroke-linecap="round"
42-
stroke-linejoin="round"
43-
stroke-width="32"
44-
/>
45-
<line
46-
x1="192"
47-
y1="40"
48-
x2="40"
49-
y2="192"
50-
fill="none"
51-
stroke="currentColor"
52-
stroke-linecap="round"
53-
stroke-linejoin="round"
54-
stroke-width="32"
55-
/>
56-
</svg>
28+
<LogoMark width={48} height={48} />
5729
</div>
5830
<div tw="flex flex-col absolute w-[896px] justify-center inset-32">
5931
<div

app/og/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const GET = (request: Request) => {
4040
</div>
4141
</div>,
4242
{
43-
height: 628,
43+
height: 630,
4444
width: 1200,
4545
}
4646
);

hooks/use-copy-to-clipboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import * as React from "react";
3+
import { useState } from "react";
44

55
const legacyCopyToClipboard = (value: string) => {
66
const textArea = document.createElement("textarea");
@@ -33,7 +33,7 @@ export const useCopyToClipboard = ({
3333
timeout?: number;
3434
onCopy?: () => void;
3535
} = {}) => {
36-
const [isCopied, setIsCopied] = React.useState(false);
36+
const [isCopied, setIsCopied] = useState(false);
3737

3838
const copyToClipboard = async (value: string) => {
3939
if (typeof window === "undefined") {

0 commit comments

Comments
 (0)