mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
replace useLocalStorage
This commit is contained in:
parent
cb7ff9372e
commit
a5094b1fc0
@ -1,9 +1,9 @@
|
||||
import { useFeaturesArchive } from '../../hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
|
||||
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
||||
import { SortingRule } from 'react-table';
|
||||
import { usePageTitle } from '../../hooks/usePageTitle';
|
||||
import { usePageTitle } from 'hooks/usePageTitle';
|
||||
import { createLocalStorage } from 'utils/createLocalStorage';
|
||||
|
||||
const defaultSort: SortingRule<string> = { id: 'createdAt', desc: true };
|
||||
|
||||
@ -16,7 +16,7 @@ export const FeaturesArchiveTable = () => {
|
||||
} = useFeaturesArchive();
|
||||
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [storedParams, setStoredParams] = useLocalStorage(
|
||||
const { value, setValue } = createLocalStorage(
|
||||
'FeaturesArchiveTable:v1',
|
||||
defaultSort
|
||||
);
|
||||
@ -28,8 +28,8 @@ export const FeaturesArchiveTable = () => {
|
||||
loading={loading}
|
||||
searchParams={searchParams}
|
||||
setSearchParams={setSearchParams}
|
||||
storedParams={storedParams}
|
||||
setStoredParams={setStoredParams}
|
||||
storedParams={value}
|
||||
setStoredParams={setValue}
|
||||
refetch={refetchArchived}
|
||||
/>
|
||||
);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
||||
import { SortingRule } from 'react-table';
|
||||
import { useProjectFeaturesArchive } from '../../hooks/api/getters/useProjectFeaturesArchive/useProjectFeaturesArchive';
|
||||
import { createLocalStorage } from 'utils/createLocalStorage';
|
||||
|
||||
const defaultSort: SortingRule<string> = { id: 'archivedAt', desc: true };
|
||||
|
||||
@ -20,7 +20,7 @@ export const ProjectFeaturesArchiveTable = ({
|
||||
} = useProjectFeaturesArchive(projectId);
|
||||
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [storedParams, setStoredParams] = useLocalStorage(
|
||||
const { value, setValue } = createLocalStorage(
|
||||
`${projectId}:ProjectFeaturesArchiveTable`,
|
||||
defaultSort
|
||||
);
|
||||
@ -32,8 +32,8 @@ export const ProjectFeaturesArchiveTable = ({
|
||||
loading={loading}
|
||||
searchParams={searchParams}
|
||||
setSearchParams={setSearchParams}
|
||||
storedParams={storedParams}
|
||||
setStoredParams={setStoredParams}
|
||||
storedParams={value}
|
||||
setStoredParams={setValue}
|
||||
refetch={refetchArchived}
|
||||
/>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user