Change to using arrow functions (#1603)
* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -33,7 +33,7 @@ const StyledContainerActionBar = styled.div`
|
||||
z-index: 1;
|
||||
`;
|
||||
|
||||
export function ActionBar({ selectedIds }: OwnProps) {
|
||||
export const ActionBar = ({ selectedIds }: OwnProps) => {
|
||||
const actionBarOpen = useRecoilValue(actionBarOpenState);
|
||||
const contextMenuIsOpen = useRecoilValue(contextMenuIsOpenState);
|
||||
const actionBarEntries = useRecoilValue(actionBarEntriesState);
|
||||
@ -55,4 +55,4 @@ export function ActionBar({ selectedIds }: OwnProps) {
|
||||
))}
|
||||
</StyledContainerActionBar>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -39,12 +39,12 @@ const StyledButtonLabel = styled.div`
|
||||
margin-left: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
export function ActionBarItem({
|
||||
export const ActionBarItem = ({
|
||||
label,
|
||||
Icon,
|
||||
accent = 'standard',
|
||||
onClick,
|
||||
}: OwnProps) {
|
||||
}: OwnProps) => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<StyledButton accent={accent} onClick={onClick}>
|
||||
@ -52,4 +52,4 @@ export function ActionBarItem({
|
||||
<StyledButtonLabel>{label}</StyledButtonLabel>
|
||||
</StyledButton>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -11,13 +11,13 @@ import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
import { actionBarOpenState } from '../../states/actionBarIsOpenState';
|
||||
import { ActionBar } from '../ActionBar';
|
||||
|
||||
function FilledActionBar(props: { selectedIds: string[] }) {
|
||||
const FilledActionBar = (props: { selectedIds: string[] }) => {
|
||||
const { setActionBarEntries } = useCompanyTableActionBarEntries();
|
||||
setActionBarEntries();
|
||||
const setActionBarOpenState = useSetRecoilState(actionBarOpenState);
|
||||
setActionBarOpenState(true);
|
||||
return <ActionBar selectedIds={props.selectedIds} />;
|
||||
}
|
||||
};
|
||||
|
||||
const meta: Meta<typeof ActionBar> = {
|
||||
title: 'UI/ActionBar/ActionBar',
|
||||
|
||||
Reference in New Issue
Block a user