diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/dev-tools-indicator.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/dev-tools-indicator.tsx index 994c392f2971a..0d06b39eeea36 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/dev-tools-indicator.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/dev-tools-indicator.tsx @@ -2,6 +2,7 @@ import type { VersionInfo } from '../../../../../../../../server/dev/parse-versi import type { ReadyRuntimeError } from '../../../helpers/get-error-by-type' import { Toast } from '../../Toast' import React, { useState } from 'react' +import { NextLogo } from './internal/next-logo' // TODO: test a11y // TODO: add E2E tests to cover different scenarios @@ -55,6 +56,7 @@ const DevToolsPopover = ({ return ( { ) } - -const NextLogo = (props: React.ComponentProps<'svg'>) => { - // TODO: animate it based on build status.. - // TODO: add red dot when there are errors + change color of the logo - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.stories.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.stories.tsx new file mode 100644 index 0000000000000..6b455a54c8e8c --- /dev/null +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.stories.tsx @@ -0,0 +1,40 @@ +import type { Meta, StoryObj } from '@storybook/react' +import { NextLogo } from './next-logo' + +const meta: Meta = { + title: 'NextLogo', + component: NextLogo, + parameters: { + layout: 'centered', + }, + args: { + onClick: () => alert('Clicked!'), + }, +} + +export default meta +type Story = StoryObj + +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, + }, +} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.tsx new file mode 100644 index 0000000000000..533b44315da83 --- /dev/null +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/internal/next-logo.tsx @@ -0,0 +1,300 @@ +interface Props extends React.ComponentProps<'svg'> { + issueCount: number + onClick: () => void +} + +export const NextLogo = ({ issueCount, onClick, ...props }: Props) => { + // TODO: animate it based on build status.. + // TODO: add red dot when there are errors + change color of the logo + return ( +
+ {/* Add issue count circle if issues exist */} + {issueCount > 0 ? ( +
+ {issueCount} +
+ ) : null} + + + + + 0 ? '#E5484D' : 'black'} + fillOpacity="0.8" + shapeRendering="crispEdges" + /> + + + + 0 ? '#CA2A30' : '#551A1E'} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ) +} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/styles.ts b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/styles.ts index 199a1ae6a1a90..47858102864b0 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/styles.ts +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/dev-tools-indicator/styles.ts @@ -6,8 +6,6 @@ export const styles = css` } [data-nextjs-dev-tools-button] { - height: 40px; - width: 40px; border: none; background: none; padding: 0; diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx index 46bc0feb0e824..a1d470c685178 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx @@ -31,29 +31,35 @@ export default function ReactDevOverlay({ children }: ReactDevOverlayProps) { {children ?? null} - {isMounted ? ( - - - - - + + + + + - {hasBuildError ? ( - - ) : hasRuntimeErrors ? ( - - ) : undefined} - - ) : undefined} + {hasBuildError ? ( + + ) : hasRuntimeErrors ? ( + + ) : ( + + )} + ) }