Did an oopsie, now it's fixed

This commit is contained in:
Guilleag01
2023-08-07 10:30:35 +02:00
parent 0db4d1b736
commit 9172002c34
2 changed files with 5 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ impl Component for App {
type Properties = ();
fn create(ctx: &Context<Self>) -> Self {
let mut game = Game::new(50, 40, 200);
let mut game = Game::new(10, 10, 10);
game.start_board();
// info!("\n{}", game.get_board().to_string());

View File

@@ -44,7 +44,7 @@ impl Component for Button {
class={if self.cell.is_hidden() {"button-hidden"} else {"button-shown"}}
onclick={self.link.callback(|_| Msg::Clicked)}
// oncontextmenu={self.link.callback(|_| Msg::Clicked)}
oncontextmenu={self.link.callback(|_| Msg::RightClicked)}
oncontextmenu={self.link.callback(|e: MouseEvent| {drop(e); Msg::RightClicked})}
// style={(if !self.cell.is_hidden() {format!("background-color: #2f2f2f; transition: background-color 0.5s; transition-delay: {}s;", self.cell.get_delay())} else {"".to_string()}).as_str()}
style={style}>
{ &self.cell.to_string() }
@@ -59,6 +59,9 @@ impl Component for Button {
// info!("hid (from cell): {}", format!("{:?}", self.cell.is_hidden()));
self.onsignal.emit(self.cell);
}
Msg::RightClicked => {
self.onsignal.emit(self.cell);
},
}
false
}