-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: main
Are you sure you want to change the base?
Conversation
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.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
let markerColor = '#ff5b40'; | ||
if (location.closedLongTerm) { | ||
markerColor = '#ff5b40'; | ||
} else if ( | ||
location.locationState === LocationState.CLOSES_SOON | ||
) { | ||
markerColor = '#ffd700'; | ||
} else if (location.isOpen) { | ||
markerColor = '#69bb36'; | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
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
How Has This Been Tested?
Test Configuration:
Checklist: