🚚(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:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './usePadStore';
|
||||
export * from './usePadPanelStore';
|
||||
|
||||
@@ -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 }) => ({
|
||||
Reference in New Issue
Block a user