-
Notifications
You must be signed in to change notification settings - Fork 445
feat: add examples app #597
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 issues found across 26 files
Prompt for AI agents (all 4 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/examples/components/ui/sidebar.tsx">
<violation number="1" location="apps/examples/components/ui/sidebar.tsx:369">
P2: Using `Math.random()` in `useMemo` will cause hydration mismatches because the value generated on the server differs from the client. Consider using `useId()` to generate a deterministic seed, or move the random calculation to a `useEffect` with state, or use a CSS-based solution for the varying widths.</violation>
</file>
<file name="apps/examples/components/header-actions.tsx">
<violation number="1" location="apps/examples/components/header-actions.tsx:31">
P2: Avatar fallback initials "CC" don't match the alt text "Luke Tracy". Consider using "LT" for consistency, or update the alt text to match the intended user.</violation>
</file>
<file name="apps/examples/components/nav-main.tsx">
<violation number="1" location="apps/examples/components/nav-main.tsx:156">
P2: Inconsistent use of Next.js `Link` vs plain `<a>` tags. The MenuPopup uses `<Link>` for client-side navigation, but this SidebarMenuSubButton uses a plain `<a>` tag which causes a full page reload. Use `<Link>` for consistent SPA navigation.</violation>
<violation number="2" location="apps/examples/components/nav-main.tsx:179">
P2: Use Next.js `Link` instead of plain `<a>` tag for consistent client-side navigation behavior.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| showIcon?: boolean; | ||
| }) { | ||
| // Random width between 50 to 90%. | ||
| const width = React.useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Using Math.random() in useMemo will cause hydration mismatches because the value generated on the server differs from the client. Consider using useId() to generate a deterministic seed, or move the random calculation to a useEffect with state, or use a CSS-based solution for the varying widths.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/examples/components/ui/sidebar.tsx, line 369:
<comment>Using `Math.random()` in `useMemo` will cause hydration mismatches because the value generated on the server differs from the client. Consider using `useId()` to generate a deterministic seed, or move the random calculation to a `useEffect` with state, or use a CSS-based solution for the varying widths.</comment>
<file context>
@@ -0,0 +1,475 @@
+ showIcon?: boolean;
+}) {
+ // Random width between 50 to 90%.
+ const width = React.useMemo(() => {
+ return `${Math.floor(Math.random() * 40) + 50}%`;
+ }, []);
</file context>
| alt="Luke Tracy" | ||
| src="https://pbs.twimg.com/profile_images/1994776674391457792/7utKOMi6_400x400.jpg" | ||
| /> | ||
| <AvatarFallback>CC</AvatarFallback> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Avatar fallback initials "CC" don't match the alt text "Luke Tracy". Consider using "LT" for consistency, or update the alt text to match the intended user.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/examples/components/header-actions.tsx, line 31:
<comment>Avatar fallback initials "CC" don't match the alt text "Luke Tracy". Consider using "LT" for consistency, or update the alt text to match the intended user.</comment>
<file context>
@@ -0,0 +1,39 @@
+ alt="Luke Tracy"
+ src="https://pbs.twimg.com/profile_images/1994776674391457792/7utKOMi6_400x400.jpg"
+ />
+ <AvatarFallback>CC</AvatarFallback>
+ </Avatar>
+ </Link>
</file context>
| className="font-medium text-sidebar-foreground" | ||
| isActive={item.isActive} | ||
| render={ | ||
| <a href={item.url}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Use Next.js Link instead of plain <a> tag for consistent client-side navigation behavior.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/examples/components/nav-main.tsx, line 179:
<comment>Use Next.js `Link` instead of plain `<a>` tag for consistent client-side navigation behavior.</comment>
<file context>
@@ -0,0 +1,209 @@
+ className="font-medium text-sidebar-foreground"
+ isActive={item.isActive}
+ render={
+ <a href={item.url}>
+ <item.icon />
+ <span className="md:max-lg:hidden lg:inline">{item.title}</span>
</file context>
| <SidebarMenuSubButton | ||
| className="from-secondary to-secondary/64 ps-8.5 hover:bg-transparent active:bg-transparent data-[active=true]:bg-linear-to-tr" | ||
| render={ | ||
| <a href={subItem.url}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Inconsistent use of Next.js Link vs plain <a> tags. The MenuPopup uses <Link> for client-side navigation, but this SidebarMenuSubButton uses a plain <a> tag which causes a full page reload. Use <Link> for consistent SPA navigation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/examples/components/nav-main.tsx, line 156:
<comment>Inconsistent use of Next.js `Link` vs plain `<a>` tags. The MenuPopup uses `<Link>` for client-side navigation, but this SidebarMenuSubButton uses a plain `<a>` tag which causes a full page reload. Use `<Link>` for consistent SPA navigation.</comment>
<file context>
@@ -0,0 +1,209 @@
+ <SidebarMenuSubButton
+ className="from-secondary to-secondary/64 ps-8.5 hover:bg-transparent active:bg-transparent data-[active=true]:bg-linear-to-tr"
+ render={
+ <a href={subItem.url}>
+ <span>{subItem.title}</span>
+ </a>
</file context>
Summary by cubic
Adds a new examples app that demonstrates a Cal.com-style shell using @coss/ui in Next.js. Includes a responsive sidebar, mobile header/footer, and an Event Types page.
New Features
Dependencies
Written for commit 09183f7. Summary will update automatically on new commits.