Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LIU9293 committed Jul 12, 2023
1 parent 9d68db4 commit 9f27feb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cargo run -p server
// web
dioxus serve --platform web
// desktop
// desktop, desktop router is not working, try to exclude router for desktop
dioxus serve --platform desktop
```

Expand Down
12 changes: 8 additions & 4 deletions packages/client/src/components/header.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dioxus::prelude::*;
use dioxus::html::MouseEvent;
use fermi::*;
// use dioxus_router::Link;
use dioxus_router::Link;
use dioxus_html_macro::html;
use shared::translate::TRANSLATION;

Expand Down Expand Up @@ -85,13 +85,17 @@ pub fn Header(cx: Scope) -> Element {
cx.render(html!(
<div class="navbar bg-base-100">
<div class="flex-1 font-bold px-4">
<a href="/">
<Link to="/">
<div class="text-xl">"Rust2048"</div>
</a>
</Link>
</div>
<div class="flex-none">
<ul class="menu menu-horizontal px-1 items-center gap-2">
<li><a href="/leaderboard">"Leaderboard"</a></li>
<li>
<Link to="/leaderboard">
"Leaderboard"
</Link>
</li>
<li>
<details>
<summary>"Theme"</summary>
Expand Down
14 changes: 7 additions & 7 deletions packages/client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ fn main() {

fn app(cx: Scope) -> Element {
use_init_atom_root(cx);
cx.render(rsx! (
Header{}
cx.render(rsx! (
Router {
Route { to: "/", Homepage{} }
Route { to: "/game", Game{} }
Route { to: "/leaderboard", Leaderboard{} }
Route { to: "", Homepage{} }
Header{}
Route { to: "/", Homepage{} }
Route { to: "/game", Game{} }
Route { to: "/leaderboard", Leaderboard{} }
Route { to: "", Homepage{} }
Footer{}
}
Footer{}
))
}

0 comments on commit 9f27feb

Please sign in to comment.