Skip to content

Conversation

@Alessandro100
Copy link
Contributor

@Alessandro100 Alessandro100 commented Feb 17, 2025

Summary:

Dark mode included

  • Initial dark mode setting based on user computer preference. After the choice is saved in localstorage
  • User can toggle light / dark in header
  • Dark theme added
  • Inline a links replaced by inline buttons

Note: Analytics not dark mode supported (can be worked on in future)

Expected behavior:

Application should behave the same and look good when dark mode is enabled

Testing tips:

Go through the application toggling between light and dark mode and assure all is ok. To toggle dark mode, the button can be found in the header

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

Screenshot 2025-02-17 at 14 38 14
Screenshot 2025-02-17 at 14 39 09
Screenshot 2025-02-17 at 15 24 50

@Alessandro100 Alessandro100 self-assigned this Feb 17, 2025
@github-actions
Copy link

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-919-yyd7cpbv.web.app

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

Great work and super clean! I added two comments to reflect before approving. Next step dark mode in the swagger UI 😉 , example

Comment on lines 109 to 111
theme.palette.mode === ThemeModeEnum.light
? theme.palette.primary.dark
: theme.palette.primary.light,
Copy link
Member

Choose a reason for hiding this comment

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

[question]: Can this be accomplished with a specific color? like theme.palette.primaryContrast? With more than one theme(not currently) this can be problematic and hard to spot before deploying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see and yes, I set them to the primary color which works well on the background for each

export const Map = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
const theme = useTheme();
const mapTiles =
theme.palette.mode === ThemeModeEnum.dark
Copy link
Member

Choose a reason for hiding this comment

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

[note]: I'm concerned about future modifications; this will be hard to spot and modify accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Map file is quite small and contained. If you're talking about the addition of future themes, perhaps a good idea would be add the map tile urls to the theme

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I'm talking about adding a theme in the future. I won't be clear to the dev that this URL is impacted by a new theme.

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM!

@Alessandro100 Alessandro100 merged commit 68f77fa into main Feb 20, 2025
4 checks passed
@Alessandro100 Alessandro100 deleted the feat/dark-mode branch February 20, 2025 17:59
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