Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(settings): move from vert nav to masthead tool #243

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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