Skip to content

Commit

Permalink
refactor(renterd): bulk menu naming
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Nov 27, 2024
1 parent c8c9a01 commit e940fdc
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useDialog } from '../../../contexts/dialog'
import { useContracts } from '../../../contexts/contracts'
import { pluralize } from '@siafoundation/units'

export function ContractsBatchDelete() {
export function ContractsBulkDelete() {
const { multiSelect } = useContracts()

const ids = useMemo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { MultiSelectionMenu } from '@siafoundation/design-system'
import { useContracts } from '../../../contexts/contracts'
import { ContractsBatchDelete } from './ContractsBatchDelete'
import { ContractsBulkDelete } from './ContractsBulkDelete'
import { ContractsAddBlocklist } from './ContractsAddBlocklist'
import { ContractsAddAllowlist } from './ContractsAddAllowlist'
import { ContractsRemoveBlocklist } from './ContractsRemoveBlocklist'
import { ContractsRemoveAllowlist } from './ContractsRemoveAllowlist'

export function ContractsBatchMenu() {
export function ContractsBulkMenu() {
const { multiSelect } = useContracts()

return (
Expand All @@ -19,7 +19,7 @@ export function ContractsBatchMenu() {
<ContractsRemoveAllowlist />
<ContractsRemoveBlocklist />
</div>
<ContractsBatchDelete />
<ContractsBulkDelete />
</MultiSelectionMenu>
)
}
4 changes: 2 additions & 2 deletions apps/renterd/components/Contracts/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../RenterdAuthedLayout'
import { ContractsActionsMenu } from './ContractsActionsMenu'
import { ContractsFilterBar } from './ContractsFilterBar'
import { ContractsBatchMenu } from './ContractsBatchMenu'
import { ContractsBulkMenu } from './ContractsBulkMenu'

export const Layout = RenterdAuthedLayout
export function useLayoutProps(): RenterdAuthedPageLayoutProps {
Expand All @@ -21,6 +21,6 @@ export function useLayoutProps(): RenterdAuthedPageLayoutProps {
stats: <ContractsFilterBar />,
size: 'full',
scroll: false,
dockedControls: <ContractsBatchMenu />,
dockedControls: <ContractsBulkMenu />,
}
}
8 changes: 4 additions & 4 deletions apps/renterd/components/Files/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
} from '../RenterdAuthedLayout'
import { FilesActionsMenu } from '../FilesDirectory/FilesActionsMenu'
import { FilesStatsMenu } from '../FilesDirectory/FilesStatsMenu'
import { FilesDirectoryDockedControls } from '../FilesDirectory/FilesDirectoryDockedControls'
import { FilesDirectoryBulkMenu } from '../FilesDirectory/FilesDirectoryBulkMenu'
import { useFilesManager } from '../../contexts/filesManager'
import { FilesFlatDockedControls } from '../FilesFlat/FilesFlatDockedControls'
import { FilesFlatBulkMenu } from '../FilesFlat/FilesFlatBulkMenu'

export const Layout = RenterdAuthedLayout
export function useLayoutProps(): RenterdAuthedPageLayoutProps {
Expand All @@ -31,7 +31,7 @@ export function useLayoutProps(): RenterdAuthedPageLayoutProps {
nav: <FilesDirectoryBreadcrumbMenu />,
stats: <FilesStatsMenu />,
actions: <FilesActionsMenu />,
dockedControls: <FilesDirectoryDockedControls />,
dockedControls: <FilesDirectoryBulkMenu />,
}
}

Expand All @@ -44,6 +44,6 @@ export function useLayoutProps(): RenterdAuthedPageLayoutProps {
nav: <FilesFlatBreadcrumbMenu />,
stats: <FilesStatsMenu />,
actions: <FilesActionsMenu />,
dockedControls: <FilesFlatDockedControls />,
dockedControls: <FilesFlatBulkMenu />,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useObjectsRemove } from '@siafoundation/renterd-react'
import { ObjectData } from '../../../contexts/filesManager/types'
import { pluralize } from '@siafoundation/units'

export function FilesBatchDelete({
export function FilesBulkDelete({
multiSelect,
}: {
multiSelect: MultiSelect<ObjectData>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FolderMoveTo16 } from '@siafoundation/react-icons'
import { useFilesDirectory } from '../../../contexts/filesDirectory'
import { useDialog } from '../../../contexts/dialog'

export function FilesBatchMove() {
export function FilesBulkMove() {
const { openConfirmDialog } = useDialog()
const { multiSelect, moveSelectedFiles, moveSelectedFilesOperationCount } =
useFilesDirectory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { MultiSelectionMenu } from '@siafoundation/design-system'
import { FilesBatchDelete } from '../../Files/batchActions/FilesBatchDelete'
import { FilesBulkDelete } from '../../Files/bulkActions/FilesBulkDelete'
import { useFilesDirectory } from '../../../contexts/filesDirectory'
import { FilesBatchMove } from './FilesBatchMove'
import { FilesBulkMove } from './FilesBulkMove'

export function FilesDirectoryBatchMenu() {
export function FilesDirectoryBulkMenu() {
const { multiSelect } = useFilesDirectory()

return (
<MultiSelectionMenu multiSelect={multiSelect} entityWord="file">
<FilesBatchMove />
<FilesBatchDelete multiSelect={multiSelect} />
<FilesBulkMove />
<FilesBulkDelete multiSelect={multiSelect} />
</MultiSelectionMenu>
)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { MultiSelectionMenu } from '@siafoundation/design-system'
import { FilesBatchDelete } from '../../Files/batchActions/FilesBatchDelete'
import { FilesBulkDelete } from '../../Files/bulkActions/FilesBulkDelete'
import { useFilesFlat } from '../../../contexts/filesFlat'

export function FilesFlatBatchMenu() {
export function FilesFlatBulkMenu() {
const { multiSelect } = useFilesFlat()

return (
<MultiSelectionMenu multiSelect={multiSelect} entityWord="file">
<FilesBatchDelete multiSelect={multiSelect} />
<FilesBulkDelete multiSelect={multiSelect} />
</MultiSelectionMenu>
)
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HostsRemoveBlocklist } from './HostsRemoveBlocklist'
import { HostsRemoveAllowlist } from './HostsRemoveAllowlist'
import { useHosts } from '../../../contexts/hosts'

export function HostsBatchMenu() {
export function HostsBulkMenu() {
const { multiSelect } = useHosts()

return (
Expand Down
4 changes: 2 additions & 2 deletions apps/renterd/components/Hosts/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../RenterdAuthedLayout'
import { HostsActionsMenu } from './HostsActionsMenu'
import { HostsFilterBar } from './HostsFilterBar'
import { HostsBatchMenu } from './HostsBatchMenu'
import { HostsBulkMenu } from './HostsBulkMenu'

export const Layout = RenterdAuthedLayout
export function useLayoutProps(): RenterdAuthedPageLayoutProps {
Expand All @@ -21,6 +21,6 @@ export function useLayoutProps(): RenterdAuthedPageLayoutProps {
actions: <HostsActionsMenu />,
stats: <HostsFilterBar />,
scroll: false,
dockedControls: <HostsBatchMenu />,
dockedControls: <HostsBulkMenu />,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { omit } from '@technically/lodash'
import { useDialog } from '../../../contexts/dialog'
import { useKeys } from '../../../contexts/keys'

export function KeysBatchDelete() {
export function KeysBulkDelete() {
const { multiSelect } = useKeys()

const keys = useMemo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { MultiSelectionMenu } from '@siafoundation/design-system'
import { useKeys } from '../../../contexts/keys'
import { KeysBatchDelete } from './KeysBatchDelete'
import { KeysBulkDelete } from './KeysBulkDelete'

export function KeysBatchMenu() {
export function KeysBulkMenu() {
const { multiSelect } = useKeys()

return (
<MultiSelectionMenu multiSelect={multiSelect} entityWord="key">
<KeysBatchDelete />
<KeysBulkDelete />
</MultiSelectionMenu>
)
}
5 changes: 0 additions & 5 deletions apps/renterd/components/Keys/KeysDockedControls.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions apps/renterd/components/Keys/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../RenterdAuthedLayout'
import { KeysActionsMenu } from './KeysActionsMenu'
import { KeysStatsMenu } from './KeysStatsMenu'
import { KeysDockedControls } from './KeysDockedControls'
import { KeysBulkMenu } from './KeysBulkMenu'

export const Layout = RenterdAuthedLayout
export function useLayoutProps(): RenterdAuthedPageLayoutProps {
Expand All @@ -19,6 +19,6 @@ export function useLayoutProps(): RenterdAuthedPageLayoutProps {
openSettings: () => openDialog('settings'),
actions: <KeysActionsMenu />,
stats: <KeysStatsMenu />,
dockedControls: <KeysDockedControls />,
dockedControls: <KeysBulkMenu />,
}
}

0 comments on commit e940fdc

Please sign in to comment.