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

feat: Suppress "Depart at" buttons when there's only one itinerary #2250

Merged

Conversation

joshlarson
Copy link
Contributor

@joshlarson joshlarson requested a review from a team as a code owner December 6, 2024 20:15
@joshlarson joshlarson enabled auto-merge (squash) December 6, 2024 21:15
"""
end

defp depart_at_buttons(assigns) do
~H"""
<div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<div>
<div :if={Enum.count(@itineraries) < 2}>

😅 I feel like adding the if directive to the existing markup would suffice (and be a bit more readable)? Unless I'm missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! I just got into pattern-matching brain. The :if directive is easier to read in this context!

09081eb

@joshlarson joshlarson disabled auto-merge December 9, 2024 14:48
@joshlarson joshlarson enabled auto-merge (squash) December 9, 2024 14:48
@thecristen thecristen disabled auto-merge December 10, 2024 19:27
@thecristen thecristen merged commit 591ea7e into main Dec 10, 2024
22 of 23 checks passed
@thecristen thecristen deleted the jdl/suppress-depart-at-buttons-when-thered-only-be-one branch December 10, 2024 19:27
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