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(docs): nextUI pro callout #4391

Merged
merged 4 commits into from
Dec 19, 2024
Merged

feat(docs): nextUI pro callout #4391

merged 4 commits into from
Dec 19, 2024

Conversation

macci001
Copy link
Contributor

@macci001 macci001 commented Dec 18, 2024

Closes ENG-1735

📝 Description

PR adds a callout for NextUI pro.

🚀 New behavior

  • Screenshot 2024-12-18 at 10 58 17 PM
  • Screenshot 2024-12-18 at 10 58 26 PM

💣 Is this a breaking change (Yes/No): No

Summary by CodeRabbit

  • New Features

    • Introduced a new promotional banner component encouraging users to explore NextUI Pro components.
    • Adjusted the layout of the table of contents for improved visibility and space allocation.
  • Bug Fixes

    • Enhanced the conditional rendering of the table of contents based on the visibility of the Pro Banner.

Copy link

linear bot commented Dec 18, 2024

Copy link

changeset-bot bot commented Dec 18, 2024

⚠️ No Changeset found

Latest commit: 281f6b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 0:32am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 0:32am

Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces modifications to the documentation components in the NextUI project. A new NextUIProCallout component has been added to promote NextUI Pro components, and the DocsToc component has been updated with layout adjustments. The changes primarily focus on improving the user interface and adding promotional elements to the documentation site, with no significant alterations to the core functionality of the existing components.

Changes

File Change Summary
apps/docs/components/docs/toc.tsx - Modified container height from h-[calc(100vh-121px)] to max-h-[calc(100vh-500px)]
- Added conditional top positioning classes
- Integrated NextUIProCallout component
apps/docs/components/docs/nextui-pro-callout.tsx - New component created
- Implements PostHog tracking for user interactions
- Renders a promotional banner for NextUI Pro components

Suggested reviewers

  • wingkwong

  • feat(docs): nextUI pro callout #4391: This PR directly relates to the main PR as it introduces the NextUIProCallout component, which is also mentioned in the main PR's summary. Both PRs involve modifications to the DocsToc component and the addition of the NextUIProCallout component, indicating a strong connection in terms of functionality and code changes.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1be11b2 and 281f6b9.

📒 Files selected for processing (1)
  • apps/docs/components/docs/nextui-pro-callout.tsx (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/docs/components/docs/toc.tsx (1)

138-166: Consider accessibility improvements for the promotional banner

While the implementation is functional, consider these accessibility enhancements:

  1. Add appropriate ARIA attributes for better screen reader support
  2. Ensure keyboard navigation works correctly with the animated button
  3. Consider adding aria-label to describe the promotional content

Here's a suggested improvement:

 <div className="w-full border border-default/60 hover:shadow-inner hover:border-default/80 rounded-md p-2 cursor-pointer">
   <a
     className="flex flex-col items-center"
     href="https://nextui.pro?utm_source=nextui.org&utm_medium=callout"
     rel="noopener noreferrer"
+    aria-label="Explore NextUI Pro components"
     onClick={handleClick}
   >
     {/* ... content ... */}
     <div className="flex group min-w-[120px] items-center font-semibold text-foreground shadow-sm gap-1.5 relative overflow-hidden rounded-full p-[1px]">
       <span className="absolute inset-[-1000%] animate-[spin_3s_linear_infinite] bg-[conic-gradient(from_90deg_at_50%_50%,#F54180_0%,#338EF7_50%,#F54180_100%)]" />
-      <div className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-background group-hover:bg-background/70 transition-background px-3 py-1 text-sm font-medium text-foreground backdrop-blur-3xl">
+      <div 
+        className="inline-flex h-full w-full cursor-pointer items-center justify-center rounded-full bg-background group-hover:bg-background/70 transition-background px-3 py-1 text-sm font-medium text-foreground backdrop-blur-3xl"
+        role="button"
+        tabIndex={0}
+      >
         Explore Components
       </div>
     </div>
   </a>
 </div>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9a55d0 and 52018cd.

📒 Files selected for processing (2)
  • apps/docs/components/docs/toc.tsx (3 hunks)
  • apps/docs/components/primitives.ts (1 hunks)
🔇 Additional comments (3)
apps/docs/components/primitives.ts (1)

20-20: LGTM: New size variant follows existing patterns

The new xs size variant is well-implemented, following the established responsive design pattern and maintaining consistency with existing size variants.

apps/docs/components/docs/toc.tsx (2)

8-8: LGTM: Analytics implementation follows best practices

The PostHog integration is well-implemented with appropriate event naming and categorization. The click tracking is focused on the specific user interaction without collecting sensitive data.

Also applies to: 70-77


145-155: LGTM: Responsive design implementation is well-structured

The mobile-first approach with flex direction changes at breakpoints is well-implemented. The usage of the new xs title variant maintains consistency across different screen sizes.

@wingkwong wingkwong changed the title Adding NextUI pro callout feat(docs): nextUI pro callout Dec 18, 2024
@wingkwong wingkwong added the 📋 Scope : Docs Related to the documentation label Dec 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
apps/docs/components/docs/nextui-pro-callout.tsx (2)

5-7: Consider adding TypeScript types

The component structure looks good, but adding TypeScript types would improve maintainability and type safety.

-export const NextUIProCallout = () => {
+export const NextUIProCallout: React.FC = () => {

8-13: Add error handling for analytics tracking

While the click handler is well-structured, it should handle potential PostHog failures gracefully.

 const handleClick = () => {
-  posthog.capture("NextUI Pro Banner", {
-    action: "click",
-    category: "nextui-callout",
-  });
+  try {
+    posthog.capture("NextUI Pro Banner", {
+      action: "click",
+      category: "nextui-callout",
+    });
+  } catch (error) {
+    console.error("Failed to track click event:", error);
+  }
 };
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c6b99d and a0b23a9.

📒 Files selected for processing (3)
  • apps/docs/app/docs/[[...slug]]/page.tsx (2 hunks)
  • apps/docs/components/docs/nextui-pro-callout.tsx (1 hunks)
  • apps/docs/components/docs/toc.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/docs/app/docs/[[...slug]]/page.tsx
  • apps/docs/components/docs/toc.tsx
🔇 Additional comments (1)
apps/docs/components/docs/nextui-pro-callout.tsx (1)

1-3: LGTM! Clean and focused imports

The "use client" directive is correctly placed, and imports are properly organized.

apps/docs/components/docs/nextui-pro-callout.tsx Outdated Show resolved Hide resolved
apps/docs/components/docs/nextui-pro-callout.tsx Outdated Show resolved Hide resolved
apps/docs/components/docs/nextui-pro-callout.tsx Outdated Show resolved Hide resolved
apps/docs/components/docs/nextui-pro-callout.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📋 Scope : Docs Related to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants