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

Amy/small UI fixes #166

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

Amy/small UI fixes #166

wants to merge 5 commits into from

Conversation

amjiao
Copy link

@amjiao amjiao commented Oct 9, 2024

Overview

Small UI fixes on Eatery HomeScreen

Changes Made

  • removed nearby eateries carousel
  • replaced 'payment methods' dropdown in filters with 'Meal Swipes' and 'BRBs' filters
  • reordered filters to 'north, west, central, swipes, brbs, favorites, under 10 min'
  • organized 'All Eateries' section by distance (closest to farthest)

Test Coverage

  • checked that Meal Swipes and BRBs filters are filtering correctly
  • checked that eateries are ordered from closest to farthest by walking distance

Screenshots (optional)

image

Amy and others added 5 commits October 5, 2024 21:39
…replaced with 'meal swipes' and 'BRBs' filters
-Renamed nearestEateriesSort to eateriesByDistance
-Removed unused onNearestExpand
# Conflicts:
#	app/src/main/java/com/cornellappdev/android/eatery/ui/screens/HomeScreen.kt
Copy link
Contributor

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

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

Very nice job! Congrats on your first PR 🎊

Copy link
Contributor

@thisjustin123 thisjustin123 left a comment

Choose a reason for hiding this comment

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

A few comments / questions, but otherwise great stuff! The removal of nearest eateries was a long time coming. Not sure why it took us (as a pod) this long...

Comment on lines +110 to +123
/**A [StateFlow] that emits a list of all eateries sorted by nearest proximity
*
* Sorted (by descending priority): Open/Closed, Walk Time
* */
val eateriesByDistance: StateFlow<List<Eatery>> = eateryFlow.map { apiResponse ->
when (apiResponse) {
is EateryApiResponse.Error -> listOf()
is EateryApiResponse.Pending -> listOf()
is EateryApiResponse.Success -> {
apiResponse.data.sortedBy { it.getWalkTimes() }.sortedBy { it.isClosed() }
}
}
}.stateIn(viewModelScope, SharingStarted.Eagerly, listOf())

Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to nearestEateries? Are we still using it somewhere and therefore it can't be removed? Since it seems like you stopped using it the home screen composable.

Comment on lines +231 to +250
eateriesApiResponse = eateriesApiResponse,
favorites = favorites,
nearestEateries = nearestEateries,
filters = filters,
onFavoriteClick = { eatery, favorite ->
if (favorite) {
homeViewModel.addFavorite(eatery.id)
} else {
homeViewModel.removeFavorite(eatery.id)
}
},
onFilterClicked = { filter ->
if (filters.contains(filter)) {
homeViewModel.removeFilter(filter)
} else {
homeViewModel.addFilter(filter)
}
},
onResetFilters = {
homeViewModel.resetFilters()
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the indentation here became a little sus. Could you reformat file? Should be command option L on mac (or something like that...)

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