This commit is contained in:
Mary Hipp 2024-01-17 15:13:01 -05:00 committed by psychedelicious
parent 415a1c7a4f
commit c9ddbb4241
4 changed files with 10 additions and 11 deletions

View File

@ -1,13 +1,13 @@
import { Divider, Flex } from '@chakra-ui/layout';
import type { SystemStyleObject } from '@chakra-ui/react';
import { Collapse, Icon, useDisclosure } from '@chakra-ui/react';
import { useAppDispatch } from 'app/store/storeHooks';
import type { InvExpanderProps } from 'common/components/InvExpander/types';
import { InvText } from 'common/components/InvText/wrapper';
import { expanderToggled } from 'features/parameters/store/actions';
import { t } from 'i18next';
import { useCallback } from 'react';
import { BiCollapseVertical, BiExpandVertical } from 'react-icons/bi';
import { useAppDispatch } from '../../../app/store/storeHooks';
import { expanderToggled } from '../../../features/parameters/store/actions';
const buttonStyles: SystemStyleObject = {
color: 'base.400',

View File

@ -3,6 +3,5 @@ import type { PropsWithChildren } from 'react';
export type InvExpanderProps = PropsWithChildren<{
label?: string;
defaultIsOpen?: boolean;
onClick?: (isOpen: boolean) => void;
id?: string;
}>;

View File

@ -1,14 +1,14 @@
import { useAppDispatch } from 'app/store/storeHooks';
import { InvAccordionButton } from 'common/components/InvAccordion/InvAccordionButton';
import {
InvAccordion,
InvAccordionItem,
InvAccordionPanel,
} from 'common/components/InvAccordion/wrapper';
import { singleAccordionExpanded } from 'features/parameters/store/actions';
import { memo, useCallback } from 'react';
import type { InvSingleAccordionProps } from './types';
import { singleAccordionExpanded } from '../../../features/parameters/store/actions';
import { useAppDispatch } from '../../../app/store/storeHooks';
export const InvSingleAccordion = memo((props: InvSingleAccordionProps) => {
const dispatch = useAppDispatch();
@ -18,7 +18,7 @@ export const InvSingleAccordion = memo((props: InvSingleAccordionProps) => {
dispatch(singleAccordionExpanded({ id: props.id, isOpen }));
}
},
[props]
[props, dispatch]
);
return (

View File

@ -9,10 +9,10 @@ export const modelSelected = createAction<MainModelField>(
'generation/modelSelected'
);
export const expanderToggled = createAction<{ id: string, isOpen: boolean }>(
export const expanderToggled = createAction<{ id: string; isOpen: boolean }>(
'parameters/expanderToggled'
);
export const singleAccordionExpanded = createAction<{ id: string, isOpen: boolean }>(
'parameters/singleAccordionExpanded'
);
export const singleAccordionExpanded = createAction<{
id: string;
isOpen: boolean;
}>('parameters/singleAccordionExpanded');