Skip to content

Commit 012a104

Browse files
committed
fix(node-filters): improve layout and button styles for search and refresh functionality
1 parent 59bfc34 commit 012a104

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

dashboard/src/components/nodes/node-filters.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ export const NodeFilters = ({ filters, onFilterChange, refetch, isFetching }: No
6666
}
6767

6868
return (
69-
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
70-
<div className="relative w-full md:w-[calc(100%/3-10px)]" dir={dir}>
71-
<SearchIcon className={cn('absolute', dir === 'rtl' ? 'right-2' : 'left-2', 'top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground')} />
69+
<div dir={dir} className="flex items-center gap-2 py-4 md:gap-4">
70+
<div className="relative w-full md:w-[calc(100%/3-10px)] flex" dir={dir}>
71+
<SearchIcon
72+
className={cn('absolute', dir === 'rtl' ? 'right-2' : 'left-2', 'top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground')}/>
7273
<Input
7374
placeholder={t('search')}
7475
value={search}
@@ -80,16 +81,22 @@ export const NodeFilters = ({ filters, onFilterChange, refetch, isFetching }: No
8081
onClick={clearSearch}
8182
className={cn('absolute', dir === 'rtl' ? 'left-2' : 'right-2', 'top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground')}
8283
>
83-
<X className="h-4 w-4" />
84+
<X className="h-4 w-4"/>
8485
</button>
8586
)}
8687
</div>
87-
88-
<div className="flex gap-2">
89-
<Button variant="outline" size="icon" onClick={handleManualRefresh} disabled={isFetching}>
90-
<RefreshCw className={cn('h-4 w-4', isFetching && 'animate-spin')} />
91-
</Button>
92-
</div>
88+
<Button size="icon-md"
89+
onClick={handleManualRefresh}
90+
variant="ghost"
91+
className={cn(
92+
'relative flex h-9 w-9 items-center justify-center border transition-all duration-200 md:h-10 md:w-10',
93+
isFetching && 'opacity-70',
94+
)}
95+
aria-label={t('autoRefresh.refreshNow')}
96+
title={t('autoRefresh.refreshNow')}
97+
>
98+
<RefreshCw className={cn('h-4 w-4', isFetching && 'animate-spin')}/>
99+
</Button>
93100
</div>
94101
)
95102
}

dashboard/src/components/nodes/nodes-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default function NodesList() {
154154
const nodesData = nodesResponse?.nodes || []
155155
const totalNodes = nodesResponse?.total || 0
156156
const totalPages = Math.ceil(totalNodes / NODES_PER_PAGE)
157-
const showLoadingSpinner = isLoading && isFirstLoadRef.current
157+
const showLoadingSpinner = isLoading && isFirstLoadRef.current || isFetching
158158
const isPageLoading = isChangingPage
159159

160160
return (

0 commit comments

Comments
 (0)