Skip to content

Commit

Permalink
Change: Header component to include user timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng committed Jan 9, 2025
1 parent b9e9f3f commit 456ce86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/web/components/structure/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
*/

import {AppHeader} from '@greenbone/opensight-ui-components-mantinev7';
import _ from 'gmp/locale';
import {useCallback} from 'react';
import {useSelector} from 'react-redux';

Check warning on line 8 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L8

Added line #L8 was not covered by tests
import {useNavigate} from 'react-router-dom';
import LogoutIcon from 'web/components/icon/logouticon';
import MySettingsIcon from 'web/components/icon/mysettingsicon';
import SessionTimer from 'web/components/sessionTimer/SessionTimer';

Check warning on line 12 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L12

Added line #L12 was not covered by tests
import getLogo from 'web/components/structure/getLogo';
import LanguageSwitch from 'web/components/structure/languageswitch';

Check warning on line 14 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L14

Added line #L14 was not covered by tests
import useGmp from 'web/hooks/useGmp';
import useTranslation from 'web/hooks/useTranslation';

Check warning on line 16 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L16

Added line #L16 was not covered by tests
import useUserIsLoggedIn from 'web/hooks/useUserIsLoggedIn';
import useUserName from 'web/hooks/useUserName';

import LanguageSwitch from './languageswitch';
import SessionTimer from '../sessionTimer/SessionTimer';

const Header = () => {
const [_] = useTranslation();

Check warning on line 21 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L21

Added line #L21 was not covered by tests

const gmp = useGmp();
const username = useUserName();
const loggedIn = useUserIsLoggedIn();
const navigate = useNavigate();
const logoComponent = getLogo(gmp.settings.vendorLabel);
const timezone = useSelector(state => state.userSettings.timezone);

Check warning on line 28 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L28

Added line #L28 was not covered by tests

const handleSettingsClick = useCallback(
event => {
Expand Down Expand Up @@ -58,6 +61,7 @@ const Header = () => {

return (
<AppHeader
ianaTimeZone={timezone}

Check warning on line 64 in src/web/components/structure/header.jsx

View check run for this annotation

Codecov / codecov/patch

src/web/components/structure/header.jsx#L64

Added line #L64 was not covered by tests
isLoggedIn={loggedIn}
isThemeSwitchVisible={false}
languageSwitch={<LanguageSwitch />}
Expand Down

0 comments on commit 456ce86

Please sign in to comment.