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(SubwayStatus): show on homepage #2377

Merged
merged 5 commits into from
Feb 18, 2025
Merged

Conversation

thecristen
Copy link
Collaborator

waiting on it to be release-ready, but technically works now. most of the change is in the last commit, and it pushed me into adjusting the layout of the shortcut buttons. welcome all feedback on any aspect

@thecristen thecristen added the do not merge ⏳ it's waiting on something label Feb 11, 2025
@thecristen thecristen requested a review from a team as a code owner February 11, 2025 19:59
@thecristen thecristen added the dev-green Deploy to dev-green label Feb 11, 2025
@github-actions github-actions bot removed the dev-green Deploy to dev-green label Feb 13, 2025
@thecristen thecristen force-pushed the cbj/subway-status-placeholder branch from 63f6284 to 48391cd Compare February 13, 2025 21:42
Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

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

Looks great! Can't wait for this to see the light of day!

@@ -13,7 +13,7 @@ defmodule DotcomWeb.Components.SystemStatus.SubwayStatus do

attr :subway_status, :any, required: true

def subway_status(assigns) do
def homepage_subway_status(assigns) do
Copy link
Contributor

Choose a reason for hiding this comment

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

Hehe - sneaky.

Should we rename this file too?

Copy link
Collaborator Author

@thecristen thecristen Feb 14, 2025

Choose a reason for hiding this comment

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

nah, I think with this name it could house multiple components for conveying subway status! ✨ My ultimate plan is to add an alerts_subway_status or some such function component to this file.

@@ -12,31 +12,12 @@
}
}

.m-homepage__shortcuts {
Copy link
Contributor

Choose a reason for hiding this comment

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

Love how you always find ways to get rid of legacy CSS when converting older things to Tailwind

Comment on lines +66 to +68
<%= unless Enum.empty?(Map.get(assigns, :recently_visited, [])) do %>
<hr />
<% end %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this whole thing be simplified to...

Suggested change
<%= unless Enum.empty?(Map.get(assigns, :recently_visited, [])) do %>
<hr />
<% end %>
<hr :if={Enum.any?(@recently_visited)} />

...along with a default assigns of recently_visited to []?

(Can layouts get attrs?)

class="m-tabbed-nav__content-item"
data-tab-content-type="alerts"
>
{alerts(@conn.assigns.alerts)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same thing as 👇 ?

Suggested change
{alerts(@conn.assigns.alerts)}
{alerts(@alerts)}

data-tab-content-type="trip-planner"
>
<div class="m-mode-hub__trip-plan-widget">
{DotcomWeb.PartialView.render("_trip_planner_widget.html", assigns)}
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is how we could use an EEx template in a HEEx component? Neat!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well originally it was just using an EEx template in another EEx template!

{shortcut_icons()}
</div>
<div class="pt-6 lg:pt-0 lg:ps-6 basis-2/5">
<.homepage_subway_status subway_status={@subway_status} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Yayyyyy!

@thecristen thecristen removed the do not merge ⏳ it's waiting on something label Feb 18, 2025
@thecristen thecristen merged commit d6e8243 into main Feb 18, 2025
17 checks passed
@thecristen thecristen deleted the cbj/subway-status-placeholder branch February 18, 2025 15:31
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