refactor: Integrate PortalDropdown component into PageHeaderActions for improved dropdown management and layout consistency
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 17m4s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 17m4s
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
IconPlayerPlay,
|
||||
IconBolt
|
||||
} from '@tabler/icons-react';
|
||||
import PortalDropdown from './PortalDropdown.jsx';
|
||||
|
||||
function PageHeaderActions({
|
||||
loading = false,
|
||||
@@ -39,17 +40,19 @@ function PageHeaderActions({
|
||||
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
||||
</button>
|
||||
{(onBackgroundUpdate && onOnlineUpdate) && (
|
||||
<>
|
||||
<button className="btn btn-outline-success dropdown-toggle dropdown-toggle-split" type="button" data-bs-toggle="dropdown" data-bs-container="body" aria-expanded="false" aria-label="Другие варианты обновления"></button>
|
||||
<div className="dropdown-menu">
|
||||
<button className="dropdown-item" type="button" onClick={onBackgroundUpdate}>
|
||||
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
||||
</button>
|
||||
<button className="dropdown-item" type="button" onClick={onOnlineUpdate}>
|
||||
<IconBolt className="me-1" /> Online-обновление
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
<PortalDropdown
|
||||
buttonClassName="btn btn-outline-success dropdown-toggle dropdown-toggle-split"
|
||||
buttonProps={{ 'aria-label': 'Другие варианты обновления' }}
|
||||
align="right"
|
||||
buttonContent={null}
|
||||
>
|
||||
<button className="dropdown-item" type="button" onClick={onBackgroundUpdate}>
|
||||
<IconPlayerPlay className="me-1" /> Фоновое обновление
|
||||
</button>
|
||||
<button className="dropdown-item" type="button" onClick={onOnlineUpdate}>
|
||||
<IconBolt className="me-1" /> Online-обновление
|
||||
</button>
|
||||
</PortalDropdown>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
@@ -63,10 +66,12 @@ function PageHeaderActions({
|
||||
)}
|
||||
{(onImport || onExport) && (
|
||||
<div className="dropdown">
|
||||
<button className="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" data-bs-container="body" aria-expanded="false" title="Импорт/Экспорт">
|
||||
<IconDownload className="me-1" /> Импорт/Экспорт
|
||||
</button>
|
||||
<div className="dropdown-menu">
|
||||
<PortalDropdown
|
||||
buttonClassName="btn btn-outline-primary dropdown-toggle"
|
||||
buttonProps={{ title: 'Импорт/Экспорт' }}
|
||||
align="left"
|
||||
buttonContent={<><IconDownload className="me-1" /> Импорт/Экспорт</>}
|
||||
>
|
||||
{onImport && (
|
||||
<button className="dropdown-item" type="button" onClick={onImport}>
|
||||
<IconUpload className="me-1" /> Импорт
|
||||
@@ -77,7 +82,7 @@ function PageHeaderActions({
|
||||
<IconDownload className="me-1" /> Экспорт
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</PortalDropdown>
|
||||
</div>
|
||||
)}
|
||||
{onClear && (
|
||||
|
||||
Reference in New Issue
Block a user