Merged PR 170: Add new eslint rules
- naming-convention - prefer-arrow-callback - func-style - import/no-default-export
This commit is contained in:
parent
3f58c5ba5e
commit
ad126c6c28
65 changed files with 781 additions and 784 deletions
|
@ -6,14 +6,12 @@ interface IFloatingButtonProps {
|
|||
className: string
|
||||
}
|
||||
|
||||
const toggleState = (
|
||||
isHidden: boolean,
|
||||
setHidden: React.Dispatch<React.SetStateAction<boolean>>
|
||||
): void => {
|
||||
function ToggleState(isHidden: boolean,
|
||||
setHidden: React.Dispatch<React.SetStateAction<boolean>>): void {
|
||||
setHidden(!isHidden);
|
||||
};
|
||||
}
|
||||
|
||||
export const FloatingButton: React.FC<IFloatingButtonProps> = (props: IFloatingButtonProps) => {
|
||||
export function FloatingButton(props: IFloatingButtonProps): JSX.Element {
|
||||
const [isHidden, setHidden] = React.useState(true);
|
||||
const buttonListClasses = isHidden ? 'invisible opacity-0' : 'visible opacity-100';
|
||||
const icon = isHidden
|
||||
|
@ -23,14 +21,14 @@ export const FloatingButton: React.FC<IFloatingButtonProps> = (props: IFloatingB
|
|||
return (
|
||||
<div className={`transition-all ${props.className}`}>
|
||||
<div className={`transition-all flex flex-col gap-2 items-center ${buttonListClasses}`}>
|
||||
{ props.children }
|
||||
{props.children}
|
||||
</div>
|
||||
<button type="button"
|
||||
className={'transition-all w-14 h-14 p-2 align-middle items-center justify-center rounded-full bg-blue-500 hover:bg-blue-800'}
|
||||
title='Open menu'
|
||||
onClick={() => toggleState(isHidden, setHidden)}
|
||||
onClick={() => ToggleState(isHidden, setHidden)}
|
||||
>
|
||||
{ icon }
|
||||
{icon}
|
||||
</button>
|
||||
</div>);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue