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:
@ -102,7 +102,7 @@ export interface SnackbarProps extends React.ComponentPropsWithoutRef<'div'> {
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
export function SnackBar({
|
||||
export const SnackBar = ({
|
||||
role = 'status',
|
||||
icon: iconComponent,
|
||||
message,
|
||||
@ -112,7 +112,7 @@ export function SnackBar({
|
||||
children,
|
||||
onClose,
|
||||
...rootProps
|
||||
}: SnackbarProps) {
|
||||
}: SnackbarProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const progressBarRef = useRef<ProgressBarControls | null>(null);
|
||||
@ -179,4 +179,4 @@ export function SnackBar({
|
||||
)}
|
||||
</StyledMotionContainer>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ const reducedVariants = {
|
||||
},
|
||||
};
|
||||
|
||||
export function SnackBarProvider({ children }: React.PropsWithChildren) {
|
||||
export const SnackBarProvider = ({ children }: React.PropsWithChildren) => {
|
||||
const reducedMotion = useReducedMotion();
|
||||
|
||||
const [snackBarInternal, setSnackBarInternal] = useRecoilState(
|
||||
@ -88,4 +88,4 @@ export function SnackBarProvider({ children }: React.PropsWithChildren) {
|
||||
</StyledSnackBarContainer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
||||
export function usePausableTimeout(callback: () => void, delay: number) {
|
||||
export const usePausableTimeout = (callback: () => void, delay: number) => {
|
||||
const savedCallback = useRef<() => void>(callback);
|
||||
const remainingTime = useRef<number>(delay);
|
||||
const startTime = useRef<number>(Date.now());
|
||||
@ -47,4 +47,4 @@ export function usePausableTimeout(callback: () => void, delay: number) {
|
||||
};
|
||||
|
||||
return { pauseTimeout, resumeTimeout };
|
||||
}
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
snackBarSetQueueState,
|
||||
} from '../states/snackBarState';
|
||||
|
||||
export function useSnackBar() {
|
||||
export const useSnackBar = () => {
|
||||
const setSnackBarQueue = useSetRecoilState(snackBarSetQueueState);
|
||||
|
||||
const enqueueSnackBar = (
|
||||
@ -21,4 +21,4 @@ export function useSnackBar() {
|
||||
};
|
||||
|
||||
return { enqueueSnackBar };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user