make host nav previous button permanent
This commit is contained in:
parent
3e086d11d9
commit
ae6a9cd2dd
|
|
@ -444,10 +444,6 @@ impl Component for Host {
|
||||||
HostMessage::Echo(ServerToHostMessage::Error(GameError::NoApprenticeMentor)),
|
HostMessage::Echo(ServerToHostMessage::Error(GameError::NoApprenticeMentor)),
|
||||||
self.send.clone(),
|
self.send.clone(),
|
||||||
);
|
);
|
||||||
let on_prev_click = callback::send_message(
|
|
||||||
HostMessage::InGame(HostGameMessage::PreviousState),
|
|
||||||
self.send.clone(),
|
|
||||||
);
|
|
||||||
let client_click = Callback::from(|_| {
|
let client_click = Callback::from(|_| {
|
||||||
if let Some(loc) = gloo::utils::document().location() {
|
if let Some(loc) = gloo::utils::document().location() {
|
||||||
let _ = loc.replace("/");
|
let _ = loc.replace("/");
|
||||||
|
|
@ -484,18 +480,29 @@ impl Component for Host {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
html! {
|
html! {
|
||||||
<nav class="debug-nav" style="z-index: 3;">
|
<>
|
||||||
<Button on_click={on_error_click}>{"error"}</Button>
|
<Button on_click={on_error_click}>{"error"}</Button>
|
||||||
<Button on_click={on_prev_click}>{"previous"}</Button>
|
|
||||||
{screen}
|
{screen}
|
||||||
<Button on_click={client_click}>{"client"}</Button>
|
<Button on_click={client_click}>{"client"}</Button>
|
||||||
<Button on_click={story_on_click}>{"story"}</Button>
|
<Button on_click={story_on_click}>{"story"}</Button>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let on_prev_click = callback::send_message(
|
||||||
|
HostMessage::InGame(HostGameMessage::PreviousState),
|
||||||
|
self.send.clone(),
|
||||||
|
);
|
||||||
|
let nav = self.big_screen.not().then(|| {
|
||||||
|
html! {
|
||||||
|
<nav class="host-nav" style="z-index: 3;">
|
||||||
|
<Button on_click={on_prev_click}>{"previous"}</Button>
|
||||||
|
{debug_nav}
|
||||||
</nav>
|
</nav>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
{debug_nav}
|
{nav}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{content}
|
{content}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue