Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiklem committed Oct 4, 2024
1 parent 88d0315 commit 6d9ab1a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/felles/header/modiadekoratør/Modiadekoratør.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ const Modiadekoratør: FunctionComponent<Props> = ({ navKontor, onNavKontorChang
loadjs.isDefined(appName) ? Status.Klar : Status.LasterNed
);

useEffect(() => {
const style = document.createElement('style');
style.textContent = `
@import url('https://cdn.nav.no/personoversikt/internarbeidsflate-decorator-v3/dev/latest/dist/index.css')
layer(modiadekorator);
`;
document.head.appendChild(style);

return () => {
document.head.removeChild(style);
};
}, []);

useEffect(() => {
const loadAssets = async (staticPaths: string[]) => {
try {
Expand All @@ -45,7 +58,6 @@ const Modiadekoratør: FunctionComponent<Props> = ({ navKontor, onNavKontorChang

if (!loadjs.isDefined(appName)) {
loadAssets([
`https://cdn.nav.no/personoversikt/internarbeidsflate-decorator-v3/dev/latest/dist/index.css`,
`https://cdn.nav.no/personoversikt/internarbeidsflate-decorator-v3/dev/latest/dist/bundle.js`,
]);
}
Expand Down

0 comments on commit 6d9ab1a

Please sign in to comment.