Skip to content

Commit 28d820a

Browse files
committed
Revert "Update React Doctor branding assets and README theme-aware logo (#11)"
This reverts commit 2d2f779.
1 parent 2d2f779 commit 28d820a

File tree

12 files changed

+75
-181
lines changed

12 files changed

+75
-181
lines changed

assets/react-doctor-readme-logo-dark.svg

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

assets/react-doctor-readme-logo-light.svg

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

packages/react-doctor/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="./assets/react-doctor-readme-logo-dark.svg">
3-
<source media="(prefers-color-scheme: light)" srcset="./assets/react-doctor-readme-logo-light.svg">
4-
<img alt="React Doctor" src="./assets/react-doctor-readme-logo-light.svg" width="180" height="40">
5-
</picture>
1+
# <img src="https://github.com/millionco/react-doctor/blob/main/.github/public/logo.svg?raw=true" width="60" align="center" /> React Doctor
62

73
[![version](https://img.shields.io/npm/v/react-doctor?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/react-doctor)
84
[![downloads](https://img.shields.io/npm/dt/react-doctor.svg?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/react-doctor)

packages/react-doctor/assets/react-doctor-readme-logo-dark.svg

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

packages/react-doctor/assets/react-doctor-readme-logo-light.svg

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

packages/website/public/react-doctor-icon.svg

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

packages/website/public/react-doctor-og-banner.svg

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

packages/website/src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ibmPlexMono = IBM_Plex_Mono({
1111
export const metadata: Metadata = {
1212
title: "React Doctor",
1313
description: "Let coding agents diagnose and fix your React code.",
14-
icons: { icon: "/react-doctor-icon.svg" },
14+
icons: { icon: "/favicon.svg" },
1515
};
1616

1717
export default function RootLayout({

packages/website/src/app/share/og/route.tsx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ const SCORE_GOOD_THRESHOLD = 75;
55
const SCORE_OK_THRESHOLD = 50;
66
const IMAGE_WIDTH_PX = 1200;
77
const IMAGE_HEIGHT_PX = 630;
8-
const OG_BRAND_MARK_WIDTH_PX = 244;
9-
const OG_BRAND_MARK_HEIGHT_PX = 82;
10-
const OG_BRAND_MARK_PATH = "/react-doctor-og-banner.svg";
118

129
const getScoreLabel = (score: number): string => {
1310
if (score >= SCORE_GOOD_THRESHOLD) return "Great";
@@ -21,6 +18,12 @@ const getScoreColor = (score: number): string => {
2118
return "#f87171";
2219
};
2320

21+
const getDoctorFace = (score: number): [string, string] => {
22+
if (score >= SCORE_GOOD_THRESHOLD) return ["^ ^", "v"];
23+
if (score >= SCORE_OK_THRESHOLD) return ["o o", "-"];
24+
return ["x x", "v"];
25+
};
26+
2427
export const GET = (request: Request): ImageResponse => {
2528
const { searchParams } = new URL(request.url);
2629

@@ -30,7 +33,7 @@ export const GET = (request: Request): ImageResponse => {
3033
const warningCount = Math.max(0, Number(searchParams.get("w")) || 0);
3134
const fileCount = Math.max(0, Number(searchParams.get("f")) || 0);
3235
const scoreColor = getScoreColor(score);
33-
const brandMarkUrl = new URL(OG_BRAND_MARK_PATH, request.url).toString();
36+
const [eyes, mouth] = getDoctorFace(score);
3437
const scoreBarPercent = (score / PERFECT_SCORE) * 100;
3538

3639
return new ImageResponse(
@@ -47,7 +50,26 @@ export const GET = (request: Request): ImageResponse => {
4750
}}
4851
>
4952
<div style={{ display: "flex", alignItems: "center", gap: "24px" }}>
50-
<img src={brandMarkUrl} width={OG_BRAND_MARK_WIDTH_PX} height={OG_BRAND_MARK_HEIGHT_PX} />
53+
<div
54+
style={{
55+
display: "flex",
56+
flexDirection: "column",
57+
alignItems: "center",
58+
justifyContent: "center",
59+
width: "80px",
60+
height: "80px",
61+
border: `2px solid ${scoreColor}`,
62+
borderRadius: "12px",
63+
color: scoreColor,
64+
}}
65+
>
66+
<div style={{ fontSize: "22px", lineHeight: 1 }}>{eyes}</div>
67+
<div style={{ fontSize: "18px", lineHeight: 1, marginTop: "2px" }}>{mouth}</div>
68+
</div>
69+
<div style={{ display: "flex", flexDirection: "column" }}>
70+
<span style={{ fontSize: "28px", color: "#d4d4d4" }}>React Doctor</span>
71+
<span style={{ fontSize: "18px", color: "#525252" }}>www.react.doctor</span>
72+
</div>
5173
{projectName && (
5274
<div
5375
style={{

packages/website/src/app/share/page.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Metadata } from "next";
22
import AnimatedScore from "./animated-score";
3-
import ReactDoctorIcon from "@/components/react-doctor-icon";
43

54
const PERFECT_SCORE = 100;
65
const SCORE_GOOD_THRESHOLD = 75;
@@ -10,7 +9,6 @@ const FIX_COMMAND = "npx -y react-doctor@latest . --fix";
109
const SHARE_BASE_URL = "https://www.react.doctor/share";
1110
const AMI_DEEPLINK =
1211
"ami://new-chat?prompt=Run%20%60npx%20-y%20react-doctor%40latest%20.%60%20to%20diagnose%20issues%2C%20then%20fix%20all%20reported%20issues%20one%20by%20one.%20After%20applying%20fixes%2C%20run%20it%20again%20to%20verify%20the%20results%20improved.&mode=agent&autoSubmit=true";
13-
const SHARE_ICON_SIZE_PX = 40;
1412
const X_ICON_PATH =
1513
"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z";
1614
const LINKEDIN_ICON_PATH =
@@ -32,6 +30,29 @@ const getScoreLabel = (score: number): string => {
3230
return "Critical";
3331
};
3432

33+
const getScoreColorClass = (score: number): string => {
34+
if (score >= SCORE_GOOD_THRESHOLD) return "text-green-400";
35+
if (score >= SCORE_OK_THRESHOLD) return "text-yellow-500";
36+
return "text-red-400";
37+
};
38+
39+
const getDoctorFace = (score: number): [string, string] => {
40+
if (score >= SCORE_GOOD_THRESHOLD) return ["\u25E0 \u25E0", " \u25BD "];
41+
if (score >= SCORE_OK_THRESHOLD) return ["\u2022 \u2022", " \u2500 "];
42+
return ["x x", " \u25BD "];
43+
};
44+
45+
const DoctorFace = ({ score }: { score: number }) => {
46+
const [eyes, mouth] = getDoctorFace(score);
47+
const colorClass = getScoreColorClass(score);
48+
49+
return (
50+
<pre className={`${colorClass} leading-tight`}>
51+
{` \u250C\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 ${eyes} \u2502\n \u2502 ${mouth} \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2518`}
52+
</pre>
53+
);
54+
};
55+
3556
export const generateMetadata = async ({
3657
searchParams,
3758
}: {
@@ -97,7 +118,7 @@ const SharePage = async ({ searchParams }: { searchParams: Promise<ShareSearchPa
97118
<div className="mx-auto min-h-screen w-full max-w-3xl bg-[#0a0a0a] p-6 pb-32 font-mono text-base leading-relaxed text-neutral-300 sm:p-8 sm:pb-40 sm:text-lg">
98119
<div className="mb-6">
99120
{projectName && <div className="mb-4 text-xl text-white">{projectName}</div>}
100-
<ReactDoctorIcon sizePx={SHARE_ICON_SIZE_PX} />
121+
<DoctorFace score={score} />
101122
<div className="mt-2 text-neutral-500">
102123
React Doctor <span className="text-neutral-600">(www.react.doctor)</span>
103124
</div>

0 commit comments

Comments
 (0)