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

💄 DOP-4658 side nav now handles dark mode #1127

Merged
merged 8 commits into from
Jun 12, 2024
Merged

💄 DOP-4658 side nav now handles dark mode #1127

merged 8 commits into from
Jun 12, 2024

Conversation

caesarbell
Copy link
Collaborator

@caesarbell caesarbell commented Jun 10, 2024

Stories/Links:

DOP-4658

Current Behavior:

Docs Landing

Docs Manual

Docs Drivers Landing

Staging Links:

feature flag enabled

Staged: Docs Landing(sourced from a fork docs landing)

Staged: Docs Manual

Staged: Docs Drivers Landing (built off this pr)

We can also compare it to the stage page from @mayaraman19 , found here

feature flag disabled

Staged: Docs Landing

Staged: Docs Atlas

Notes:

In this PR, we updated the LG Side Nav component, along with tweaking some styles to support dark mode. Due to the LG Side Nav component upgrade, we were able to remove some custom styles. We also added the dark mode style to the IALinkedData Component.

README updates

    • This PR introduces changes that should be reflected in the README, and I have made those updates.
    • This PR does not introduce changes that should be reflected in the README

@caesarbell caesarbell marked this pull request as ready for review June 10, 2024 21:54
@mayaraman19
Copy link
Collaborator

could you add ability for the IALinkedData, aka the drivers cards in the sidenav, to support dark mode icons? This PR in the parser created the :icon-dark: option for cards which you can add here to test. (You can find the Dark Mode icons here). I think only Rust, Java and Node need to have the separate Dark Mode icons.

@mayaraman19
Copy link
Collaborator

also, on selection of a sidenav item, it seems like in the Figma the text should be light green upon selection.
from staging link:
image

From figma:
image

Copy link
Collaborator

@seungpark seungpark left a comment

Choose a reason for hiding this comment

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

mostly LGTM! few comments below.

also can we get verification for the mobile dropdown? seems like we'd need to get the colors and the placement regarding action bar down

src/components/Sidenav/Sidenav.js Show resolved Hide resolved
src/components/Sidenav/Sidenav.js Outdated Show resolved Hide resolved
src/components/Sidenav/Sidenav.js Show resolved Hide resolved
src/components/Sidenav/TOCNode.js Outdated Show resolved Hide resolved
@caesarbell
Copy link
Collaborator Author

could you add ability for the IALinkedData, aka the drivers cards in the sidenav, to support dark mode icons? This PR in the parser created the :icon-dark: option for cards which you can add here to test. (You can find the Dark Mode icons here). I think only Rust, Java and Node need to have the separate Dark Mode icons.

@mayaraman19 I didn't work on those due to the ticket's description i.e. Some components in the Sidenav such as the Products dropdown and Driver logos/cards should be taken care of by other tickets

But if this has changed, I can gladly work on logos/cards within this ticket. cc @seungpark @mmeigs.

@caesarbell
Copy link
Collaborator Author

also, on selection of a sidenav item, it seems like in the Figma the text should be light green upon selection. from staging link: image

From figma: image

I shared this with Liz to see if we want to stick with LG side nav designs or was the green font from Figma intentional.

@caesarbell
Copy link
Collaborator Author

mostly LGTM! few comments below.

also can we get verification for the mobile dropdown? seems like we'd need to get the colors and the placement regarding action bar down

@seungpark, yeah, there were no designs in Figma for this, so I went with my best guess. I will share this with the design team and verify the assumptions with them.

@caesarbell
Copy link
Collaborator Author

@mayaraman19 @seungpark, share the thread that contains the feedback we got from the design team.

@caesarbell caesarbell requested a review from seungpark June 11, 2024 18:18
Copy link
Collaborator

@seungpark seungpark left a comment

Choose a reason for hiding this comment

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

minor comment about styling but overall looks great! thank you!

as discussed we can address the icons and mobile in the mentioned tickets 👍

also, if we can stage a landing / atlas with the flag disabled for a regression check would be great 👍

@caesarbell
Copy link
Collaborator Author

minor comment about styling but overall looks great! thank you!

as discussed we can address the icons and mobile in the mentioned tickets 👍

also, if we can stage a landing / atlas with the flag disabled for a regression check would be great 👍

We decided to set up the IALinkedData component to handle darkMode.

Copy link
Collaborator

@mmeigs mmeigs left a comment

Choose a reason for hiding this comment

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

Looks so so good. Just a couple questions below!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Love this. Thanks!


iconSrc = isPath ? (darkMode && iconDark ? withPrefix(iconDark) : withPrefix(icon)) : imageUrl;
}
let iconSrc = getSuitableIcon(darkMode, iconDark, icon);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Can change this to a const now that it's a beautiful one-liner

<div
css={css`
margin-left: ${hasChildren || isTocIcon ? '0px' : '21px'};
color: ${isActive ? `${palette.green.dark3};` : `${palette.gray.dark3};`};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering about this change: is the color change and specificity not necessary anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mmeigs good question, with the side nav upgrade it handles the active state color, and since the design team opted for matching the LG side nav styles rather than the Figma, we no longer needed to handle it anymore by applying our own style for the active state.

Copy link
Collaborator

@mayaraman19 mayaraman19 left a comment

Choose a reason for hiding this comment

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

woohoo! thanks for taking this on!

* @param {string} icon
* @returns {string}
*/
export const getSuitableIcon = (isDarkMode, iconDark, icon) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks so much for adding this and putting it into the Card component as well!

one super miniscule nit is that I feel like the order of the parameters would make more sense as icon, iconDark, isDarkMode. Not super sure why, maybe just feel like the icon parameter should come first. Obviously this is really tiny, though, so do whatever you want!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mayaraman19 good call on that, icon would be the prominent param, which I can see your case for it coming first. I will make the change. Thank you for your feedback on that.

@caesarbell caesarbell requested a review from mmeigs June 12, 2024 16:51
@caesarbell caesarbell merged commit 7f4db7c into main Jun 12, 2024
2 checks passed
@caesarbell caesarbell deleted the DOP-4658 branch June 12, 2024 17:05
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.

4 participants