-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #541 from Concordium/fix-storybook
Update storybook + migrate config
- Loading branch information
Showing
26 changed files
with
3,008 additions
and
7,027 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
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
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
87 changes: 47 additions & 40 deletions
87
...owser-wallet/src/popup/pages/IdProofRequest/DisplayStatement/DisplayStatement.stories.tsx
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,59 +1,66 @@ | ||
/* eslint-disable react/function-component-definition */ | ||
import React from 'react'; | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { DisplayStatementView } from './DisplayStatement'; | ||
|
||
export default { | ||
title: 'Pages/IdProofRequest/DisplayStatement', | ||
component: DisplayStatementView, | ||
} as ComponentMeta<typeof DisplayStatementView>; | ||
} as Meta<typeof DisplayStatementView>; | ||
|
||
const Template: ComponentStory<typeof DisplayStatementView> = (args) => { | ||
type Story = StoryObj<typeof DisplayStatementView>; | ||
|
||
const render: Story['render'] = (args) => { | ||
return ( | ||
<div style={{ width: 330 }}> | ||
<DisplayStatementView className="w-full" {...args} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const ValidRevealAttributes = Template.bind({}); | ||
ValidRevealAttributes.args = { | ||
dappName: 'Test dApp', | ||
header: 'Information to reveal', | ||
reveal: true, | ||
lines: [ | ||
{ attribute: 'First name', value: 'John', isRequirementMet: true }, | ||
{ attribute: 'Last name', value: 'Johnson', isRequirementMet: true }, | ||
], | ||
export const ValidRevealAttributes: Story = { | ||
args: { | ||
dappName: 'Test dApp', | ||
header: 'Information to reveal', | ||
reveal: true, | ||
lines: [ | ||
{ attribute: 'First name', value: 'John', isRequirementMet: true }, | ||
{ attribute: 'Last name', value: 'Johnson', isRequirementMet: true }, | ||
], | ||
}, | ||
render, | ||
}; | ||
|
||
export const InvalidRevealAttributes = Template.bind({}); | ||
InvalidRevealAttributes.args = { | ||
dappName: 'Test dApp', | ||
header: 'Information to reveal', | ||
reveal: true, | ||
lines: [ | ||
{ attribute: 'First name', value: 'John', isRequirementMet: true }, | ||
{ attribute: 'Last name', value: 'Johnson', isRequirementMet: true }, | ||
{ attribute: 'ID document type', value: 'Passport', isRequirementMet: false }, | ||
], | ||
export const InvalidRevealAttributes: Story = { | ||
args: { | ||
dappName: 'Test dApp', | ||
header: 'Information to reveal', | ||
reveal: true, | ||
lines: [ | ||
{ attribute: 'First name', value: 'John', isRequirementMet: true }, | ||
{ attribute: 'Last name', value: 'Johnson', isRequirementMet: true }, | ||
{ attribute: 'ID document type', value: 'Passport', isRequirementMet: false }, | ||
], | ||
}, | ||
render, | ||
}; | ||
|
||
export const ValidSecretProof = Template.bind({}); | ||
ValidSecretProof.args = { | ||
dappName: 'Test dApp', | ||
header: 'Secret proof of age', | ||
reveal: false, | ||
description: 'You date of birth is before YYYY-MM-DD.', | ||
lines: [{ attribute: 'Age', value: 'More than X years old', isRequirementMet: true }], | ||
export const ValidSecretProof: Story = { | ||
args: { | ||
dappName: 'Test dApp', | ||
header: 'Secret proof of age', | ||
reveal: false, | ||
description: 'You date of birth is before YYYY-MM-DD.', | ||
lines: [{ attribute: 'Age', value: 'More than X years old', isRequirementMet: true }], | ||
}, | ||
render, | ||
}; | ||
|
||
export const InvalidSecretProof = Template.bind({}); | ||
InvalidSecretProof.args = { | ||
dappName: 'Test dApp', | ||
header: 'Secret proof of identity document issuer', | ||
reveal: false, | ||
description: | ||
'Your identity document issuer is one of the following:\nAndorra, United Arab Emirates, Afghanistan, Antigua and Barbuda, Anguilla, Albania, Benin, Brazil, Bahamas, Bhutan, Belize, Canada, Chile, Spain, Finland, Fiji, Ghana, Hong Kong, Indonesia, Korea, Mali, Malta, Malawi, Mexico, Mozambique, Namibia, Nigeria, Nicaragua, Panama, Peru', | ||
lines: [{ attribute: 'Document issuer', value: '1 of 30 issuers', isRequirementMet: false }], | ||
export const InvalidSecretProof: Story = { | ||
args: { | ||
dappName: 'Test dApp', | ||
header: 'Secret proof of identity document issuer', | ||
reveal: false, | ||
description: | ||
'Your identity document issuer is one of the following:\nAndorra, United Arab Emirates, Afghanistan, Antigua and Barbuda, Anguilla, Albania, Benin, Brazil, Bahamas, Bhutan, Belize, Canada, Chile, Spain, Finland, Fiji, Ghana, Hong Kong, Indonesia, Korea, Mali, Malta, Malawi, Mexico, Mozambique, Namibia, Nigeria, Nicaragua, Panama, Peru', | ||
lines: [{ attribute: 'Document issuer', value: '1 of 30 issuers', isRequirementMet: false }], | ||
}, | ||
render, | ||
}; |
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
13 changes: 9 additions & 4 deletions
13
packages/browser-wallet/src/popup/shared/BackButton/BackButton.stories.tsx
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,14 +1,19 @@ | ||
/* eslint-disable react/function-component-definition */ | ||
import React from 'react'; | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import BackButton from './BackButton'; | ||
|
||
export default { | ||
title: 'Shared/BackButton', | ||
component: BackButton, | ||
} as ComponentMeta<typeof BackButton>; | ||
} as Meta<typeof BackButton>; | ||
|
||
export const Primary: ComponentStory<typeof BackButton> = () => { | ||
return <BackButton />; | ||
export const Primary: StoryObj<typeof BackButton> = { | ||
render: () => ( | ||
<MemoryRouter> | ||
<BackButton /> | ||
</MemoryRouter> | ||
), | ||
}; |
Oops, something went wrong.