button redesign

This commit is contained in:
Jan Prochazka
2020-04-04 10:20:56 +02:00
parent a50d1166d4
commit a3e9ba61af
9 changed files with 161 additions and 28 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import { showMenu } from '../modals/DropDownMenu';
import InlineButton from './InlineButton';
export default function DropDownButton({ children }) {
const buttonRef = React.useRef(null);
const handleShowMenu = () => {
const rect = buttonRef.current.getBoundingClientRect();
showMenu(rect.left, rect.bottom, children);
};
return (
<InlineButton buttonRef={buttonRef} onClick={handleShowMenu} square>
<i className="fas fa-chevron-down" />
</InlineButton>
);
}