Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1477 from navikt/utloggingsvarsel-modal-fiks
Browse files Browse the repository at this point in the history
Utloggingsvarsel modal fiks
  • Loading branch information
terjeofnorway authored Aug 28, 2023
2 parents 88714f3 + f604c14 commit 14b3f36
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
25 changes: 15 additions & 10 deletions src/komponenter/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ import { AppState } from 'store/reducers';
import SimpleFooter from './footer-simple/FooterSimple';
import FooterRegular from './footer-regular/FooterRegular';
import { mapToClosestTranslatedLanguage } from 'utils/language';
import { LogoutWarning } from 'komponenter/header/logoutWarning/LogoutWarning';

const Footer = () => {
const { PARAMS } = useSelector((state: AppState) => state.environment);
const { PARAMS, ENV } = useSelector((state: AppState) => state.environment);
const { language } = useSelector((state: AppState) => state.language);

return (
<div
id="decorator-footer-inner"
className="decorator-wrapper"
lang={mapToClosestTranslatedLanguage(language, 'footer')}
>
<footer className="sitefooter">
{PARAMS.SIMPLE || PARAMS.SIMPLE_FOOTER ? <SimpleFooter /> : <FooterRegular />}
</footer>
</div>
<>
<div
id="decorator-footer-inner"
className="decorator-wrapper"
lang={mapToClosestTranslatedLanguage(language, 'footer')}
>
<footer className="sitefooter">
{PARAMS.SIMPLE || PARAMS.SIMPLE_FOOTER ? <SimpleFooter /> : <FooterRegular />}
</footer>
{(PARAMS.LOGOUT_WARNING || ENV === 'dev') && <LogoutWarning />}
<div id="logout-warning" />
</div>
</>
);
};

Expand Down
2 changes: 0 additions & 2 deletions src/komponenter/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { useOnPushStateHandlers } from 'utils/hooks/useOnPushStateHandlers';

import './Header.scss';
import { mapToClosestTranslatedLanguage } from 'utils/language';
import { LogoutWarning } from 'komponenter/header/logoutWarning/LogoutWarning';
import { useLoadIfActiveSession } from 'utils/hooks';

export const decoratorContextCookie = CookieName.DECORATOR_CONTEXT;
Expand Down Expand Up @@ -338,7 +337,6 @@ export const Header = () => {
{useSimpleHeader ? <HeaderSimple /> : <HeaderRegular />}
</header>
<Driftsmeldinger />
{(PARAMS.LOGOUT_WARNING || ENV === 'dev') && <LogoutWarning />}
{(breadcrumbs.length > 0 || availableLanguages.length > 0) && (
// Klassen "decorator-utils-container" brukes av appene til å sette bakgrunn
<div
Expand Down
2 changes: 1 addition & 1 deletion src/komponenter/header/logoutWarning/LogoutWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const LogoutWarning = () => {
return null;
}

const parent = document.getElementById('top-element');
const parent = document.getElementById('logout-warning');

const titleId: LangKey = isSessionExpiring ? 'snart-session-logget-ut-tittel' : 'snart-token-logget-ut-tittel';
const textBodyId: LangKey = isSessionExpiring ? 'snart-session-logget-ut-body' : 'snart-token-logget-ut-body';
Expand Down

0 comments on commit 14b3f36

Please sign in to comment.