@@ -9,27 +9,21 @@ pub fn App() -> impl IntoView {
9
9
provide_meta_context ( ) ;
10
10
11
11
view ! {
12
-
13
- // injects a stylesheet into the document <head>
14
- // id=leptos means cargo-leptos will hot-reload this stylesheet
15
- <Stylesheet id="leptos" href="/pkg/supermailer.css" />
16
- <Link rel="shortcut icon" type_="image/ico" href="/favicon.ico" />
12
+ <Stylesheet id="leptos" href="/pkg/supermailer.css" />
13
+ <Link rel="shortcut icon" type_="image/ico" href="/favicon.ico" />
17
14
18
15
// sets the document title
19
- <Title text="Welcome to Leptos" />
16
+ <Title text="Welcome to Leptos" />
20
17
21
18
// content for this welcome page
22
19
<Router fallback=|| {
23
20
let mut outside_errors = Errors :: default ( ) ;
24
21
outside_errors. insert_with_default_key( AppError :: NotFound ) ;
25
- view! {
26
- <ErrorTemplate outside_errors/>
27
- }
28
- . into_view( )
22
+ view! { <ErrorTemplate outside_errors /> } . into_view( )
29
23
} >
30
24
<main>
31
25
<Routes >
32
- <Route path="" view=HomePage />
26
+ <Route path="/ " view=HomePage />
33
27
</Routes >
34
28
</main>
35
29
</Router >
@@ -44,8 +38,9 @@ fn HomePage() -> impl IntoView {
44
38
let on_click = move |_| set_count. update ( |count| * count += 1 ) ;
45
39
46
40
view ! {
47
- <div class="bg-green-100" >
48
- <div class="flex flex-col items-center justify-center min-h-screen" >
41
+ <div class="bg-gray-800" >
42
+ <ProgressNav />
43
+ <div class="text-white flex flex-col justify-center items-center min-h-screen" >
49
44
<h1>"Welcome to Leptos!" </h1>
50
45
<button on: click=on_click>"Click Me: " { count} </button>
51
46
<Home />
@@ -60,21 +55,36 @@ fn Home() -> impl IntoView {
60
55
61
56
// thanks to https://tailwindcomponents.com/component/blue-buttons-example for the showcase layout
62
57
view ! {
63
- <Title text="Leptos + Tailwindcss" />
58
+ <Title text="Leptos + Tailwindcss" />
64
59
<main>
65
- <div class="bg-gradient-to-tl from-blue-800 to-blue-500 text-white font-mono " >
60
+ <div class="font-mono text-white bg-gradient-to-tl from-blue-800 to-blue-500" >
66
61
<div class="flex" >
67
- <button on: click=move |_| set_value. update( |value| * value += 1 ) class="rounded px-3 py-2 m-1 border-b-4 border-l-2 shadow-lg bg-blue-700 border-blue-800 text-white" >
62
+ <button
63
+ on: click=move |_| set_value. update( |value| * value += 1 )
64
+ class="py-2 px-3 m-1 text-white bg-blue-700 rounded border-l-2 border-b-4 border-blue-800 shadow-lg"
65
+ >
68
66
"+"
69
67
</button>
70
- <button class="rounded px-3 py-2 m-1 border-b-4 border-l-2 shadow-lg bg-blue-800 border-blue-900 text-white " >
68
+ <button class="py-2 px-3 m-1 text-white bg-blue-800 rounded border-l-2 border-b-4 border-blue-900 shadow-lg " >
71
69
{ value}
72
70
</button>
73
- <button on: click=move |_| set_value. update( |value| * value -= 1 ) class="rounded px-3 py-2 m-1 border-b-4 border-l-2 shadow-lg bg-blue-700 border-blue-800 text-white" >
71
+ <button
72
+ on: click=move |_| set_value. update( |value| * value -= 1 )
73
+ class="py-2 px-3 m-1 text-white bg-blue-700 rounded border-l-2 border-b-4 border-blue-800 shadow-lg"
74
+ >
74
75
"-"
75
76
</button>
76
77
</div>
77
78
</div>
78
79
</main>
79
80
}
80
- }
81
+ }
82
+
83
+ #[ component]
84
+ fn ProgressNav ( ) -> impl IntoView {
85
+ view ! {
86
+ <div class="fixed top-0 right-0 left-0 h-0.5 bg-white" >
87
+ <div class="bg-gray-900 h-0.5 w-1/3" />
88
+ </div>
89
+ }
90
+ }
0 commit comments