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

Route list date scroll #322

Closed
wants to merge 8 commits into from

Conversation

Kovler10
Copy link

@Kovler10 Kovler10 commented Sep 25, 2023

Closes #279

app/screens/route-list/route-list-screen.tsx Outdated Show resolved Hide resolved

const setNewDate = useCallback(
(value: number) => {
routePlan.setDate(routePlan.date.setDate(routePlan.date.getDate() + value))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't edit the user's date in the store. Generate a new state for the scroll requests

@planecore
Copy link
Collaborator

Show loading indicator only when routeData is empty, and add a loading indicator to the date scroll component.

setRouteData((prevData) => [...prevData, routePlan.date.toDateString(), ...trains.data])
setRouteData((prevData) =>
uniqBy([...prevData, routePlan.date.toDateString(), ...trains.data], (item) => {
return typeof item === "string" ? item : item.trains.map((train) => train.departureTimeString).join()
Copy link
Collaborator

@planecore planecore Oct 3, 2023

Choose a reason for hiding this comment

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

Unique by train numbers AND departure times as departure times can be the same

item.trains.map((train) => train.trainNumber).join()

@planecore planecore closed this Jun 12, 2024
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.

Scroll to previous/next day in route list
2 participants