-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Henter og viser kontoinformasjon (#1325)
* Henter og viser kontoinformasjon * Fikser riktig tekststørrelse på headingene * Justerer på luft mellom elementene * Tekst om kontonummer skal være paragrafer * Fjerner tekst vi ikke lenger bruker
- Loading branch information
1 parent
ef5908c
commit 5c92299
Showing
6 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/frontend/components/Kontoinformasjon/Kontoinformasjon.tsx
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,57 @@ | ||
import React from 'react'; | ||
|
||
import { Alert, Heading, Label, Loader, VStack } from '@navikt/ds-react'; | ||
import { RessursStatus } from '@navikt/familie-typer'; | ||
|
||
import { useApp } from '../../context/AppContext'; | ||
import { ESanitySteg, Typografi } from '../../typer/sanity/sanity'; | ||
import TekstBlock from '../Felleskomponenter/Sanity/TekstBlock'; | ||
|
||
const Kontoinformasjon: React.FC = () => { | ||
const { kontoinformasjon, tekster, plainTekst } = useApp(); | ||
|
||
const kvitteringstekster = tekster()[ESanitySteg.KVITTERING]; | ||
|
||
return ( | ||
<VStack gap="6"> | ||
{kontoinformasjon.status === RessursStatus.SUKSESS && ( | ||
<> | ||
<Heading level="3" size="xsmall"> | ||
{plainTekst(kvitteringstekster.kontonummerTittel)} | ||
</Heading> | ||
<Label as="p">{kontoinformasjon.data.kontonummer}</Label> | ||
<TekstBlock | ||
typografi={Typografi.BodyLong} | ||
block={kvitteringstekster.redigerKontonummerLenke} | ||
/> | ||
</> | ||
)} | ||
|
||
{kontoinformasjon.status === RessursStatus.HENTER && ( | ||
<> | ||
<Heading level="3" size="xsmall"> | ||
{plainTekst(kvitteringstekster.kontonummerTittel)} | ||
</Heading> | ||
<Loader title={plainTekst(kvitteringstekster.henterKontonummer)} /> | ||
</> | ||
)} | ||
|
||
{kontoinformasjon.status === RessursStatus.FEILET && ( | ||
<> | ||
<Alert variant="warning"> | ||
<TekstBlock block={kvitteringstekster.finnerIngenKontonummerAdvarsel} /> | ||
</Alert> | ||
<Heading level="3" size="xsmall"> | ||
{plainTekst(kvitteringstekster.manglerKontonummerTittel)} | ||
</Heading> | ||
<TekstBlock | ||
typografi={Typografi.BodyLong} | ||
block={kvitteringstekster.finnerIngenKontonummerBeskrivelse} | ||
/> | ||
</> | ||
)} | ||
</VStack> | ||
); | ||
}; | ||
|
||
export default Kontoinformasjon; |
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
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
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,3 @@ | ||
export interface IKontoinformasjon { | ||
kontonummer: string; | ||
} |