Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
🎨 confirmationpanel eksempler
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Sep 29, 2022
1 parent af1547a commit f69883e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
23 changes: 23 additions & 0 deletions website/pages/eksempler/confirmationpanel/default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ConfirmationPanel } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import { useState } from "react";

const Example = () => {
const [state, setState] = useState(false);
return (
<ConfirmationPanel
checked={state}
label="Ja, jeg samtykker."
onChange={() => setState((x) => !x)}
>
For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
om deg.
</ConfirmationPanel>
);
};

export default withDsExample(Example);

export const args = {
index: 0,
};
24 changes: 24 additions & 0 deletions website/pages/eksempler/confirmationpanel/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ConfirmationPanel } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import { useState } from "react";

const Example = () => {
const [state, setState] = useState(false);
return (
<ConfirmationPanel
checked={state}
label="Ja, jeg samtykker."
onChange={() => setState((x) => !x)}
error={!state && "Du må samtykke før du kan fortsette."}
>
For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
om deg.
</ConfirmationPanel>
);
};

export default withDsExample(Example);

export const args = {
index: 2,
};
24 changes: 24 additions & 0 deletions website/pages/eksempler/confirmationpanel/small.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ConfirmationPanel } from "@navikt/ds-react";
import { withDsExample } from "components/website-modules/examples/withDsExample";
import { useState } from "react";

const Example = () => {
const [state, setState] = useState(false);
return (
<ConfirmationPanel
checked={state}
label="Ja, jeg samtykker."
onChange={() => setState((x) => !x)}
size="small"
>
For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
om deg.
</ConfirmationPanel>
);
};

export default withDsExample(Example);

export const args = {
index: 1,
};

0 comments on commit f69883e

Please sign in to comment.