Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nedtrekkspanel for visittkort #15

Merged
merged 4 commits into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@
"dependencies": {
"@types/storybook__react": "^3.0.7",
"classnames": "^2.2.5",
"lodash.throttle": "^4.1.1",
"copyfiles": "^1.2.0",
"lodash.throttle": "^4.1.1",
"nav-frontend-chevron-style": "^0.3.4",
"nav-frontend-core": "^4.0.5",
"nav-frontend-ekspanderbartpanel": "0.2.21",
"nav-frontend-ekspanderbartpanel-style": "0.3.8",
"nav-frontend-js-utils": "^1.0.3",
"nav-frontend-knapper": "^1.0.3",
"nav-frontend-knapper-style": "^0.3.6",
"nav-frontend-paneler-style": "^0.3.7",
"nav-frontend-typografi": "^2.0.2",
"nav-frontend-typografi-style": "^1.0.7",
"prop-types": "^15.6.1",
"react": "^16.2.0",
"react-collapse": "^4.0.3",
"react-dom": "^16.2.0",
"react-motion": "^0.5.2",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-scripts-ts": "2.13.0",
Expand Down
12 changes: 12 additions & 0 deletions src/@types/nav-frontend-ekspanderbartpanel.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare module 'nav-frontend-ekspanderbartpanel' {
import * as React from "react";

export interface EkspanderbartpanelBaseProps {
apen: boolean;
heading: React.ReactChildren | React.ReactChild;
ariaTittel: string;
}
export class EkspanderbartpanelBase extends React.Component<EkspanderbartpanelBaseProps, {}>{

}
}
6 changes: 6 additions & 0 deletions src/components/visittkort/Visittkort.less
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;
}
18 changes: 15 additions & 3 deletions src/components/visittkort/Visittkort.tsx
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;
2 changes: 2 additions & 0 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
@import '../node_modules/nav-frontend-core/less/core';
@import '../node_modules/nav-frontend-typografi-style/src/index';
@import '../node_modules/nav-frontend-knapper-style/src/index';
@import '../node_modules/nav-frontend-ekspanderbartpanel-style/src/index';

@import './App.less';
@import './components/underarbeid/UnderArbeid.less';
@import './components/startbilde/startbilde.less';
@import './components/visittkort/Visittkort';


body {
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"include" : [
"src/@types/*",
"src/**/*"
],
"exclude": [
"node_modules",
"build",
Expand Down