From a4229ff4517437ef2f77b371033c1dfbd7e18a03 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sun, 26 Mar 2023 20:22:18 -0400 Subject: [PATCH] Added media frame and connected it with logic for units (changes when selected too! :) ) wow --- css/components/media_slideshow.css | 1 - css/details.css | 11 +++++++++++ src/pages/details.rs | 24 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/css/components/media_slideshow.css b/css/components/media_slideshow.css index 99db24b..01692c2 100644 --- a/css/components/media_slideshow.css +++ b/css/components/media_slideshow.css @@ -15,7 +15,6 @@ } .media-slideshow-video { - background-color: gray; width: 100%; height: 100%; display: none; diff --git a/css/details.css b/css/details.css index ca15194..ba7d93d 100644 --- a/css/details.css +++ b/css/details.css @@ -192,4 +192,15 @@ Divide the Details page into 3 main sections: font-family: Inter; font-size: 15px; +} + +.details-body-units-media-slideshow-frame { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 360px; + background-color: rgba(128, 128, 128, 0.151); + border-radius: 20px; } \ No newline at end of file diff --git a/src/pages/details.rs b/src/pages/details.rs index 7e6135a..d6ee149 100644 --- a/src/pages/details.rs +++ b/src/pages/details.rs @@ -40,7 +40,7 @@ pub fn details_page(props: &DetailsPageProps) -> Html { "(Listo)" } else {""}); let project_floors = &listing.project.floors.to_string(); - + let cloned_selected_unit_handle = selected_unit_handle.clone(); //TODO: Floating whatsapp button on this page html!{ @@ -158,7 +158,6 @@ pub fn details_page(props: &DetailsPageProps) -> Html {
{"Unidades"}
- {// Maps all the units to generate the unit selection menu listing.units.iter().enumerate().map(|(index, unit)| { let cloned_selected_unit_handle = cloned_selected_unit_handle.clone(); @@ -195,6 +194,27 @@ pub fn details_page(props: &DetailsPageProps) -> Html { }).collect::() }
+
+ { + if let Some(unit) = listing.units.get(*cloned_selected_unit_handle) { + if unit.media.media_list.len() >= 1 { + html! { + + } + } else { + html! { +
{"No existen imágenes para esta Unidad."}
+ } + } + + } else { + html! { +
{"Esta unidad no existe. Esto No debería estar pasando."}
+ } + } + + } +