♻️ Add Account, Room and Space UI store structs

This commit is contained in:
2024-05-11 15:24:49 +02:00
parent bc6b02bc34
commit 18a797bc3f
12 changed files with 152 additions and 183 deletions

24
src/ui/store/space.rs Normal file
View File

@@ -0,0 +1,24 @@
use std::cell::RefCell;
use dioxus::prelude::*;
use crate::domain::model::{space::SpaceId, store_interface::SpaceStoreProviderInterface};
#[modx::props(id, name)]
#[modx::store]
pub struct Space {
id: SpaceId,
name: Option<String>,
}
impl PartialEq for Space {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl SpaceStoreProviderInterface for RefCell<Space> {
fn set_name(&self, name: Option<String>) {
self.borrow_mut().name.set(name);
}
}