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

Center align navbar text and remove account text for screen less than 1500px #1127

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/main/webapp/app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ class Header extends React.Component<IHeaderProps> {
<AccountMenu
isAuthenticated={this.props.isUserAuthenticated}
isAdmin={this.props.isAdmin}
hideAccountText={
this.props.windowStore.isLargeScreen &&
!this.props.windowStore.isXLscreen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be !this.props.windowStore.isXLscreen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that is a better condition. I just changed the prop to showAccountText and the condition to isXLscreen.

}
/>
)}
<Nav.Item style={{ paddingRight: 0 }}>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/app/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ $view-wrapper-default-p-y: 2rem !default;

.navbar-nav > .nav-item {
line-height: 2rem;
text-align: center;
}

.navbar-nav > .nav-item,
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/app/pages/menus/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ const AccountMenuItems: React.FunctionComponent<{}> = () => (
export default class AccountMenu extends React.Component<{
isAuthenticated: boolean;
isAdmin: boolean;
hideAccountText?: boolean;
}> {
render() {
return (
<Dropdown as={NavItem}>
<Dropdown.Toggle id={'account-menu'} as={NavLink}>
<i className={'fa fa-user-o mr-1'} />
{PAGE_TITLE.ACCOUNT}
{this.props.hideAccountText ? undefined : PAGE_TITLE.ACCOUNT}
</Dropdown.Toggle>
<Dropdown.Menu alignRight={true}>
{this.props.isAuthenticated ? (
Expand Down
Loading