Skip to content

Commit

Permalink
Merge pull request #12 from gocardless/add-instructions-to-storybook
Browse files Browse the repository at this point in the history
Add instructions to storybook
  • Loading branch information
markwilson committed Jul 25, 2022
2 parents 64a5349 + 89f3fbf commit 0b7e7a9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<style>
html {
font-family: sans-serif;
}
</style>

51 changes: 45 additions & 6 deletions src/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,42 @@ import { action } from "@storybook/addon-actions";

import { GoCardlessDropinButton } from ".";

const Instructions = () => (
<>
<p>
If you do not yet have an integration with our{" "}
<a href="https://developer.gocardless.com/billing-requests/overview">
Billing Requests
</a>
, you can follow these steps to generate a BRF ID using our Sandbox demo
payment page:-
</p>
<ol>
<li>
Open the{" "}
<a
href="https://pay-sandbox.gocardless.com/billing_request_flows/demo"
target={"_blank"}
rel="noreferrer"
>
sandbox demo payment URL
</a>
</li>
<li>Wait for it to redirect you to a payment flow</li>
<li>
Copy the Billing Request Flow ID from the URL (it starts with{" "}
<code>BRF</code>)
</li>
<li>Come back to the Storybook</li>
<li>Click into the Controls tab</li>
<li>Paste the Billing Request Flow ID into the relevant control field</li>
<li>
Try the button in the canvas and see the modal showing a payment flow
</li>
</ol>
</>
);

// Render the GoCardlessDropinButton, which allows triggering of a new Dropin
// modal.
//
Expand All @@ -17,12 +53,15 @@ export const Base = ({
environment: string;
}) => {
return (
<GoCardlessDropinButton
billingRequestFlowID={billingRequestFlowID}
environment={environment}
onSuccess={action("onSuccess")}
onExit={action("onExit")}
/>
<>
<GoCardlessDropinButton
billingRequestFlowID={billingRequestFlowID}
environment={environment}
onSuccess={action("onSuccess")}
onExit={action("onExit")}
/>
<Instructions />
</>
);
};

Expand Down

0 comments on commit 0b7e7a9

Please sign in to comment.