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

Map almost closed view #545

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Map almost closed view #545

wants to merge 2 commits into from

Conversation

hanabenko
Copy link

Description

CMU Concept restaurants that close soon are now yellow on the map, and the rest are red and green as usual, depending on if they are open or closed. This way, the list view matches the map. Before, restaurants that appeared yellow on the list were green on the map.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • bun test
  • npm run lint

Test Configuration:

  • Node.js version: v23.6.1
  • Python version: 3.10.9
  • OS: MacOS Sonoma 14.6.1
  • Browser: Chrome

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Places that close soon are now yellow on the map, and the rest are red and green as usual. This way, the list view matches the map.
CMU Concept restaurants that close soon are now yellow on the map, and the rest are red and green as usual, depending on if they are open or closed. This way, the list view matches the map. Before, restaurants that appeared yellow on the list were green on the map.
Copy link

vercel bot commented Feb 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmueats ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 10:58pm

Comment on lines +72 to +81
let markerColor = '#ff5b40';
if (location.closedLongTerm) {
markerColor = '#ff5b40';
} else if (
location.locationState === LocationState.CLOSES_SOON
) {
markerColor = '#ffd700';
} else if (location.isOpen) {
markerColor = '#69bb36';
}
Copy link
Contributor

@cirex-web cirex-web Feb 2, 2025

Choose a reason for hiding this comment

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

Thanks!

I think we can probably directly call

const colors: Record<LocationState, string> = {
	[LocationState.OPEN]: '#19b875',
	[LocationState.CLOSED]: '#dd3c18',
	[LocationState.CLOSED_LONG_TERM]: '#dd3c18',
	[LocationState.OPENS_SOON]: '#f6cc5d',
	[LocationState.CLOSES_SOON]: '#f3f65d',
};

defined in EateryCard.tsx for the values instead. Is there any reason why the colors need to be different between the two pages?

At this point, maybe we should honestly create a new file /util/colors.ts and write a getColorFromStatus function that uses this colors map.

Copy link
Contributor

Choose a reason for hiding this comment

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

or, or, better yet, make some css classes like .icon--closes-soon, .icon--opens-soon, .icon--closed and delegate the color assignment responsibility to CSS instead

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.

2 participants