Skip to content

Commit 31e8ef7

Browse files
authored
fixes to table dashboard (#90)
Co-authored-by: pourhakimi <84860195+pourhakimi@users.noreply.github.com>
1 parent 71598de commit 31e8ef7

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

table_dashboard/table_dashboard/components/header.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,31 @@ def header() -> rx.Component:
4949
class_name="relative",
5050
),
5151
rx.el.div(
52-
rx.icon(
53-
tag="search",
54-
size=18,
55-
class_name="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",
52+
rx.el.div(
53+
rx.icon(
54+
tag="search",
55+
size=18,
56+
class_name="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",
57+
),
58+
rx.el.input(
59+
placeholder="Search by owner...",
60+
on_change=DashboardState.set_search_owner.debounce(300),
61+
class_name="pl-10 pr-4 py-1.5 border border-gray-300 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
62+
default_value=DashboardState.search_owner,
63+
),
64+
class_name="relative flex items-center -ml-2 sm:ml-0",
5665
),
57-
rx.el.input(
58-
placeholder="Search by owner...",
59-
on_change=DashboardState.set_search_owner.debounce(300),
60-
class_name="pl-10 pr-4 py-1.5 border border-gray-300 rounded w-64 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
61-
default_value=DashboardState.search_owner,
66+
rx.el.button(
67+
"Reset All",
68+
on_click=DashboardState.reset_all_filters,
69+
class_name="px-3 py-1.5 border border-gray-300 rounded text-sm text-gray-700 hover:bg-gray-50",
70+
disabled=(DashboardState.search_owner == "")
71+
& (DashboardState.selected_statuses.length() == 0)
72+
& (DashboardState.selected_regions.length() == 0)
73+
& (DashboardState.min_cost is None)
74+
& (DashboardState.max_cost is None),
6275
),
63-
class_name="relative flex items-center",
64-
),
65-
rx.el.button(
66-
"Reset All",
67-
on_click=DashboardState.reset_all_filters,
68-
class_name="px-3 py-1.5 border border-gray-300 rounded text-sm text-gray-700 hover:bg-gray-50",
69-
disabled=(DashboardState.search_owner == "")
70-
& (DashboardState.selected_statuses.length() == 0)
71-
& (DashboardState.selected_regions.length() == 0)
72-
& (DashboardState.min_cost is None)
73-
& (DashboardState.max_cost is None),
76+
class_name="flex flex-row items-center justify-start gap-x-2",
7477
),
7578
class_name="flex items-center space-x-2 flex-wrap gap-y-2",
7679
),

table_dashboard/table_dashboard/components/sidebar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ def sidebar() -> rx.Component:
121121
),
122122
class_name="border-t border-gray-200",
123123
),
124-
class_name="w-64 border-r border-gray-200 flex flex-col h-screen",
124+
class_name="w-full max-w-[250px] border-r border-gray-200 flex flex-col h-screen sticky top-0 left-0 max-lg:hidden",
125125
)

0 commit comments

Comments
 (0)