Skip to content

Commit

Permalink
Merge pull request #57 from bosonprotocol/upgrade-react-kit-2
Browse files Browse the repository at this point in the history
chore: upgrade react-kit
  • Loading branch information
albertfolch-redeemeum authored Sep 8, 2023
2 parents 5c2dd8d + 2781722 commit 6eedaca
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ REACT_APP_ENV_NAME=testing
# REACT_APP_ENV_NAME=staging
# REACT_APP_ENV_NAME=production

REACT_APP_CONFIG_ID=testing-80001-0

# Infura IPFS project ID, used for auth header
REACT_APP_INFURA_IPFS_PROJECT_ID=

Expand Down
102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@bosonprotocol/react-kit": "^0.20.0-alpha.13",
"@bosonprotocol/react-kit": "^0.20.0-alpha.14",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/widgets/finance/Finance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function Finance() {
return (
<FinanceWidget
sellerId={sellerId}
configId={CONFIG.configId}
envName={CONFIG.envName}
metaTx={{
apiKey: CONFIG.metaTxApiKey as string,
Expand Down
1 change: 1 addition & 0 deletions src/components/widgets/redeem/Redeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function Redeem() {
return (
<RedemptionWidget
exchangeId={exchangeId}
configId={CONFIG.configId}
envName={CONFIG.envName}
metaTx={{
apiKey: CONFIG.metaTxApiKey as string,
Expand Down
8 changes: 7 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { EnvironmentType } from "@bosonprotocol/react-kit";
import { ConfigId, EnvironmentType } from "@bosonprotocol/react-kit";
import { Buffer } from "buffer";

const envName = process.env.REACT_APP_ENV_NAME as EnvironmentType;
const configId = process.env.REACT_APP_CONFIG_ID as ConfigId;

if (!envName || ["testing", "staging", "production"].indexOf(envName) < 0) {
throw `REACT_APP_ENV_NAME env variable is missing or invalid ('${envName}')`;
}

if (!configId) {
throw `REACT_APP_CONFIG_ID env variable is missing ('${configId}')`;
}

type ConfigFields =
| "defaultTokens"
| "defaultDisputeResolverId"
Expand Down Expand Up @@ -124,6 +129,7 @@ if (!_CONFIG) {

export const CONFIG = {
envName,
configId,
ipfsMetadataStorageHeaders: getIpfsMetadataStorageHeaders(
process.env.REACT_APP_INFURA_IPFS_PROJECT_ID,
process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET
Expand Down

0 comments on commit 6eedaca

Please sign in to comment.