Browse Source

feat: add dropdown to menu, move clear databases into dropdown

develop
Apostolos Fanakis 4 years ago
parent
commit
d365c1bc59
  1. 22
      packages/concordia-app/src/layouts/MainLayout/MainLayoutMenu/index.jsx

22
packages/concordia-app/src/layouts/MainLayout/MainLayoutMenu/index.jsx

@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Menu } from 'semantic-ui-react'; import { Dropdown, Menu } from 'semantic-ui-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
@ -39,14 +39,6 @@ const MainLayoutMenu = () => {
> >
<img src={appLogo} alt="app_logo" /> <img src={appLogo} alt="app_logo" />
</Menu.Item> </Menu.Item>
<Menu.Item
link
name="clear-databases"
key="clear-databases"
onClick={handleClearDatabasesClick}
>
{t('topbar.button.clear.databases')}
</Menu.Item>
<Menu.Menu position="right"> <Menu.Menu position="right">
{hasSignedUp && history.location.pathname === '/home' && ( {hasSignedUp && history.location.pathname === '/home' && (
<Menu.Item <Menu.Item
@ -81,6 +73,18 @@ const MainLayoutMenu = () => {
</Menu.Item> </Menu.Item>
)} )}
</Menu.Menu> </Menu.Menu>
<Dropdown key="overflow" item direction="left">
<Dropdown.Menu>
<Dropdown.Item
link
name="clear-databases"
key="clear-databases"
onClick={handleClearDatabasesClick}
>
{t('topbar.button.clear.databases')}
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
<ClearDatabasesModal <ClearDatabasesModal
open={isClearDatabasesOpen} open={isClearDatabasesOpen}

Loading…
Cancel
Save