mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 17:06:01 +00:00
19 lines
520 B
JavaScript
19 lines
520 B
JavaScript
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>
|
|
);
|
|
}
|