mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 23:35:59 +00:00
button redesign
This commit is contained in:
18
packages/web/src/widgets/DropDownButton.js
Normal file
18
packages/web/src/widgets/DropDownButton.js
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user