Skip to content

Commit

Permalink
fix(settings): move from vert nav to masthead tool (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Aug 24, 2021
1 parent 2e83e0b commit 0261eea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import { IAppRoute, routes } from '@app/routes';
import { AboutModal, Button, Nav, NavItem, NavList, Page, PageHeader,
PageHeaderTools, PageHeaderToolsGroup, PageHeaderToolsItem, PageSidebar,
SkipToContent, Text, TextContent, TextList, TextListItem } from '@patternfly/react-core';
import { HelpIcon } from '@patternfly/react-icons';
import { NavLink, matchPath, useLocation } from 'react-router-dom';
import { CogIcon, HelpIcon } from '@patternfly/react-icons';
import { NavLink, matchPath, useHistory, useLocation } from 'react-router-dom';
import { AuthModal } from './AuthModal';
import { SslErrorModal} from './SslErrorModal';

Expand All @@ -53,6 +53,7 @@ interface IAppLayout {

const AppLayout: React.FunctionComponent<IAppLayout> = ({children}) => {
const context = React.useContext(ServiceContext);
const routerHistory = useHistory();
const logoProps = {
href: '/',
target: '_blank'
Expand Down Expand Up @@ -105,13 +106,21 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({children}) => {
const mobileOnSelect = (selected) => {
if(isMobileView) setIsNavOpenMobile(false)
};
const handleSettingsButtonClick = () => {
routerHistory.push('/settings');
};
const handleAboutModalToggle = () => {
setAboutModalOpen(!aboutModalOpen);
};
const HeaderTools = (<>
<PageHeaderTools>
<PageHeaderToolsGroup>
<PageHeaderToolsItem>
<Button
onClick={handleSettingsButtonClick}
variant='link'
icon={<CogIcon color='white 'size='sm' />}
/>
<Button
onClick={handleAboutModalToggle}
variant='link'
Expand Down
1 change: 0 additions & 1 deletion src/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const routes: IAppRoute[] = [
{
component: Settings,
exact: true,
label: 'Settings',
path: '/settings',
title: 'Settings',
},
Expand Down

0 comments on commit 0261eea

Please sign in to comment.