♻️ Add Account, Room and Space UI store structs
This commit is contained in:
24
src/ui/store/space.rs
Normal file
24
src/ui/store/space.rs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user