Skip to content

Commit c94a0f3

Browse files
committed
fix: add some design fix
1 parent fa68a50 commit c94a0f3

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

src/app.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ pub fn App() -> impl IntoView {
3131
view! {
3232
<div class="flex h-screen">
3333
<Sidebar/>
34-
<div>
35-
<main>
34+
<div class="flex flex-col flex-1 overflow-hidden">
35+
<main class="flex-1 overflow-y-scroll">
3636
<Tabs value=tabs.selected_tab>
3737
<For
3838
each=move || (0..tabs.active_tabs.get())
@@ -66,8 +66,8 @@ pub fn App() -> impl IntoView {
6666
"+"
6767
</Button>
6868
</main>
69+
<Footer/>
6970
</div>
70-
<Footer/>
7171
</div>
7272
}
7373
}

src/footer.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,16 @@ pub fn Footer() -> impl IntoView {
2323
<div class="flex flex-row gap-1 items-center text-xs">
2424
<p>{formatted_timer}</p>
2525
<button
26-
class=if table_view() == QueryTableLayout::Records {
27-
"p-1 hover:bg-gray-300 rounded-full bg-gray-300"
28-
} else {
29-
"p-1 hover:bg-gray-300 rounded-full"
30-
}
31-
26+
class="p-1 hover:bg-gray-300 rounded-full"
27+
class=("bg-gray-300", move || table_view() == QueryTableLayout::Records)
3228
on:click=move |_| table_view.set(QueryTableLayout::Records)
3329
>
3430

3531
<Icon icon=icondata::HiBars4OutlineLg width="16" height="16"/>
3632
</button>
3733
<button
38-
class=if table_view() == QueryTableLayout::Grid {
39-
"p-1 hover:bg-gray-300 rounded-full bg-gray-300"
40-
} else {
41-
"p-1 hover:bg-gray-300 rounded-full"
42-
}
43-
34+
class="p-1 hover:bg-gray-300 rounded-full"
35+
class=("bg-gray-300", move || table_view() == QueryTableLayout::Grid)
4436
on:click=move |_| table_view.set(QueryTableLayout::Grid)
4537
>
4638
<Icon icon=icondata::HiTableCellsOutlineLg width="16" height="16"/>

src/sidebar/index.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub fn Sidebar() -> impl IntoView {
3939
view! {
4040
<div
4141
_ref=node_ref
42-
classes="flex border-r-1 min-w-[320px] justify-between border-neutral-200 flex-col p-4"
42+
class="flex border-r-1 min-w-[320px] justify-between border-neutral-200 flex-col p-4"
4343
>
4444
<Connection show=show/>
45-
<div classes="flex flex-col overflow-auto">
46-
<div classes="flex flex-row justify-between items-center">
47-
<p classes="font-semibold text-lg">Projects</p>
45+
<div class="flex flex-col overflow-auto">
46+
<div class="flex flex-row justify-between items-center">
47+
<p class="font-semibold text-lg">Projects</p>
4848
<button
49-
classes="px-2 rounded-full hover:bg-gray-200"
49+
class="px-2 rounded-full hover:bg-gray-200"
5050
on:click=move |_| show.set(true)
5151
>
5252
"+"
@@ -58,9 +58,9 @@ pub fn Sidebar() -> impl IntoView {
5858
children=|(project, _)| view! { <Project project=project/> }
5959
/>
6060
</div>
61-
<div classes="py-2">
62-
<p classes="font-semibold text-lg">Saved Queries</p>
63-
<div classes="text-sm">
61+
<div class="py-2">
62+
<p class="font-semibold text-lg">Saved Queries</p>
63+
<div class="text-sm">
6464
<Queries/>
6565
</div>
6666
</div>

0 commit comments

Comments
 (0)