From 657a8bc4508f47cf911e72e5bea2d33a87214b42 Mon Sep 17 00:00:00 2001 From: rui hildt Date: Wed, 13 May 2020 12:23:45 +0200 Subject: [PATCH] Add basic dropdown menu --- src/components/Navbar/MenuDropdown.js | 49 +++++++++++++++++++++++++++ src/components/Navbar/NavBar.js | 22 ++++++++++++ src/components/TopBar.js | 25 -------------- src/screens/App.js | 2 +- 4 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 src/components/Navbar/MenuDropdown.js create mode 100644 src/components/Navbar/NavBar.js delete mode 100644 src/components/TopBar.js diff --git a/src/components/Navbar/MenuDropdown.js b/src/components/Navbar/MenuDropdown.js new file mode 100644 index 0000000..bdf617b --- /dev/null +++ b/src/components/Navbar/MenuDropdown.js @@ -0,0 +1,49 @@ +import React from 'react'; + +import { Nav, Icon, Dropdown, IconButton, Popover, Whisper } from 'rsuite'; + +function MenuDropdown() { + const triggerRef = React.createRef(); + + function handleSelectMenu(eventKey, event) { + console.log(eventKey); + triggerRef.current.hide(); + } + + const MenuPopover = ({ onSelect, ...rest }) => ( + + + New File + + New File with Current Profile + + Download As... + Export PDF + Export HTML + Settings + About + + + ); + + return ( + + ); +} + +export default MenuDropdown; diff --git a/src/components/Navbar/NavBar.js b/src/components/Navbar/NavBar.js new file mode 100644 index 0000000..efa00ba --- /dev/null +++ b/src/components/Navbar/NavBar.js @@ -0,0 +1,22 @@ +import React from 'react'; + +import { Header, Navbar } from 'rsuite'; +import MenuDropdown from './MenuDropdown'; + +const headerStyle = { + borderRadius: '7px 7px 0 0', +}; + +function NavBar() { + return ( +
+ + + + + +
+ ); +} + +export default NavBar; diff --git a/src/components/TopBar.js b/src/components/TopBar.js deleted file mode 100644 index 41682ec..0000000 --- a/src/components/TopBar.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; - -import { Header, Navbar, Nav, Icon } from 'rsuite'; - -const headerStyle = { - borderRadius: '7px 7px 0 0', -}; - -function TopBar() { - return ( -
- - - - - -
- ); -} - -export default TopBar; diff --git a/src/screens/App.js b/src/screens/App.js index bfc4131..545f6c7 100644 --- a/src/screens/App.js +++ b/src/screens/App.js @@ -5,7 +5,7 @@ import { Container } from 'rsuite'; import Login from './Login'; import Register from './Register'; -import TopBar from '../components/TopBar'; +import TopBar from '../components/Navbar/NavBar'; const containerStyle = { maxWidth: 700,