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:
gitstart-twenty
2023-09-16 02:41:10 +01:00
committed by GitHub
parent 549335054a
commit 00a3c8ca2b
575 changed files with 2848 additions and 3063 deletions

View File

@ -40,7 +40,7 @@ const StyledRightDrawer = styled.div`
width: 100%;
`;
export function RightDrawer() {
export const RightDrawer = () => {
const [isRightDrawerOpen, setIsRightDrawerOpen] = useRecoilState(
isRightDrawerOpenState,
);
@ -100,4 +100,4 @@ export function RightDrawer() {
</StyledRightDrawer>
</StyledContainer>
);
}
};

View File

@ -26,7 +26,7 @@ const StyledRightDrawerBody = styled.div`
position: relative;
`;
export function RightDrawerRouter() {
export const RightDrawerRouter = () => {
const [rightDrawerPage] = useRecoilState(rightDrawerPageState);
let page = <></>;
@ -48,4 +48,4 @@ export function RightDrawerRouter() {
<StyledRightDrawerBody>{page}</StyledRightDrawerBody>
</StyledRightDrawerPage>
);
}
};

View File

@ -28,7 +28,7 @@ const StyledTopBarWrapper = styled.div`
display: flex;
`;
export function RightDrawerTopBar() {
export const RightDrawerTopBar = () => {
const isMobile = useIsMobile();
const viewableActivityId = useRecoilValue(viewableActivityIdState);
@ -41,4 +41,4 @@ export function RightDrawerTopBar() {
<ActivityActionBar activityId={viewableActivityId ?? ''} />
</StyledRightDrawerTopBar>
);
}
};

View File

@ -3,12 +3,12 @@ import { IconChevronsRight } from '@/ui/icon/index';
import { useRightDrawer } from '../hooks/useRightDrawer';
export function RightDrawerTopBarCloseButton() {
export const RightDrawerTopBarCloseButton = () => {
const { closeRightDrawer } = useRightDrawer();
function handleButtonClick() {
const handleButtonClick = () => {
closeRightDrawer();
}
};
return (
<LightIconButton
@ -18,4 +18,4 @@ export function RightDrawerTopBarCloseButton() {
accent="tertiary"
/>
);
}
};

View File

@ -8,14 +8,14 @@ import {
import { isRightDrawerExpandedState } from '../states/isRightDrawerExpandedState';
export function RightDrawerTopBarExpandButton() {
export const RightDrawerTopBarExpandButton = () => {
const [isRightDrawerExpanded, setIsRightDrawerExpanded] = useRecoilState(
isRightDrawerExpandedState,
);
function handleButtonClick() {
const handleButtonClick = () => {
setIsRightDrawerExpanded(!isRightDrawerExpanded);
}
};
return (
<LightIconButton
@ -29,4 +29,4 @@ export function RightDrawerTopBarExpandButton() {
onClick={handleButtonClick}
/>
);
}
};

View File

@ -5,7 +5,7 @@ import { isRightDrawerOpenState } from '../states/isRightDrawerOpenState';
import { rightDrawerPageState } from '../states/rightDrawerPageState';
import { RightDrawerPages } from '../types/RightDrawerPages';
export function useRightDrawer() {
export const useRightDrawer = () => {
const [, setIsRightDrawerOpen] = useRecoilState(isRightDrawerOpenState);
const [, setIsRightDrawerExpanded] = useRecoilState(
isRightDrawerExpandedState,
@ -13,19 +13,19 @@ export function useRightDrawer() {
const [, setRightDrawerPage] = useRecoilState(rightDrawerPageState);
function openRightDrawer(rightDrawerPage: RightDrawerPages) {
const openRightDrawer = (rightDrawerPage: RightDrawerPages) => {
setRightDrawerPage(rightDrawerPage);
setIsRightDrawerExpanded(false);
setIsRightDrawerOpen(true);
}
};
function closeRightDrawer() {
const closeRightDrawer = () => {
setIsRightDrawerExpanded(false);
setIsRightDrawerOpen(false);
}
};
return {
openRightDrawer,
closeRightDrawer,
};
}
};