Skip to content

Commit

Permalink
Separate button from redirect component
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapang committed Dec 11, 2023
1 parent 22e78bf commit 7e17dfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sendroks/react-coinbase-commerce",
"version": "0.0.7",
"version": "0.0.8",
"description": "A react component to easily embed a Coinbase Commerce Checkout within your application",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
7 changes: 5 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,17 @@ export class CoinbaseCommerceButton extends Component<Props & ButtonHTMLAttribut
}

return (
<div style={wrapperStyle} onClick={()=>this.onClick()}>
{showModal && (
<div style={wrapperStyle}>
{showModal ? (
<Commerce
{...CommerceProps}
onModalClose={() => { this.onModalClose() }}
onError={(data: MessageData) => { this.handleError(data) }}
customMetadata={customMetadata}
/>
)
: (
<input type="button" onClick={()=>this.onClick()} />
)}
</div>
)
Expand Down

0 comments on commit 7e17dfa

Please sign in to comment.