Skip to content

Commit

Permalink
Add onClick attribute to div
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapang committed Dec 11, 2023
1 parent ec86350 commit 22e78bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 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.6",
"version": "0.0.7",
"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
3 changes: 3 additions & 0 deletions src/commerce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class Commerce extends Component<Props, State> {
const { hostname, port, protocol } = window.location
const hostName = `${protocol}//${hostname}${port ? `:${port}` : ''}/`
const url = this.buildSrc(hostName)

console.log("Commerce url: ", url);

window.location.assign(url)
}

Expand Down
28 changes: 1 addition & 27 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,6 @@ export class CoinbaseCommerceButton extends Component<Props & ButtonHTMLAttribut
this.onModalClose()
}

private getButtonProps (): Partial<Props> {
const ignoredProps = [
'onLoad',
'onChargeSuccess',
'onChargeFailure',
'customMetadata',
'onPaymentDetected',
'onModalClosed',
'checkoutId',
'chargeId',
'disableCaching',
'wrapperStyle',
'styled'
]

return Object.keys({ ...this.props })
.filter((key: string) => !ignoredProps.includes(key))
.reduce<Partial<Props>>(
(result: Partial<Props>, key: string) => ({
...result,
[key]: (this.props as any)[key]
}),
{}
)
};

render (): JSX.Element {
const { showModal } = this.state
const {
Expand All @@ -109,7 +83,7 @@ export class CoinbaseCommerceButton extends Component<Props & ButtonHTMLAttribut
}

return (
<div style={wrapperStyle}>
<div style={wrapperStyle} onClick={()=>this.onClick()}>
{showModal && (
<Commerce
{...CommerceProps}
Expand Down

0 comments on commit 22e78bf

Please sign in to comment.