-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Legg til ekspanderbart nedtrekkspanel for visittkort
Det er dratt inn fra nav-frontend-moduler. Per nå så opplever jeg litt krøll med komponenten, sannsynligvis fordi den ikke er skrevet i React. InteliJ rapporterer at 'EkspanderbartpanelBase does not have any construct or call signature'. Det funker fint å kompilere og kjøre, men skriptet feiler ved hot-reload av visittkort-komponenten. Det kan være relatert til denne: microsoft/TypeScript#14558. Denne har blitt merget inn i master, men er ikke ute i en release enda. Det eksisterer også en PR i nav-frontend på å skrive om panelet til typecript som forhåpentligvis vil løse problemet: navikt/aksel#233
- Loading branch information
Joakim Lindquister
committed
Mar 7, 2018
1 parent
0dce895
commit 09cc28b
Showing
7 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 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,11 @@ | ||
declare module 'nav-frontend-ekspanderbartpanel' { | ||
import * as React from "react"; | ||
|
||
export interface EkspanderbartpanelProps { | ||
} | ||
export default class EkspanderbartPanel extends React.Component<EkspanderbartpanelProps, {}>{} | ||
|
||
export class EkspanderbartpanelBase extends React.Component<EkspanderbartpanelProps, {}>{ | ||
|
||
} | ||
} |
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,6 @@ | ||
.visittkort { | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 900px; | ||
padding-top: 50px; | ||
} |
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,18 +1,30 @@ | ||
import * as React from 'react'; | ||
import { Person } from '../../models/person'; | ||
import Innholdstittel from 'nav-frontend-typografi/lib/innholdstittel'; | ||
import Innholdstittel from 'nav-frontend-typografi'; | ||
|
||
import { EkspanderbartpanelBase } from 'nav-frontend-ekspanderbartpanel'; | ||
|
||
interface VisittkortProps { | ||
person: Person; | ||
} | ||
|
||
function Visittkort({person}: VisittkortProps) { | ||
function Tittel({person}: VisittkortProps) { | ||
return ( | ||
<div> | ||
<Innholdstittel>{person.fornavn} {person.etternavn}</Innholdstittel> | ||
<Innholdstittel type={"innholdstittel"}>{person.fornavn} {person.etternavn}</Innholdstittel> | ||
<p>{person.fodselsnummer}</p> | ||
</div> | ||
); | ||
} | ||
|
||
function Visittkort({person}: VisittkortProps) { | ||
return ( | ||
<div className="visittkort"> | ||
<EkspanderbartpanelBase apen={true} heading={<Tittel person={person}/>} ariaTittel="Visittkort"> | ||
<p>Mer personinformasjon her..</p> | ||
</EkspanderbartpanelBase> | ||
</div> | ||
); | ||
} | ||
|
||
export default Visittkort; |
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