-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix settPaaVentModal * Fix SettPåVentErrorModal * Fix OkGaaTilLosModal * Fix ErDuSikkerModal
- Loading branch information
1 parent
7338693
commit 5035f83
Showing
37 changed files
with
646 additions
and
875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
import React from 'react'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
import { Button } from '@navikt/ds-react'; | ||
import VerticalSpacer from './VerticalSpacer'; | ||
import { Button, Modal } from '@navikt/ds-react'; | ||
import VerticalSpacer from 'app/components/VerticalSpacer'; | ||
|
||
interface Props { | ||
melding: string; | ||
modalKey: string; | ||
open: boolean; | ||
submitKnappText: string; | ||
extraInfo?: string; | ||
|
||
onSubmit: () => void; | ||
onClose: () => void; | ||
|
||
extraInfo?: string; | ||
} | ||
|
||
const ErDuSikkerModal: React.FC<Props> = ({ melding, submitKnappText, onSubmit, onClose, extraInfo }: Props) => { | ||
return ( | ||
<div className="modal_content"> | ||
const ErDuSikkerModal = ({ melding, modalKey, open, onSubmit, onClose, submitKnappText, extraInfo }: Props) => ( | ||
<Modal key={modalKey} onClose={onClose} aria-label={modalKey} open={open} data-testid="erdusikkermodal"> | ||
<Modal.Body> | ||
<FormattedMessage id={melding} /> | ||
<VerticalSpacer sixteenPx /> | ||
|
||
{extraInfo && ( | ||
<div> | ||
<VerticalSpacer sixteenPx /> | ||
<FormattedMessage id={extraInfo} /> | ||
</div> | ||
)} | ||
<div className="punch_mappemodal_knapperad"> | ||
<Button | ||
size="small" | ||
className="knapp1" | ||
onClick={() => { | ||
onSubmit(); | ||
onClose(); | ||
}} | ||
type="button" | ||
> | ||
<FormattedMessage id={submitKnappText} /> | ||
</Button> | ||
|
||
<Button variant="secondary" size="small" className="knapp2" onClick={() => onClose()}> | ||
<FormattedMessage id={'skjema.knapp.avbryt'} /> | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
</Modal.Body> | ||
|
||
<Modal.Footer> | ||
<Button | ||
size="small" | ||
onClick={() => { | ||
onSubmit(); | ||
onClose(); | ||
}} | ||
> | ||
<FormattedMessage id={submitKnappText} /> | ||
</Button> | ||
|
||
<Button variant="secondary" size="small" onClick={() => onClose()}> | ||
<FormattedMessage id="skjema.knapp.avbryt" /> | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
|
||
export default ErDuSikkerModal; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
import { Button, Modal } from '@navikt/ds-react'; | ||
import CheckCircleSvg from '../../assets/SVG/CheckCircleSVG'; | ||
import { getEnvironmentVariable } from '../../utils'; | ||
import { initializeDate } from '../../utils/timeUtils'; | ||
|
||
import './okGåTilLosModal.less'; | ||
|
||
interface Props { | ||
melding: string; | ||
onClose: () => void; | ||
} | ||
|
||
const getDate = () => initializeDate().add(21, 'days').format('DD.MM.YYYY'); | ||
|
||
const utledMelding = (mld: string) => { | ||
if (mld === 'modal.settpaavent.til') { | ||
return <FormattedMessage id={mld} values={{ dato: getDate() }} />; | ||
} | ||
return <FormattedMessage id={mld} />; | ||
}; | ||
|
||
const OkGåTilLosModal = ({ melding, onClose }: Props) => { | ||
return ( | ||
<Modal | ||
key="settpaaventokmodal" | ||
onClose={onClose} | ||
aria-label="settpaaventokmodal" | ||
data-test-id="okGåTilLosModal" | ||
open | ||
> | ||
<Modal.Body> | ||
<div className="ok-gaa-til-los" data-testid="ok-gaa-til-los-modal"> | ||
<CheckCircleSvg title="check" /> | ||
|
||
<div className="vl" /> | ||
|
||
<div className="info" data-test-id="okGåTilLosModalInfo"> | ||
<div className="flex flex-wrap">{utledMelding(melding)}</div> | ||
|
||
<div className="flex flex-wrap"> | ||
<FormattedMessage id="modal.okgaatillos.tillos" /> | ||
</div> | ||
</div> | ||
|
||
<Button | ||
className="okknapp" | ||
size="small" | ||
onClick={() => { | ||
window.location.href = getEnvironmentVariable('K9_LOS_URL'); | ||
}} | ||
data-test-id="okGåTilLosModalOKBtn" | ||
> | ||
<FormattedMessage id="modal.okgaatillos.ok" /> | ||
</Button> | ||
</div> | ||
</Modal.Body> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default OkGåTilLosModal; |
File renamed without changes.
26 changes: 0 additions & 26 deletions
26
src/app/components/settPaaVentModal/SettPaaVentErrorModal.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.