🚚(app-impress) rename usePadStore to usePadPanelStore

This commit renames the `usePadStore`
to `usePadPanelStore` to better
reflect the purpose of the store.
This commit is contained in:
Anthony LC
2024-04-08 17:44:20 +02:00
committed by Anthony LC
parent 75bb4b36d4
commit a4e8bbd26e
4 changed files with 7 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ import { InfiniteScroll } from '@/components/InfiniteScroll';
import { Pad } from '@/features/pads/pad';
import { usePads } from '../api';
import { usePadStore } from '../store';
import { usePadPanelStore } from '../store';
import { PadItem } from './PadItem';
@@ -57,7 +57,7 @@ const PadListState = ({ isLoading, isError, pads }: PanelTeamsStateProps) => {
};
export const PadList = () => {
const ordering = usePadStore((state) => state.ordering);
const ordering = usePadPanelStore((state) => state.ordering);
const {
data,
isError,

View File

@@ -7,11 +7,11 @@ import { useCunninghamTheme } from '@/cunningham';
import { PadsOrdering } from '../api';
import IconAdd from '../assets/icon-add.svg';
import IconSort from '../assets/icon-sort.svg';
import { usePadStore } from '../store';
import { usePadPanelStore } from '../store';
export const PanelActions = () => {
const { t } = useTranslation();
const { changeOrdering, ordering } = usePadStore();
const { changeOrdering, ordering } = usePadPanelStore();
const { colorsTokens } = useCunninghamTheme();
const isSortAsc = ordering === PadsOrdering.BY_CREATED_ON;

View File

@@ -1 +1 @@
export * from './usePadStore';
export * from './usePadPanelStore';

View File

@@ -2,12 +2,12 @@ import { create } from 'zustand';
import { PadsOrdering } from '../api/usePads';
interface PadStore {
interface PadPanelStore {
ordering: PadsOrdering;
changeOrdering: () => void;
}
export const usePadStore = create<PadStore>((set) => ({
export const usePadPanelStore = create<PadPanelStore>((set) => ({
ordering: PadsOrdering.BY_CREATED_ON_DESC,
changeOrdering: () =>
set(({ ordering }) => ({