-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
story: Add Consent component and default story
- Loading branch information
1 parent
6035d41
commit 9f3327f
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
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,43 @@ | ||
|
||
import Consent from '../components/Consent/Consent'; | ||
|
||
const defaultArgs = { | ||
title: "This is the title", | ||
text: "This is the text", | ||
onNext: () => {console.log("Next button clicked")}, | ||
confirm: "Confirm", | ||
deny: "Deny", | ||
experiment: { | ||
slug: "experiment-slug", | ||
} | ||
} | ||
|
||
const getArgs = (args = {}) => ({ ...defaultArgs, ...args }); | ||
|
||
export default { | ||
title: 'Consent', | ||
component: Consent, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
}; | ||
|
||
export const Default = { | ||
args: { | ||
title: "This is the Consent component's title", | ||
text: "<h2>This is the Consent component's text</h2><p>It can contain lists, headings, bold, italic and underlined text, you name it!</p><ul><li><b>Item 1</b></li><li><i>Item 2</i></li><li><u>Item 3</u></li></ul>", | ||
onNext: () => {console.log("On next triggered")}, | ||
confirm: "Confirm", | ||
deny: "Deny", | ||
experiment: { | ||
slug: "experiment-slug", | ||
} | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<div style={{ width: '100%', height: '100%', backgroundColor: '#ddd', padding: '1rem' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; |