Skip to content

Commit

Permalink
don't display twitter share if no twitter intent
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanglen committed Nov 10, 2023
1 parent 8b0adcf commit 69de295
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 30 deletions.
48 changes: 33 additions & 15 deletions apps/potlock/widget/Cart/Checkout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,31 +207,49 @@ return (
{props.checkoutSuccess ? (
<SuccessContainer>
<Title>Thanks for donating!</Title>
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: twitterIntent,
target: "_blank",
type: "primary",
text: "Share to Twitter",
disabled: !twitterIntent,
style: {
width: "300px",
},
}}
/>
{twitterIntent && (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: twitterIntent,
target: "_blank",
type: "primary",
text: "Share to Twitter",
disabled: !twitterIntent,
style: {
width: "300px",
},
}}
/>
)}
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: `?tab=projects`,
type: "secondary",
type: twitterIntent ? "secondary" : "primary",
text: "Explore projects",
style: {
width: "300px",
},
}}
/>
<TxLink>View transaction</TxLink>
{twitterIntent ? (
<TxLink>View transaction</TxLink>
) : (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: `https://nearblocks.io/txns/${props.checkoutSuccessTxHash}`,
target: "_blank",
type: "secondary",
text: "View transaction",
disabled: !props.checkoutSuccessTxHash,
style: {
width: "300px",
},
}}
/>
)}
</SuccessContainer>
) : (
<>
Expand Down
48 changes: 33 additions & 15 deletions build/potlock/src/Cart/Checkout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,31 +207,49 @@ return (
{props.checkoutSuccess ? (
<SuccessContainer>
<Title>Thanks for donating!</Title>
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: twitterIntent,
target: "_blank",
type: "primary",
text: "Share to Twitter",
disabled: !twitterIntent,
style: {
width: "300px",
},
}}
/>
{twitterIntent && (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: twitterIntent,
target: "_blank",
type: "primary",
text: "Share to Twitter",
disabled: !twitterIntent,
style: {
width: "300px",
},
}}
/>
)}
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: `?tab=projects`,
type: "secondary",
type: twitterIntent ? "secondary" : "primary",
text: "Explore projects",
style: {
width: "300px",
},
}}
/>
<TxLink>View transaction</TxLink>
{twitterIntent ? (
<TxLink>View transaction</TxLink>
) : (
<Widget
src={`${ownerId}/widget/Buttons.NavigationButton`}
props={{
href: `https://nearblocks.io/txns/${props.checkoutSuccessTxHash}`,
target: "_blank",
type: "secondary",
text: "View transaction",
disabled: !props.checkoutSuccessTxHash,
style: {
width: "300px",
},
}}
/>
)}
</SuccessContainer>
) : (
<>
Expand Down

0 comments on commit 69de295

Please sign in to comment.