-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevTools] create error state for indicator (#74717)
# Add Issue Count Indicator to Next.js Dev Tools Logo ### What? Adds a visual indicator showing the number of issues in the Next.js dev tools logo. The logo now displays a red circle with the issue count when there are active issues, and changes color to indicate error states. ![CleanShot 2025-01-09 at 18 19 35@2x](https://github.com/user-attachments/assets/c633843f-597f-4056-bb2a-1669765976eb) ### Why? Improves developer experience by providing immediate visual feedback about the presence and number of issues without requiring interaction with the dev tools panel. ### How? - Created a new `NextLogo` component with issue count display - Added Storybook stories to showcase different states (no issues, single issue, multiple issues) - Implemented dynamic styling based on issue count - Added a red circular badge that appears when issues are present - Updated the logo colors to reflect error states
- Loading branch information
Showing
5 changed files
with
370 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...xperimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { NextLogo } from './next-logo' | ||
|
||
const meta: Meta<typeof NextLogo> = { | ||
title: 'NextLogo', | ||
component: NextLogo, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
args: { | ||
onClick: () => alert('Clicked!'), | ||
}, | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof NextLogo> | ||
|
||
export const NoIssues: Story = { | ||
args: { | ||
issueCount: 0, | ||
}, | ||
} | ||
|
||
export const SingleIssue: Story = { | ||
args: { | ||
issueCount: 1, | ||
}, | ||
} | ||
|
||
export const MultipleIssues: Story = { | ||
args: { | ||
issueCount: 5, | ||
}, | ||
} | ||
|
||
export const ManyIssues: Story = { | ||
args: { | ||
issueCount: 99, | ||
}, | ||
} |
Oops, something went wrong.