changed unit details and added admin tag to project comp

This commit is contained in:
Franklin 2023-04-24 13:23:17 -04:00
parent cd9b53a05d
commit 81c826c099
4 changed files with 11 additions and 9 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -7,8 +7,6 @@ use crate::{
routes::main_router::Route,
};
//TODO: Add admin tag
#[function_component(AdminProject)]
pub fn admin_project(props: &AdminProjectProps) -> Html {
let navigator = use_navigator().unwrap();
@ -50,9 +48,12 @@ pub fn admin_project(props: &AdminProjectProps) -> Html {
{props.project.project_condition.clone()}
</div>
<div class={"admin-project-column"}>
{match props.project.project_state {
ProjectState::InConstruction => "En Construcción",
ProjectState::Finished => "Terminado",
{match props.project.admin_tag.clone() {
Some(admin_tag) => {admin_tag},
None => match props.project.project_state {
ProjectState::InConstruction => String::from("En Construcción"),
ProjectState::Finished => String::from("Terminado"),
}
}}
</div>
<div class={if *is_attempting_delete {"admin-project-trash-bin-selected"} else {"admin-project-trash-bin"}} onclick={delete_project}>

View File

@ -12,7 +12,7 @@ use crate::{
pub fn admin_project(props: &AdminUnitProps) -> Html {
let navigator = use_navigator().unwrap();
let price_usd = format!(
"Desde US${}",
"${}",
{
let price_separated = props.unit.price_usd.separate_with_commas();
if price_separated.contains(".") {
@ -59,10 +59,10 @@ pub fn admin_project(props: &AdminUnitProps) -> Html {
}}
</div>
<div class={"admin-project-column"}>
{props.unit.rooms.clone()}
{format!("{} habs.", props.unit.rooms.clone())}
</div>
<div class={"admin-project-column"}>
{props.unit.bathrooms.clone()}
{format!("{} baños", props.unit.bathrooms.clone())}
</div>
<div class={if *is_attempting_delete {"admin-project-trash-bin-selected"} else {"admin-project-trash-bin"}} onclick={delete_unit}>
<i class="fa-regular fa-trash-can"></i>

View File

@ -1,6 +1,6 @@
use yew::prelude::*;
use crate::{api::backend::get_all_agents, components::{admin_nav_bar::AdminNavigationBar, admin_agent::AdminAgent}};
use crate::{api::backend::get_all_agents, components::{admin_nav_bar::AdminNavigationBar, admin_agent::AdminAgent, new_widget::NewThingWidget}, pages::admin::edit::EditItem};
#[function_component(AdminAgents)]
pub fn admin_agents() -> Html {
@ -21,6 +21,7 @@ pub fn admin_agents() -> Html {
html! {
<>
<AdminNavigationBar/>
<NewThingWidget item={EditItem::Agent}/>
<div class={"admin-page-container"}>
<div class={"admin-start-container"}>
<div class={"admin-panel-page-title"}>{"Agentes"}</div>