Skip to content

Commit

Permalink
Sjekker, og advarer, om beløpet er urimelig høyt (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiaslundmark authored Dec 20, 2023
1 parent 42267b0 commit ecb72a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
}
}

&__alert {
margin-top: 1rem;
}

&__tilskuddsprosent-heading, &__tilskuddsprosent {
margin-bottom: 1.25rem;
}
Expand Down
8 changes: 8 additions & 0 deletions src/AvtaleSide/steg/BeregningTilskudd/Manedslonn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { Column, Row } from '@/komponenter/NavGrid/Grid';
import ValutaInput from '@/komponenter/form/ValutaInput';
import { BEMWrapper } from '@/utils/bem';
import { AvtaleContext } from '@/AvtaleProvider';
import { Alert } from '@navikt/ds-react';

interface Props {
cls: BEMWrapper;
}

const Manedslonn: React.FC<Props> = ({ cls }: Props) => {
const { avtale, settAvtaleInnholdVerdier, settOgKalkulerBeregningsverdier } = useContext(AvtaleContext);
const erHøyManedslønn = (avtale.gjeldendeInnhold.manedslonn !== undefined && avtale.gjeldendeInnhold.manedslonn > 99999);

return (
<Row className={cls.element('rad', 'input')}>
<Column md="6" className={cls.element('valuta-input')}>
Expand All @@ -26,6 +29,11 @@ const Manedslonn: React.FC<Props> = ({ cls }: Props) => {
onBlur={(event) => settOgKalkulerBeregningsverdier({ manedslonn: parseFloat(event.target.value) })}
min={0}
/>
{erHøyManedslønn &&
<Alert variant="warning" className={cls.element('alert')}>
Er du sikker på at dette er riktig månedslønn?
</Alert>
}
</Column>
</Row>
);
Expand Down

0 comments on commit ecb72a1

Please sign in to comment.