diff --git a/css/admin-agents.css b/css/admin-agents.css new file mode 100644 index 0000000..e69de29 diff --git a/css/admin-contacts.css b/css/admin-contacts.css new file mode 100644 index 0000000..e69de29 diff --git a/css/admin-projects.css b/css/admin-projects.css new file mode 100644 index 0000000..b5e4501 --- /dev/null +++ b/css/admin-projects.css @@ -0,0 +1,9 @@ +.admin-projects-table { + display: flex; + flex-direction: column; + justify-content: center; + align-items: space-evenly; + gap: 5px; + + width: 90%; +} \ No newline at end of file diff --git a/css/components/admin_project.css b/css/components/admin_project.css new file mode 100644 index 0000000..9cdc363 --- /dev/null +++ b/css/components/admin_project.css @@ -0,0 +1,60 @@ +.admin-project-container { + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + gap: 5px; + + height: 40px; + width: 100%; +} +.admin-project-container:hover { + cursor: pointer; + background-color: #02104a51; + border-radius: 3px; + transition-duration: 0.3s; +} +.admin-project-trash-bin { + display: flex; + justify-content: center; + align-items: center; + font-size: 13px; + width: 25px; + height: 25px; +} +.admin-project-trash-bin-selected { + display: flex; + justify-content: center; + align-items: center; + + border-radius: 3px; + font-size: 13px; + background-color: #e32; + color: white; + width: 25px; + height: 25px; +} +.admin-project-trash-bin:hover { + cursor: pointer; +} +.admin-project-location { + font-size: 13px; + font-family: Source Sans Pro; + font-weight: 100; + text-align: start; + width: 150px; +} +.admin-project-column { + font-size: 13px; + font-family: Source Sans Pro; + font-weight: 100; + text-align: start; + width: 100px; +} +.admin-project-index { + font-size: 13px; + font-family: Source Sans Pro; + font-weight: 100; + text-align: start; + width: 15px; +} diff --git a/css/edit.css b/css/edit.css new file mode 100644 index 0000000..5798af9 --- /dev/null +++ b/css/edit.css @@ -0,0 +1,24 @@ +.admin-project-fields-container { + display: flex; + flex-direction: column; + justify-content: start; + align-items: center; + gap: 20px; + + width: 90%; +} + +.admin-project-field-container { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + + width: 100%; +} + +.admin-project-field-label { + font-family: Source Sans Pro; + font-size: 16px; + text-align: center; +} \ No newline at end of file diff --git a/index.html b/index.html index a26d2c5..641bffe 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,10 @@ + + + + @@ -23,6 +27,7 @@ + diff --git a/src/components/admin_project.rs b/src/components/admin_project.rs new file mode 100644 index 0000000..3cc0195 --- /dev/null +++ b/src/components/admin_project.rs @@ -0,0 +1,62 @@ +use jl_types::{dto::project_card::ProjectCardDto, domain::project_state::ProjectState}; +use yew::prelude::*; +use yew_router::{prelude::use_navigator}; + +use crate::{routes::main_router::Route, pages::admin::edit::{EditType, EditItem}}; + +#[function_component(AdminProject)] +pub fn admin_project(props: &AdminProjectProps) -> Html { + let navigator = use_navigator().unwrap(); + let location_formatted = format!("{}, {}", props.project.city, props.project.district); + let is_attempting_delete = use_state(|| false); + let delete_project = { + let is_attempting_delete = is_attempting_delete.clone(); + Callback::from(move |event: MouseEvent| { + if *is_attempting_delete { + // Call delete + is_attempting_delete.set(false); + } else { + is_attempting_delete.set(true); + } + event.stop_propagation(); + }) + }; + let onclick_item = { + let props = props.clone(); + Callback::from(move |_| { + navigator.push(&Route::AdminEdit { edit_type: EditType::Existing(props.project.id), edit_item: EditItem::Project }); + }) + }; + html! { +