Restructure project to root layout
This commit is contained in:
1 parent
e0e26a34ab
commit
3ffe9bbf99
51 files changed
+16
-12
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { Button, ButtonProps } from '@mui/material';
|
||||
import React from 'react';
|
||||
import { useLongPress } from '../hooks/useLongPress';
|
||||
|
||||
interface LongPressButtonProps extends ButtonProps {
|
||||
onLongPress: () => void;
|
||||
}
|
||||
|
||||
export const LongPressButton = ({ onLongPress, onClick, children, ...rest }: LongPressButtonProps) => {
|
||||
const gestureHandlers = useLongPress({
|
||||
onLongPress,
|
||||
onClick: onClick ? () => onClick({} as React.MouseEvent<HTMLButtonElement>) : undefined,
|
||||
});
|
||||
|
||||
return (
|
||||
<Button {...rest} {...gestureHandlers} onClick={undefined}>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user