From 5db01b9af7565758b073250bed42071cff1592c2 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Mon, 2 Dec 2024 15:20:27 -0500 Subject: [PATCH] Add header and footer instances in closures CG. --- assets/css/elevator_v2.scss | 8 ++ assets/css/v2/elevator/elevator_closures.scss | 2 +- assets/css/v2/elevator/footer.scss | 7 +- assets/css/v2/elevator/header.scss | 7 +- assets/css/v2/elevator/normal.scss | 17 +++- .../v2/elevator/elevator_closures.tsx | 55 +++++-------- assets/src/components/v2/elevator/footer.tsx | 2 +- .../components/v2/elevator/normal_screen.tsx | 10 ++- assets/src/components/v2/normal_header.tsx | 18 ++--- assets/src/util/util.tsx | 6 +- .../v2/candidate_generator/elevator.ex | 25 +++++- .../candidate_generator/elevator/closures.ex | 26 +++++-- .../v2/widget_instance/elevator_closures.ex | 13 ++-- lib/screens/v2/widget_instance/footer.ex | 13 +++- .../v2/widget_instance/normal_header.ex | 16 +++- .../elevator/closures_test.exs | 78 ++++++++++++++----- .../v2/candidate_generator/elevator_test.exs | 35 ++++++--- .../elevator_closures_test.exs | 10 +-- .../v2/widget_instance/normal_header_test.exs | 3 +- 19 files changed, 225 insertions(+), 126 deletions(-) diff --git a/assets/css/elevator_v2.scss b/assets/css/elevator_v2.scss index fe322c454..e6bdfeaf5 100644 --- a/assets/css/elevator_v2.scss +++ b/assets/css/elevator_v2.scss @@ -34,3 +34,11 @@ body { *::after { box-sizing: border-box; } + +.normal-header, +.footer { + &--closed { + color: white; + background-color: $accessibility-blue; + } +} diff --git a/assets/css/v2/elevator/elevator_closures.scss b/assets/css/v2/elevator/elevator_closures.scss index 4e76c5224..15fc556d1 100644 --- a/assets/css/v2/elevator/elevator_closures.scss +++ b/assets/css/v2/elevator/elevator_closures.scss @@ -2,7 +2,7 @@ position: relative; display: flex; flex-direction: column; - height: 1632px; + height: 100%; color: $cool-black-15; background-color: $warm-neutral-90; diff --git a/assets/css/v2/elevator/footer.scss b/assets/css/v2/elevator/footer.scss index 696176347..86a964854 100644 --- a/assets/css/v2/elevator/footer.scss +++ b/assets/css/v2/elevator/footer.scss @@ -1,5 +1,5 @@ .footer { - height: 184px; + height: 100%; padding: 26px 48px; font-size: 48px; font-weight: 500; @@ -7,11 +7,6 @@ color: white; background-color: $cool-black-30; - &--blue { - color: white; - background-color: $accessibility-blue; - } - b { letter-spacing: -0.2px; } diff --git a/assets/css/v2/elevator/header.scss b/assets/css/v2/elevator/header.scss index 0b1e17726..c3102b3cd 100644 --- a/assets/css/v2/elevator/header.scss +++ b/assets/css/v2/elevator/header.scss @@ -2,16 +2,11 @@ display: flex; align-items: center; justify-content: space-between; - height: 104px; + height: 100%; padding: 0 48px; font-family: Inter, sans-serif; font-size: 48px; line-height: 62px; color: $warm-neutral-90; background-color: $cool-black-15; - - &--blue { - color: white; - background-color: $accessibility-blue; - } } diff --git a/assets/css/v2/elevator/normal.scss b/assets/css/v2/elevator/normal.scss index ceff2d56e..cdf209a7c 100644 --- a/assets/css/v2/elevator/normal.scss +++ b/assets/css/v2/elevator/normal.scss @@ -5,7 +5,18 @@ margin-left: auto; } -.screen-normal__main-content { - width: 100%; - height: 1920px; +.screen-normal__header { + width: 1080px; + height: 104px; +} + +.screen-normal__body { + width: 1080px; + height: 1632px; +} + +.screen-normal__footer { + position: relative; + width: 1080px; + height: 184px; } diff --git a/assets/src/components/v2/elevator/elevator_closures.tsx b/assets/src/components/v2/elevator/elevator_closures.tsx index 766fb4d40..3f414a7fa 100644 --- a/assets/src/components/v2/elevator/elevator_closures.tsx +++ b/assets/src/components/v2/elevator/elevator_closures.tsx @@ -9,8 +9,6 @@ import OutsideClosuresView from "Components/v2/elevator/closures/outside_closure import CurrentElevatorClosedView, { type Coordinates, } from "Components/v2/elevator/closures/current_elevator_closed_view"; -import Footer from "Components/v2/elevator/footer"; -import NormalHeader from "Components/v2/normal_header"; export type StationWithClosures = { id: string; @@ -35,7 +33,6 @@ interface Props extends WrappedComponentProps { accessible_path_direction_arrow: Direction; accessible_path_image_url: string | null; accessible_path_image_here_coordinates: Coordinates; - time: string; } const ElevatorClosures: React.ComponentType = ({ @@ -46,7 +43,6 @@ const ElevatorClosures: React.ComponentType = ({ accessible_path_direction_arrow: accessiblePathDirectionArrow, accessible_path_image_url: accessiblePathImageUrl, accessible_path_image_here_coordinates: accessiblePathImageHereCoordinates, - time, lastUpdate, onFinish, }: Props) => { @@ -55,36 +51,27 @@ const ElevatorClosures: React.ComponentType = ({ ); return ( - <> - -
- {currentElevatorClosure ? ( - - ) : ( - - )} -
-