-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
63f6284
to
48391cd
Compare
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.
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 |
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.
Hehe - sneaky.
Should we rename this file too?
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.
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 { |
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.
Love how you always find ways to get rid of legacy CSS when converting older things to Tailwind
<%= unless Enum.empty?(Map.get(assigns, :recently_visited, [])) do %> | ||
<hr /> | ||
<% end %> |
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.
Could this whole thing be simplified to...
<%= 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)} |
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.
Is this the same thing as 👇 ?
{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)} |
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.
So this is how we could use an EEx template in a HEEx component? Neat!
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.
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} /> |
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.
Yayyyyy!
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