Skip to content

Commit 9b3781f

Browse files
Merge pull request #169 from bosonprotocol/168-add-base-network
feat: upgrade react-kit to support base network
2 parents 769e123 + f7980b1 commit 9b3781f

11 files changed

Lines changed: 585 additions & 1139 deletions

File tree

package-lock.json

Lines changed: 258 additions & 859 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
]
4545
},
4646
"dependencies": {
47-
"@bosonprotocol/react-kit": "^0.35.1-alpha.7",
47+
"@bosonprotocol/react-kit": "^0.36.0-alpha.16",
4848
"@krakenjs/zoid": "^10.3.3",
4949
"@svgr/webpack": "^8.1.0",
5050
"@testing-library/jest-dom": "^5.16.5",

src/App.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import {
1212
} from "./components/widgets/commitButton/CommitButton";
1313
import { Finance, financePath } from "./components/widgets/finance/Finance";
1414
import { indexPath } from "./components/widgets/path";
15-
import {
16-
PurchaseOverview,
17-
purchaseOverviewPath
18-
} from "./components/widgets/purchaseOverview/PurchaseOverview";
1915
import { Redeem, redeemPath } from "./components/widgets/redeem/Redeem";
2016
import { GlobalStyle } from "./globalStyles";
2117

@@ -30,10 +26,6 @@ function App() {
3026
<Route path={financePath} element={<Finance />}></Route>
3127
<Route path={commitPath} element={<Commit />}></Route>
3228
<Route path={commitButtonPath} element={<CommitButton />}></Route>
33-
<Route
34-
path={purchaseOverviewPath}
35-
element={<PurchaseOverview />}
36-
></Route>
3729
<Route path={redeemPath} element={<Redeem />}></Route>
3830
</Routes>
3931
</HashRouter>

src/components/widgets/commit/Commit.tsx

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { CSSProperties } from "styled-components";
55
import * as yup from "yup";
66

77
import { CONFIG, getMetaTxConfig } from "../../../config";
8+
import {
9+
createDeliveryInfoHandler,
10+
createRedemptionConfirmedHandler,
11+
createRedemptionSubmittedHandler,
12+
parseDeliveryInfoData
13+
} from "../../../utils/redeem";
814
import { GlobalStyle } from "../styles";
915

1016
export const commitPath = "/commit";
@@ -60,12 +66,47 @@ export function Commit() {
6066
const account = getProp("account") as string;
6167
const withExternalSigner = getProp("withExternalSigner");
6268
const bodyOverflow = getProp("bodyOverflow");
69+
70+
const {
71+
deliveryInfoDecoded,
72+
sendDeliveryInfoThroughXMTP,
73+
shouldWaitForResponse,
74+
postDeliveryInfoHeadersDecoded,
75+
postDeliveryInfoUrl,
76+
postRedemptionConfirmedHeadersDecoded,
77+
postRedemptionConfirmedUrl,
78+
postRedemptionSubmittedHeadersDecoded,
79+
postRedemptionSubmittedUrl,
80+
targetOrigin,
81+
eventTag
82+
} = parseDeliveryInfoData(searchParams);
6383
return (
6484
<>
6585
<GlobalStyle $bodyOverflow={bodyOverflow} />
6686
<CommitWidget
87+
withGlobalStyle={false}
88+
roundness="min"
89+
sendDeliveryInfoThroughXMTP={sendDeliveryInfoThroughXMTP}
90+
deliveryInfoHandler={createDeliveryInfoHandler(
91+
targetOrigin,
92+
shouldWaitForResponse,
93+
eventTag
94+
)}
95+
redemptionSubmittedHandler={createRedemptionSubmittedHandler(
96+
targetOrigin
97+
)}
98+
redemptionConfirmedHandler={createRedemptionConfirmedHandler(
99+
targetOrigin
100+
)}
101+
deliveryInfo={deliveryInfoDecoded}
102+
postDeliveryInfoUrl={postDeliveryInfoUrl}
103+
postDeliveryInfoHeaders={postDeliveryInfoHeadersDecoded}
104+
postRedemptionSubmittedUrl={postRedemptionSubmittedUrl}
105+
postRedemptionSubmittedHeaders={postRedemptionSubmittedHeadersDecoded}
106+
postRedemptionConfirmedUrl={postRedemptionConfirmedUrl}
107+
postRedemptionConfirmedHeaders={postRedemptionConfirmedHeadersDecoded}
67108
withCustomReduxContext={false}
68-
withWeb3React={false}
109+
withWeb3React={true}
69110
withExternalSigner={withExternalSigner === "true"}
70111
configId={configId}
71112
forcedAccount={account}
@@ -93,7 +134,6 @@ export function Commit() {
93134
ipfsGateway={CONFIG.ipfsGateway as string}
94135
ipfsProjectId={CONFIG.ipfsProjectId}
95136
ipfsProjectSecret={CONFIG.ipfsProjectSecret}
96-
children={<></>}
97137
walletConnectProjectId={CONFIG.walletConnectProjectId as string}
98138
fairExchangePolicyRules={CONFIG.fairExchangePolicyRules as string}
99139
closeWidgetClick={() => {

src/components/widgets/commitButton/CommitButton.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { GlobalStyle } from "../styles";
1111
export const commitButtonPath = "/commit-button";
1212

1313
declare const CommitWidgetModal: (props: Record<string, unknown>) => any;
14-
declare const PurchaseOverviewModal: (props: Record<string, unknown>) => any;
1514

1615
const yupStringOrNumber = yup
1716
.mixed<string | number>()
@@ -215,26 +214,6 @@ export function CommitButton() {
215214
props.onClickCommitButton();
216215
}
217216
}}
218-
onTaglineClick={() => {
219-
PurchaseOverviewModal({
220-
bodyOverflow,
221-
onClose: () => {
222-
if (
223-
typeof props.onCloseTagline === "function" &&
224-
props.onCloseTagline
225-
) {
226-
props.onCloseTagline();
227-
}
228-
},
229-
modalMargin
230-
}).renderTo(window.parent, renderToValue, validatedContext);
231-
if (
232-
typeof props.onClickTagline === "function" &&
233-
props.onClickTagline
234-
) {
235-
props.onClickTagline();
236-
}
237-
}}
238217
/>
239218
</>
240219
);

src/components/widgets/finance/Finance.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function Finance() {
2222
<FinanceWidget
2323
withReduxProvider={true}
2424
withCustomReduxContext={false}
25-
withWeb3React={false}
25+
withWeb3React={true}
2626
sellerId={sellerId}
2727
withExternalSigner={withExternalSigner === "true"}
2828
configId={configId}
@@ -41,7 +41,6 @@ export function Finance() {
4141
licenseTemplate={CONFIG.licenseTemplate as string}
4242
defaultCurrencyTicker="USD"
4343
defaultCurrencySymbol="$"
44-
children={<></>}
4544
walletConnectProjectId={CONFIG.walletConnectProjectId as string}
4645
fairExchangePolicyRules={CONFIG.fairExchangePolicyRules as string}
4746
></FinanceWidget>

src/components/widgets/purchaseOverview/PurchaseOverview.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)