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:
@ -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>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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"
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user