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

Issue855. Make Main Landing Page Responsive and Add Hamburger Menu for Mobile View . #949

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

AradhyaDixit18
Copy link

This pull request enhances the responsiveness of the main landing page by introducing a hamburger menu for mobile devices. The following changes have been implemented:

Added Hamburger Menu:
Introduced a hamburger menu icon that appears on screens with a width of 768px or less.
The hamburger menu provides easy navigation on mobile devices by collapsing the side navigation into a drawer.

CSS Media Queries:
Utilized CSS media queries to ensure the hamburger menu icon is only displayed on mobile devices.
Adjusted styles for various elements to improve their layout and presentation on smaller screens.

Conditional Rendering in React:
Updated the React component to conditionally render the hamburger menu based on the screen size.
Added state management to handle the opening and closing of the hamburger menu drawer.

Styling Adjustments:
Ensured that the header remains sticky and spans the full width of the page.
Centered the main content on the page and provided adequate padding for a better user experience on all devices.

Now it looks like this :
Screenshot 2024-07-01 at 11 44 50 PM

Copy link

netlify bot commented Jul 1, 2024

Deploy Preview for dapper-ganache-45a60b ready!

Name Link
🔨 Latest commit cdd7a62
🔍 Latest deploy log https://app.netlify.com/sites/dapper-ganache-45a60b/deploys/6692850a77b9070008b8539c
😎 Deploy Preview https://deploy-preview-949--dapper-ganache-45a60b.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -1,27 +1,6 @@
{"k":"0000000080","o":"0000002870","v":"001"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are large deletions in pre existing themes?

Copy link
Contributor

Choose a reason for hiding this comment

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

@AradhyaDixit18 I'm guessing that you probably committed all changed files in the repo and didn't mean to commit this file? The code/src/data/themes file should only be committed if we are changing one of the default design systems that we ship with the project. Which doesn't seem to be the case with this PR.

code/src/ui/src/pages/WelcomePage.css Show resolved Hide resolved
Comment on lines +6 to +8


Copy link
Contributor

Choose a reason for hiding this comment

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

Can you review these extra lines. Just good code-quality

// Utility function to determine the text color based on the brightness of the background color
const getTextColor = (hex: string): string => {
hex = hex.replace('#', '');
const r = parseInt(hex.substring(0, 2), 16);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not so sure but hex to substring is really slow and inefficient. The mathematical conversions applied are available via package. Also, the rounding up will make the maths inaccurate by 1-2 numbers (although I don't think it make have any effect). Have you tried the color package?

Copy link
Author

Choose a reason for hiding this comment

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

I've tried . It works good

Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind separating the #946 code from the #855 code and submit them in separate PRs off of separate branches? They really aren't related. And if, for some reason, we have to revert a commit related to one issue, then we aren't affecting unrelated issues.

Copy link
Contributor

@aaronreed708 aaronreed708 left a comment

Choose a reason for hiding this comment

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

Also, please make sure that PRs that you make are against finos:dev, not finos:main. All changes go into the dev branch first. Thanks!

@@ -1,8 +1,8 @@
/*
 /*
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why this space, but it makes license comment not line up. Please correct.

Copy link
Author

Choose a reason for hiding this comment

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

fixed it sir

* Copyright (c) 2023 Discover Financial Services
* Licensed under Apache-2.0 License. See License.txt in the project root for license information
*/
import React, { useEffect, useState } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why the copyright header is being removed. If we need to address changing the copyright headers, we should do that under a separate issue.

// Utility function to determine the text color based on the brightness of the background color
const getTextColor = (hex: string): string => {
hex = hex.replace('#', '');
const r = parseInt(hex.substring(0, 2), 16);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind separating the #946 code from the #855 code and submit them in separate PRs off of separate branches? They really aren't related. And if, for some reason, we have to revert a commit related to one issue, then we aren't affecting unrelated issues.

</ExampleSection>
</div>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm seeing a lot of changes here but not sure why. Are these all spacing changes? It is really hard to tell what has been changed on purpose and what is just spacing. Please make sure that the only changes showing here are changes that you intentionally made to fix the root issue or changes that you specifically mention in the PR. I don't think the changes here apply to either scenario.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this was resolved, I still see changes here that are largely spacing related. It is difficult to tell what is specific to implementing new code for this PR and what isn't.

Copy link
Contributor

@aaronreed708 aaronreed708 left a comment

Choose a reason for hiding this comment

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

Also, please make sure that PRs that you make are against finos:dev, not finos:main. All changes go into the dev branch first. Thanks!

@aaronreed708
Copy link
Contributor

Here is an unexpected behavior that I notice with your PR. The error reporting seems to be gone when the user changes the hex value to something invalid. Is this intentional?

Screenshot 2024-07-09 at 12 52 20 AM

@aaronreed708
Copy link
Contributor

aaronreed708 commented Jul 9, 2024

Some more unexpected behavior. When I load a design system and then size the window smaller, the left nav disappears from the design system page but there is no hamburger icon with which to slide it out again.

Screenshot 2024-07-08 at 5 50 15 PM

@aaronreed708
Copy link
Contributor

The purple banner no longer stretches the whole application. Is this intentional?

Screenshot 2024-07-08 at 5 46 18 PM

@AradhyaDixit18 AradhyaDixit18 changed the base branch from main to dev July 13, 2024 13:47
@AradhyaDixit18
Copy link
Author

Fixed the width of the purple banner .
Screenshot 2024-07-13 at 7 26 56 PM
Screenshot 2024-07-13 at 7 27 21 PM

Copy link

netlify bot commented Jul 13, 2024

Deploy Preview for glistening-gecko-6b417a ready!

Name Link
🔨 Latest commit b85b9ef
🔍 Latest deploy log https://app.netlify.com/sites/glistening-gecko-6b417a/deploys/669289ffa4a06100085e960c
😎 Deploy Preview https://deploy-preview-949--glistening-gecko-6b417a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Author

@AradhyaDixit18 AradhyaDixit18 left a comment

Choose a reason for hiding this comment

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

@aaronreed708 fixed all the required changes please have a look at this

@@ -1,8 +1,8 @@
/*
 /*
Copy link
Author

Choose a reason for hiding this comment

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

fixed it sir

@@ -105,7 +105,7 @@ const DesignSystemPage: React.FC<Props> = ({user, storage, themeName, setThemeNa

// listen for changes in selected accessibility layers so that appropriate
// styles can be set
const layerChangeListener = function (event: EventValueChange<Boolean>) {
const layerChangeListener = function (event: EventValueChange<Boolean>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this space added? Now beginning of line and ending bracket won't line up.

window.addEventListener("resize", handleResize);
return () => window.removeEventListener("resize", handleResize);
}, []);

Copy link
Contributor

Choose a reason for hiding this comment

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

why this second setting of a resize even handler? Why wouldn't you put both pieces of logic in the same event listener if both pieces of logic need to happen on each resize?

@@ -75,7 +75,7 @@ export const DesignSystemTitleBar: React.FC<Props> = ({ designSystemNames, desig

return (
<>
<div className="titleBarDiv" data-background="colored">
<div className="titleBarDiv " data-background="colored">
<div className="left-titlebar">
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this space added?

</ExampleSection>
</div>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this was resolved, I still see changes here that are largely spacing related. It is difficult to tell what is specific to implementing new code for this PR and what isn't.

@Sweetdevil144
Copy link
Contributor

@AradhyaDixit18 . What @aaronreed708 is requesting is for you to apply prettier formatting once so that there isn't much confusion while reading the code. Sudden Spaces and jumps make the code look a bit confusing due to code quality issues :)

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.

3 participants