Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(devtools/doctor): highlighted quick start #5421

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ const Handler: FC<ErrorFallbackProps> = () => {
const isStateError =
error && typeof error === 'object' && Object.keys(error).length === 0;
if (isStateError) {
const websiteDisplay = parseURL(def.doctor.website).host;
const websiteDisplay = parseURL(def.doctor.quickStart).host;
const websiteLink = (
<Link href={def.doctor.website} target="_blank" rel="noopener noreferrer">
<Link
href={def.doctor.quickStart}
target="_blank"
rel="noopener noreferrer"
>
🔗{websiteDisplay}
</Link>
);
Expand Down
22 changes: 16 additions & 6 deletions packages/devtools/client/src/entries/client/routes/doctor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const Page: FC = () => {
key.startsWith('@web-doctor/'),
);
const implementation = isWebDoctor ? 'Web Doctor' : 'Rsdoctor';
const { website } = def.doctor;
const version =
dependencies['@web-doctor/webpack-plugin(builder)'] ??
dependencies['@web-doctor/rspack-plugin(builder)'] ??
Expand Down Expand Up @@ -131,9 +130,16 @@ const Page: FC = () => {
{version ? `v${version}` : 'Unknown'}
</button>
</Flex>
<Text as="p" color="gray" size="1">
Click to open panel with complete features.
</Text>
<Link
href={def.doctor.quickStart}
color="gray"
size="1"
underline="always"
target="_blank"
rel="noopener noreferrer"
>
Launch {implementation} with complete features.
</Link>
</IndicateCard.Column>
</Theme>
</IndicateCard>
Expand All @@ -142,9 +148,13 @@ const Page: FC = () => {
<Box>
<Text color="gray">Visit our website</Text>
<Flex align="center" asChild>
<Link href={website} target="_blank" rel="noopener noreferrer">
<Link
href={def.doctor.home}
target="_blank"
rel="noopener noreferrer"
>
<HiLink />
<Text>{parseURL(website).host}</Text>
<Text>{parseURL(def.doctor.home).host}</Text>
</Link>
</Flex>
</Box>
Expand Down
5 changes: 2 additions & 3 deletions packages/devtools/client/src/entries/client/routes/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import {
HiOutlineCube,
HiOutlineHome,
HiOutlineRectangleGroup,
HiMagnifyingGlass,
} from 'react-icons/hi2';
import { RiReactjsLine } from 'react-icons/ri';
import { RiReactjsLine, RiShieldCrossLine } from 'react-icons/ri';
import { stringifyParsedURL } from 'ufo';
import { proxy, ref } from 'valtio';
import { InternalTab } from '../types';
Expand Down Expand Up @@ -138,7 +137,7 @@ export const $tabs = proxy<InternalTab[]>([
{
name: 'doctor',
title: 'Doctor',
icon: ref(<HiMagnifyingGlass />),
icon: ref(<RiShieldCrossLine />),
view: { type: 'builtin', url: '/doctor' },
},
]);
Expand Down
4 changes: 3 additions & 1 deletion packages/devtools/kit/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export class AnnouncementDefinition {
}

export class DoctorDefinition {
website: string = 'https://rsdoctor.dev';
home: string = 'https://rsdoctor.dev';

quickStart: string = 'https://rsdoctor.dev/guide/start/quick-start';
}

export class ClientDefinition {
Expand Down
Loading