Skip to content

Commit

Permalink
fix links in worldapp
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Oct 9, 2024
1 parent 15e88c9 commit 1934702
Show file tree
Hide file tree
Showing 18 changed files with 430 additions and 94 deletions.
12 changes: 6 additions & 6 deletions dist/esm/index.bundle.js

Large diffs are not rendered by default.

75 changes: 64 additions & 11 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22765,11 +22765,31 @@ var platformForWallet = (function (walletMetaData) {
return platform;
});

var link$1 = function link(_ref) {
var url = _ref.url,
target = _ref.target,
wallet = _ref.wallet;

if (target == '_blank' && (wallet === null || wallet === void 0 ? void 0 : wallet.name) === 'World App' && url.match('depay.com')) {
return "https://integrate.depay.fi/redirect?to=".concat(encodeURIComponent(url));
}

return url;
};

var WalletContext = /*#__PURE__*/React.createContext();

var PoweredBy = (function () {
var walletContext = useContext(WalletContext);
var wallet = walletContext ? walletContext.wallet : undefined;
return /*#__PURE__*/React.createElement("div", {
className: "PoweredByWrapper"
}, /*#__PURE__*/React.createElement("a", {
href: 'https://depay.com',
href: link$1({
url: 'https://depay.com',
target: '_blank',
wallet: wallet
}),
rel: "noopener noreferrer",
target: "_blank",
className: "PoweredByLink"
Expand Down Expand Up @@ -24698,8 +24718,6 @@ var Loading = /*#__PURE__*/function () {
};
}();

var WalletContext = /*#__PURE__*/React.createContext();

var SignLoginDialog = (function (props) {
var _useContext = useContext(ErrorContext),
setError = _useContext.setError;
Expand Down Expand Up @@ -27593,6 +27611,9 @@ var PaymentFailedDialog = (function () {
var _useContext2 = useContext(PaymentContext),
transaction = _useContext2.transaction;

var _useContext3 = useContext(WalletContext),
wallet = _useContext3.wallet;

return /*#__PURE__*/React.createElement(Dialog$1, {
stacked: false,
header: /*#__PURE__*/React.createElement("div", {
Expand All @@ -27616,7 +27637,11 @@ var PaymentFailedDialog = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "Link",
title: "Check your transaction on a block explorer",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, "View details")))),
Expand Down Expand Up @@ -27846,7 +27871,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "DePay has validated the payment",
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
href: link$1({
url: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand All @@ -27866,7 +27895,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "DePay is validating the payment",
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
href: link$1({
url: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand Down Expand Up @@ -27906,7 +27939,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("div", {
className: "Opacity05"
}, "Confirm in your wallet (", /*#__PURE__*/React.createElement("a", {
href: "https://depay.com/docs/payments/verify",
href: link$1({
url: "https://depay.com/docs/payments/verify",
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer",
style: {
Expand All @@ -27919,7 +27956,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "Transaction has been confirmed by the network",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link$1({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand Down Expand Up @@ -27965,7 +28006,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Resetting current approval - please wait",
href: resetApprovalTransaction === null || resetApprovalTransaction === void 0 ? void 0 : resetApprovalTransaction.url,
href: link$1({
url: resetApprovalTransaction === null || resetApprovalTransaction === void 0 ? void 0 : resetApprovalTransaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Resetting")));
Expand Down Expand Up @@ -27999,7 +28044,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Approving payment token - please wait",
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
href: link$1({
url: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
Expand Down Expand Up @@ -28043,7 +28092,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Performing the payment - please wait",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link$1({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.evm.js.map

Large diffs are not rendered by default.

75 changes: 64 additions & 11 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22767,11 +22767,31 @@ var platformForWallet = (function (walletMetaData) {
return platform;
});

var link$1 = function link(_ref) {
var url = _ref.url,
target = _ref.target,
wallet = _ref.wallet;

if (target == '_blank' && (wallet === null || wallet === void 0 ? void 0 : wallet.name) === 'World App' && url.match('depay.com')) {
return "https://integrate.depay.fi/redirect?to=".concat(encodeURIComponent(url));
}

return url;
};

var WalletContext = /*#__PURE__*/React.createContext();

var PoweredBy = (function () {
var walletContext = useContext(WalletContext);
var wallet = walletContext ? walletContext.wallet : undefined;
return /*#__PURE__*/React.createElement("div", {
className: "PoweredByWrapper"
}, /*#__PURE__*/React.createElement("a", {
href: 'https://depay.com',
href: link$1({
url: 'https://depay.com',
target: '_blank',
wallet: wallet
}),
rel: "noopener noreferrer",
target: "_blank",
className: "PoweredByLink"
Expand Down Expand Up @@ -24661,8 +24681,6 @@ var Loading = /*#__PURE__*/function () {
};
}();

var WalletContext = /*#__PURE__*/React.createContext();

var SignLoginDialog = (function (props) {
var _useContext = useContext(ErrorContext),
setError = _useContext.setError;
Expand Down Expand Up @@ -27556,6 +27574,9 @@ var PaymentFailedDialog = (function () {
var _useContext2 = useContext(PaymentContext),
transaction = _useContext2.transaction;

var _useContext3 = useContext(WalletContext),
wallet = _useContext3.wallet;

return /*#__PURE__*/React.createElement(Dialog$1, {
stacked: false,
header: /*#__PURE__*/React.createElement("div", {
Expand All @@ -27579,7 +27600,11 @@ var PaymentFailedDialog = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "Link",
title: "Check your transaction on a block explorer",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, "View details")))),
Expand Down Expand Up @@ -27809,7 +27834,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "DePay has validated the payment",
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
href: link$1({
url: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand All @@ -27829,7 +27858,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "DePay is validating the payment",
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
href: link$1({
url: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand Down Expand Up @@ -27869,7 +27902,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("div", {
className: "Opacity05"
}, "Confirm in your wallet (", /*#__PURE__*/React.createElement("a", {
href: "https://depay.com/docs/payments/verify",
href: link$1({
url: "https://depay.com/docs/payments/verify",
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer",
style: {
Expand All @@ -27882,7 +27919,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
className: "Card transparent small",
title: "Transaction has been confirmed by the network",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link$1({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement("div", {
Expand Down Expand Up @@ -27928,7 +27969,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Resetting current approval - please wait",
href: resetApprovalTransaction === null || resetApprovalTransaction === void 0 ? void 0 : resetApprovalTransaction.url,
href: link$1({
url: resetApprovalTransaction === null || resetApprovalTransaction === void 0 ? void 0 : resetApprovalTransaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Resetting")));
Expand Down Expand Up @@ -27962,7 +28007,11 @@ var Footer = (function () {
}, /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Approving payment token - please wait",
href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
href: link$1({
url: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Approving")));
Expand Down Expand Up @@ -28006,7 +28055,11 @@ var Footer = (function () {
return /*#__PURE__*/React.createElement("a", {
className: "ButtonPrimary",
title: "Performing the payment - please wait",
href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
href: link$1({
url: transaction === null || transaction === void 0 ? void 0 : transaction.url,
target: '_blank',
wallet: wallet
}),
target: "_blank",
rel: "noopener noreferrer"
}, /*#__PURE__*/React.createElement(LoadingText, null, "Paying"));
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 1934702

Please sign in to comment.