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

Commit

Permalink
Merge pull request #878 from navikt/dev/migrering-designsystemet-v5
Browse files Browse the repository at this point in the history
Migrering til designsystemet v5 (endret modal)
  • Loading branch information
jstnhlj authored Aug 22, 2023
2 parents a67294b + 78b6fe0 commit aa544a7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 94 deletions.
70 changes: 18 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@alheimsins/virkedager": "2.2.0",
"@grafana/faro-web-sdk": "^1.1.3",
"@grafana/faro-web-tracing": "^1.1.3",
"@navikt/aksel-icons": "4.8.0",
"@navikt/ds-css": "4.8.0",
"@navikt/ds-react": "4.8.0",
"@navikt/aksel-icons": "^5.0.2",
"@navikt/ds-css": "^5.0.2",
"@navikt/ds-react": "^5.0.2",
"amplitude-js": "8.21.9",
"classnames": "2.3.2",
"core-js": "^3.32.1",
Expand Down
18 changes: 6 additions & 12 deletions src/komponenter/endre-situasjon/les-igjen-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import { Button, Heading, Modal } from '@navikt/ds-react';
import { Button, Modal } from '@navikt/ds-react';

import Veiledning from './veiledning';
import { loggAktivitet } from '../../metrics/metrics';

import spacing from '../../spacing.module.css';
import flex from '../../flex.module.css';
import styles from './modal.module.css';

interface LesIgjenModalProps {
openModal: boolean;
Expand Down Expand Up @@ -69,17 +67,13 @@ const LesIgjenModal = (props: LesIgjenModalProps) => {
return (
<Modal
open={openModal}
aria-label="Jobbsituasjonen min har endret seg"
onClose={() => setOpenModal((x) => !x)}
// shouldCloseOnEsc={!datepickerProps.open}
aria-labelledby="modal-heading"
onClose={() => setOpenModal(false)}
width={'medium'}
header={{ heading: 'Jobbsituasjonen min har endret seg', size: 'medium' }}
>
<Modal.Content className={styles.maxWidth}>
<Heading spacing level="1" size="large" id="modal-heading" className={spacing.mr2}>
Jobbsituasjonen min har endret seg
</Heading>
<Modal.Body>
<Innhold tilleggsData={tilleggsData} valgtSituasjon={valgtSituasjon} amplitudeData={amplitudeData} />
</Modal.Content>
</Modal.Body>
</Modal>
);
};
Expand Down
4 changes: 0 additions & 4 deletions src/komponenter/endre-situasjon/modal.module.css

This file was deleted.

23 changes: 7 additions & 16 deletions src/komponenter/endre-situasjon/permittert-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { BodyShort, Heading, Link, Modal } from '@navikt/ds-react';
import { BodyShort, Link, Modal } from '@navikt/ds-react';
import { ChevronLeftIcon } from '@navikt/aksel-icons';

import { AmplitudeData } from '../../metrics/amplitude-utils';
Expand All @@ -8,7 +8,6 @@ import Steg3 from './steg3';
import Steg1 from './steg1';

import spacing from '../../spacing.module.css';
import styles from './modal.module.css';

interface PermittertModalProps {
openModal: boolean;
Expand All @@ -28,10 +27,6 @@ const PermittertModal = (props: PermittertModalProps) => {
settAktivSide(1);
}, [openModal]);

useEffect(() => {
Modal.setAppElement('#aia-wrapper');
}, []);

const Innhold = () => {
if (aktivSide === 1) {
return (
Expand Down Expand Up @@ -85,22 +80,18 @@ const PermittertModal = (props: PermittertModalProps) => {

return (
<Modal
width={'medium'}
open={openModal}
aria-label="Jobbsituasjonen min har endret seg"
onClose={() => setOpenModal((x) => !x)}
// shouldCloseOnEsc={!datepickerProps.open}
aria-labelledby="modal-heading"
onClose={() => setOpenModal(false)}
header={{ heading: 'Jobbsituasjonen min har endret seg', size: 'medium' }}
>
<Modal.Content className={styles.maxWidth}>
<Modal.Body>
<Tilbake />
<Heading spacing level="1" size="large" id="modal-heading" className={spacing.mr2}>
Jobbsituasjonen min har endret seg
</Heading>
<BodyShort className={spacing.mb1}>
<BodyShort spacing>
<small>Steg {aktivSide}/3</small>
</BodyShort>
<Innhold />
</Modal.Content>
</Modal.Body>
</Modal>
);
};
Expand Down
15 changes: 8 additions & 7 deletions src/komponenter/gjelder-fra-dato/GjelderFraDato.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
import { BodyShort, Button, Heading, Link, Modal } from '@navikt/ds-react';
import { BodyShort, Button, Link, Modal } from '@navikt/ds-react';

import { useGjelderFraDatoModal } from '../../contexts/gjelder-fra-dato-modal';
import { useFeatureToggleData } from '../../contexts/feature-toggles';
Expand Down Expand Up @@ -50,11 +50,12 @@ function GjelderFraDato(): JSX.Element | null {
}

return (
<Modal open={visModal} onClose={settLukkModal} shouldCloseOnOverlayClick={false}>
<Modal.Content>
<Heading spacing={true} size={'medium'} style={{ marginRight: '2em' }}>
Hvilken dag er den siste dagen med lønn?
</Heading>
<Modal
open={visModal}
onClose={settLukkModal}
header={{ heading: 'Hvilken dag er den siste dagen med lønn?', size: 'medium' }}
>
<Modal.Body>
<BodyShort spacing={true}>
<input
style={{ width: 'initial' }}
Expand Down Expand Up @@ -84,7 +85,7 @@ function GjelderFraDato(): JSX.Element | null {
<Button variant={'secondary'} onClick={onSubmit} loading={lagrerDato}>
Lagre
</Button>
</Modal.Content>
</Modal.Body>
</Modal>
);
}
Expand Down

0 comments on commit aa544a7

Please sign in to comment.