Skip to content

Commit

Permalink
feat(familie-visittkort): bytter ut familie-clipboard med CopyButton …
Browse files Browse the repository at this point in the history
…fra aksel

affects: @navikt/familie-visittkort

BREAKING CHANGE:
Fungerer kun med aksel v4
  • Loading branch information
idaame committed Sep 11, 2023
1 parent 9c48cfb commit 34da840
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
13 changes: 6 additions & 7 deletions packages/familie-visittkort/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@
"tsc": "tsc -p tsconfig.json"
},
"dependencies": {
"@navikt/familie-clipboard": "^11.0.0",
"@navikt/familie-ikoner": "^7.0.0",
"@navikt/familie-typer": "^8.0.0",
"classnames": "^2.3.2",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@navikt/ds-css": "2.x",
"@navikt/ds-react": "2.x",
"@navikt/ds-tokens": "2.x",
"@navikt/ds-css": "4.x",
"@navikt/ds-react": "4.x",
"@navikt/ds-tokens": "4.x",
"styled-components": "^5.3.5"
},
"peerDependencies": {
"@navikt/ds-css": "2.x || 3.x || 4.x",
"@navikt/ds-react": "2.x || 3.x || 4.x",
"@navikt/ds-tokens": "2.x || 3.x || 4.x",
"@navikt/ds-css": "4.x",
"@navikt/ds-react": "4.x",
"@navikt/ds-tokens": "4.x",
"react": "^17.x || 18.x",
"styled-components": "^5.x"
}
Expand Down
16 changes: 11 additions & 5 deletions packages/familie-visittkort/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Clipboard from '@navikt/familie-clipboard';
import { FamilieIkonVelger } from '@navikt/familie-ikoner';
import { kjønnType } from '@navikt/familie-typer';
import * as React from 'react';
import styled from 'styled-components';
import { BodyShort, Label } from '@navikt/ds-react';
import { CopyButton, Label } from '@navikt/ds-react';
import { AGray700, ASpacing2, ASpacing4 } from '@navikt/ds-tokens/dist/tokens';

export interface IkonProps {
Expand Down Expand Up @@ -34,6 +33,12 @@ const StyledVisittkort = styled.div`
}
`;

const IdentOgKopierKnapp = styled.div`
display: flex;
align-items: center;
gap: 0.25rem;
`;

export const Visittkort: React.FunctionComponent<IProps> = ({
alder,
children,
Expand All @@ -59,9 +64,10 @@ export const Visittkort: React.FunctionComponent<IProps> = ({

<div className={'visittkort__pipe'}>|</div>

<Clipboard>
<BodyShort size={'small'}>{ident}</BodyShort>
</Clipboard>
<IdentOgKopierKnapp>
{ident}
<CopyButton copyText={ident} size={'small'} />
</IdentOgKopierKnapp>

{children}
</StyledVisittkort>
Expand Down

0 comments on commit 34da840

Please sign in to comment.