feat: add userId prop to Landing component for profile navigation#35
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello, 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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| <> | ||
| <Btn href="/home"> | ||
| <Sparkles className="size-5" /> | ||
| Home | ||
| </Btn> | ||
| <Btn href={userId ? `/profile/${userId}` : "/home"} outline> | ||
| <UserRound className="size-5" /> | ||
| Profile | ||
| </Btn> | ||
| </> |
There was a problem hiding this comment.
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>
)}
</>
There was a problem hiding this comment.
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
userIdprop to theLandingpage component, sourced fromgetServerSideProps. - Updates the hero CTA buttons: authenticated users see “Home” + “Profile”, unauthenticated users see “Join Meadows” + “Log In”.
- Adds the
UserRoundicon for the new “Profile” button.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return { | ||
| props: { | ||
| isAuthenticated: Boolean(data?.user) && !error, | ||
| userId: data?.user?.id ?? null, | ||
| }, |
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:
/profile/{userId}if theuserIdis available, or to/homeas a fallback.Prop and data handling updates:
Landingcomponent now receives auserIdprop, which is passed fromgetServerSidePropsbased on the authenticated user. [1] [2]UI icon update:
UserRoundicon is imported and used for the new "Profile" button.