Skip to content

Commit

Permalink
Merge pull request #12 from goldcaddy77/feat/dynamic-qr-code-story
Browse files Browse the repository at this point in the history
feat(qr-code): add dynamic story
  • Loading branch information
goldcaddy77 authored Jan 24, 2018
2 parents 149b858 + 047a932 commit 028a4d6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-knobs/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-options/register';
16 changes: 16 additions & 0 deletions src/components/ReblocksQRCode/ReblocksQRCode.story.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { boolean, number, text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import * as React from 'react';

Expand Down Expand Up @@ -33,4 +34,19 @@ storiesOf('ReblocksQRCode', module)
})
.add('RaiBlocks Purple', () => {
return <ReblocksQRCode accountId={ACCOUNT_ID} fgColor="#8c43d5" />;
})
.add('Dynamic QR Code', () => {
return (
<div>
<p>Change the values in the KNOBS panel on the right to dynamically update the QR code</p>
<ReblocksQRCode
accountId={text('Account ID', ACCOUNT_ID)}
amount={number('Amount', 1000)}
fgColor={text('Color', '#8c43d5')}
label={text('Label', 'For a good time')}
message={text('Message', "I'm a message")}
showUrl={boolean('Show URL', true)}
/>
</div>
);
});
4 changes: 2 additions & 2 deletions src/components/ReblocksQRCode/ReblocksQRCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const ReblocksQRCode: React.StatelessComponent<Props> = (props): JSX.Element =>
if (showUrl) {
return (
<div>
{qrComponent}
<div>{address}</div>
<p>{qrComponent}</p>
<p>{address}</p>
</div>
);
}
Expand Down

0 comments on commit 028a4d6

Please sign in to comment.