Compare commits
2 Commits
984bbda0c1
...
62d870521e
Author | SHA1 | Date |
---|---|---|
Emilia Allison | 62d870521e | |
Emilia Allison | e2ef9fa84d |
|
@ -558,7 +558,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "plate-tool"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"csv",
|
||||
"getrandom",
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
||||
use crate::components::states::{CurrentTransfer, MainState};
|
||||
|
||||
pub fn toggle_in_transfer_hashes_callback(
|
||||
main_dispatch: &Dispatch<MainState>,
|
||||
) -> Callback<web_sys::MouseEvent> {
|
||||
let main_dispatch = main_dispatch.clone();
|
||||
Callback::from(move |_| {
|
||||
main_dispatch.reduce_mut(|state| {
|
||||
state.preferences.in_transfer_hashes ^= true;
|
||||
})
|
||||
})
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
pub mod main_window_callbacks;
|
|
@ -12,17 +12,19 @@ use web_sys::{
|
|||
use yew::prelude::*;
|
||||
use yewdux::prelude::*;
|
||||
|
||||
use super::new_plate_dialog::NewPlateDialog;
|
||||
use super::plates::plate_container::PlateContainer;
|
||||
use super::states::{CurrentTransfer, MainState};
|
||||
use super::transfer_menu::{letters_to_num, RegionDisplay, TransferMenu};
|
||||
use super::tree::Tree;
|
||||
use crate::components::new_plate_dialog::NewPlateDialog;
|
||||
use crate::components::plates::plate_container::PlateContainer;
|
||||
use crate::components::states::{CurrentTransfer, MainState};
|
||||
use crate::components::transfer_menu::{letters_to_num, RegionDisplay, TransferMenu};
|
||||
use crate::components::tree::Tree;
|
||||
|
||||
use crate::data::csv::state_to_csv;
|
||||
use crate::data::plate_instances::PlateInstance;
|
||||
use crate::data::transfer::Transfer;
|
||||
use crate::data::transfer_region::{Region, TransferRegion};
|
||||
|
||||
use crate::components::callbacks::main_window_callbacks;
|
||||
|
||||
#[function_component]
|
||||
pub fn MainWindow() -> Html {
|
||||
let (main_state, main_dispatch) = use_store::<MainState>();
|
||||
|
@ -49,14 +51,7 @@ pub fn MainWindow() -> Html {
|
|||
});
|
||||
}
|
||||
|
||||
let toggle_in_transfer_hashes_callback = {
|
||||
let main_dispatch = main_dispatch.clone();
|
||||
Callback::from(move |_| {
|
||||
main_dispatch.reduce_mut(|state| {
|
||||
state.preferences.in_transfer_hashes ^= true;
|
||||
})
|
||||
})
|
||||
};
|
||||
let toggle_in_transfer_hashes_callback = main_window_callbacks::test(&main_dispatch);
|
||||
|
||||
let new_plate_dialog_is_open = use_state_eq(|| false);
|
||||
let new_plate_dialog_callback = {
|
||||
|
|
|
@ -4,3 +4,4 @@ pub mod plates;
|
|||
pub mod states;
|
||||
pub mod transfer_menu;
|
||||
pub mod tree;
|
||||
mod callbacks;
|
||||
|
|
Loading…
Reference in New Issue