Skip to content

feat: add userId prop to Landing component for profile navigation#35

Merged
hoangsonww merged 1 commit into
masterfrom
feat/enhance-landing-auth
Mar 17, 2026
Merged

feat: add userId prop to Landing component for profile navigation#35
hoangsonww merged 1 commit into
masterfrom
feat/enhance-landing-auth

Conversation

@hoangsonww

Copy link
Copy Markdown
Owner

This pull request updates the landing page to enhance the user navigation experience by displaying context-aware action buttons based on authentication state. The most notable change is the addition of a "Profile" button for authenticated users, which links directly to their profile page.

Landing page navigation improvements:

  • The landing page now displays a "Profile" button for authenticated users, linking to /profile/{userId} if the userId is available, or to /home as a fallback.
  • The "Join Meadows" and "Log In" buttons are now grouped together and only shown to unauthenticated users, improving clarity.
  • The "Home" button is now always shown to authenticated users, with updated iconography and text.

Prop and data handling updates:

  • The Landing component now receives a userId prop, which is passed from getServerSideProps based on the authenticated user. [1] [2]

UI icon update:

  • The UserRound icon is imported and used for the new "Profile" button.

@hoangsonww hoangsonww self-assigned this Mar 17, 2026
@hoangsonww hoangsonww added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists labels Mar 17, 2026
Copilot AI review requested due to automatic review settings March 17, 2026 16:38
@hoangsonww hoangsonww added enhancement New feature or request good first issue Good for newcomers labels Mar 17, 2026
@vercel

vercel Bot commented Mar 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meadows-social-media Ready Ready Preview, Comment Mar 17, 2026 4:38pm

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the landing page's user experience by dynamically adjusting navigation options based on the user's authentication status. It introduces a dedicated profile link for logged-in users and reorganizes the call-to-action buttons for unauthenticated visitors, making the interface more intuitive and personalized.

Highlights

  • Enhanced User Navigation: Implemented context-aware action buttons on the landing page, distinguishing between authenticated and unauthenticated users.
  • Profile Button for Authenticated Users: Added a 'Profile' button that links directly to '/profile/{userId}' for authenticated users, with a fallback to '/home'.
  • Streamlined Unauthenticated Experience: Grouped 'Join Meadows' and 'Log In' buttons, displaying them exclusively for unauthenticated users.
  • userId Prop Integration: The 'Landing' component now receives a 'userId' prop, populated via 'getServerSideProps', to enable personalized profile navigation.
  • UI Icon Update: Incorporated the 'UserRound' icon for the new 'Profile' button.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/pages/index.tsx
    • Imported 'UserRound' icon from 'lucide-react'.
    • Added 'userId: string | null;' to the 'LandingProps' type definition.
    • Updated the 'Landing' functional component to accept 'userId' as a prop.
    • Refactored the button rendering logic to conditionally display 'Home' and 'Profile' buttons for authenticated users, and 'Join Meadows' and 'Log In' for unauthenticated users.
    • Modified the 'Home' button text from 'Home Feed' to 'Home' and updated its styling.
    • Implemented the 'Profile' button with a dynamic 'href' based on the 'userId'.
    • Updated 'getServerSideProps' to retrieve and pass the 'data?.user?.id' as 'userId' to the 'Landing' component.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@hoangsonww
hoangsonww merged commit 45b5d3d into master Mar 17, 2026
5 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds a 'Profile' button to the landing page for authenticated users, improving navigation. The implementation is clean, passing the userId from getServerSideProps to the Landing component. I've left one suggestion to improve the user experience by conditionally rendering the 'Profile' button to avoid showing redundant navigation links.

Comment thread web/pages/index.tsx
Comment on lines +739 to +748
<>
<Btn href="/home">
<Sparkles className="size-5" />
Home
</Btn>
<Btn href={userId ? `/profile/${userId}` : "/home"} outline>
<UserRound className="size-5" />
Profile
</Btn>
</>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When userId is null, the 'Profile' button currently falls back to /home. This results in two buttons ('Home' and 'Profile') pointing to the same destination, which is redundant. It's better to conditionally render the 'Profile' button only when a valid userId is available. This ensures a cleaner user interface and avoids confusion.

              <>
                <Btn href="/home">
                  <Sparkles className="size-5" />
                  Home
                </Btn>
                {userId && (
                  <Btn href={`/profile/${userId}`} outline>
                    <UserRound className="size-5" />
                    Profile
                  </Btn>
                )}
              </>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Next.js landing page (web/pages/index.tsx) to provide authentication-aware navigation, including direct profile navigation for signed-in users.

Changes:

  • Adds a userId prop to the Landing page component, sourced from getServerSideProps.
  • Updates the hero CTA buttons: authenticated users see “Home” + “Profile”, unauthenticated users see “Join Meadows” + “Log In”.
  • Adds the UserRound icon for the new “Profile” button.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/pages/index.tsx
Comment on lines 1088 to 1092
return {
props: {
isAuthenticated: Boolean(data?.user) && !error,
userId: data?.user?.id ?? null,
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants