Skip to content

[ECWoC] Fixed Profile Picture not loading Error, Implemented uniform navbar and footer - #125

Open
ShivanshCoding36 wants to merge 3 commits into
Sahilll94:mainfrom
ShivanshCoding36:main
Open

[ECWoC] Fixed Profile Picture not loading Error, Implemented uniform navbar and footer#125
ShivanshCoding36 wants to merge 3 commits into
Sahilll94:mainfrom
ShivanshCoding36:main

Conversation

@ShivanshCoding36

Copy link
Copy Markdown

Pull Request Description

Summary

This PR improves UI consistency and fixes the default avatar image issue caused by a backend URL mismatch. It removes hardcoded layout elements and switches policy pages to use shared layout components.

Type of Change

Please delete options that are not relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • UI/UX improvement

Motivation and Context

  • The backend still returns the old default avatar URL, which is no longer exsisting and is replaced with the new url

  • Some static pages (Privacy Policy / Terms & Conditions) were using hardcoded Navbar and Footer instead of the shared components used across the app.

Changes Made

1) Default Avatar Fix

  • Added frontend logic to map old default Profile Pic URL → new default Profile Pic URL
  • Ensures correct avatar loads for users with a default profile image
  • No change for users who have updated their profile picture

2) Layout Consistency Improvements

  • Removed hardcoded Navbar and Footer; replaced with the ones used in home page

Screenshots (if applicable)

If your changes include UI modifications, please add before and after screenshots:

Before:

1)

image

2)

image image

After:

1)

image

2)

image image

Testing

  • I have tested these changes locally
  • All new and existing tests pass
  • I have tested the changes on different screen sizes (for UI changes)
  • I have tested in both light and dark mode (for UI changes)

Code Quality

  • My code follows the existing code style of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings or errors

Deployment

  • These changes require no deployment steps

Contributor Checklist

  • I have read and followed the Contributing Guidelines
  • I have checked that this PR doesn't duplicate an existing PR
  • I have requested review from relevant team members
  • I am ready to apply for contributor recognition after this PR is merged

For Maintainers

  • Code review completed
  • Tests passing
  • Documentation updated
  • Ready to merge

@vercel

vercel Bot commented Feb 12, 2026

Copy link
Copy Markdown

@ShivanshCoding36 is attempting to deploy a commit to the Sahil's projects Team on Vercel.

A member of the Team first needs to authorize it.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ShivanshCoding36, 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 addresses two key areas: resolving a bug related to default profile picture loading and enhancing UI consistency across the application's legal pages. The changes ensure that users with default avatars see the correct image and that the Privacy Policy and Terms of Service pages now utilize the same standardized navigation and footer components as the main site, providing a more cohesive user experience.

Highlights

  • Profile Picture Loading Fix: Implemented frontend logic to correctly map an outdated default avatar URL to the new one, resolving an issue where default profile pictures were not loading for users.
  • UI Consistency for Legal Pages: Replaced hardcoded navigation bars and footers on the Privacy Policy and Terms of Service pages with the standardized, shared components used across the rest of the application, improving overall UI consistency.
Changelog
  • src/components/Cards/ProfileInfo.jsx
    • Added logic to detect and replace an old default profile image URL with a new one.
    • Updated the image source to use the dynamically determined profile image URL.
  • src/pages/legal/PrivacyPolicy.jsx
    • Imported the shared Footer component.
    • Replaced the page's hardcoded simple navbar with the application's standard header component.
    • Replaced the page's hardcoded footer with the shared Footer component.
  • src/pages/legal/Terms.jsx
    • Imported the shared Footer component.
    • Replaced the page's hardcoded simple navbar with the application's standard header component.
    • Replaced the page's hardcoded footer with the shared Footer component.
Activity
  • The pull request was created by ShivanshCoding36.
  • The author performed a self-review of the code.
  • The author confirmed local testing, passing tests, responsiveness testing, and dark/light mode testing.
  • The author confirmed adherence to code quality standards and no new warnings or errors.
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.

@ShivanshCoding36

Copy link
Copy Markdown
Author

Hi maintainers
This PR is a part of ECWoC
Kindly add the required labels.

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

Copy link
Copy Markdown
Contributor

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 aims to fix a profile picture loading error and unify the navigation and footer on legal pages. A critical security vulnerability was identified where links in the new navbar component use insecure http:// protocols, potentially exposing users to man-in-the-middle attacks. It is recommended to update these URLs to https://. Additionally, the implementation for the uniform navbar introduces critical code quality issues due to extensive JSX duplication in PrivacyPolicy.jsx and Terms.jsx, leading to runtime errors from missing imports and undefined variables. The profile picture fix also has minor code quality improvements.

</div>
</div>
</div>
</header>>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

There's a syntax error here with an extra > character. This will break rendering.

Suggested change
</header>>
</header>

{/* API Docs Icon */}
<div className="relative group ml-3">
<a
href="http://docs.travelbook.sahilfolio.live/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The link to the API documentation uses an insecure http:// protocol, exposing users to man-in-the-middle attacks. All external links should use https:// for encrypted connections. Additionally, this section is part of a large duplicated JSX block for the navigation bar, which introduces significant code duplication and critical errors, including undefined navigate function calls and unimported components like MdGroup and AiOutlineCloudServer. Please refactor this into a shared Navbar component and ensure all dependencies are correctly imported and hooks are initialized.

Suggested change
href="http://docs.travelbook.sahilfolio.live/"
href="https://docs.travelbook.sahilfolio.live/"

Comment thread src/pages/legal/Terms.jsx
{/* API Docs Icon */}
<div className="relative group ml-3">
<a
href="http://docs.travelbook.sahilfolio.live/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The link to the API documentation uses an insecure http:// protocol, exposing users to man-in-the-middle attacks. All external links should use https:// for encrypted connections. Similar to PrivacyPolicy.jsx, this section is part of a large duplicated JSX block for the navigation bar, leading to code duplication and critical errors, including undefined navigate function calls and unimported components like MdGroup and AiOutlineCloudServer. Please refactor this to use a shared Navbar component and fix the missing imports and hook initializations.

Suggested change
href="http://docs.travelbook.sahilfolio.live/"
href="https://docs.travelbook.sahilfolio.live/"

{/* Medium Blog Icon */}
<div className="relative group ml-3">
<a
href="http://medium.travelbook.sahilfolio.live/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The link to the Medium blog uses an insecure http:// protocol. This exposes users to man-in-the-middle attacks, where an attacker could intercept or modify the content. All external links should use https:// to ensure an encrypted, secure connection.

Suggested change
href="http://medium.travelbook.sahilfolio.live/"
href="https://medium.travelbook.sahilfolio.live/"

Comment thread src/pages/legal/Terms.jsx
{/* Medium Blog Icon */}
<div className="relative group ml-3">
<a
href="http://medium.travelbook.sahilfolio.live/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The link to the Medium blog uses an insecure http:// protocol. This exposes users to man-in-the-middle attacks, where an attacker could intercept or modify the content. All external links should use https:// to ensure an encrypted, secure connection.

Suggested change
href="http://medium.travelbook.sahilfolio.live/"
href="https://medium.travelbook.sahilfolio.live/"

@@ -1,15 +1,27 @@
import React from 'react';
import {React,useEffect} from 'react';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

useEffect is imported but not used in this component. Unused imports should be removed to keep the code clean. Additionally, the import syntax import {React,useEffect} from 'react'; is non-standard. It should be import React from 'react'; since useEffect is not used.

Suggested change
import {React,useEffect} from 'react';
import React from 'react';

Comment on lines +6 to +15
const defaultOld =
'https://res.cloudinary.com/travel-book/image/upload/v1720536854/travel_book/default-avatar.png';

const defaultNew =
'https://travelbook.devbysahil.com/avatar-default.png';

const profileImageUrl =
userInfo?.profileImage === defaultOld
? defaultNew
: userInfo?.profileImage;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The constants defaultOld and defaultNew are re-declared on every render. Since they are true constants, they should be defined outside the component scope to prevent unnecessary re-computation on each render. It's also a common practice to name such constants in UPPER_SNAKE_CASE and centralize them in a constants file for better maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant