From 337306658bb4178f6c8705dfb6c25ccdde2accd8 Mon Sep 17 00:00:00 2001 From: Albert Folch Date: Fri, 8 Sep 2023 15:38:55 +0200 Subject: [PATCH] feat: get config id from query params --- .env.example | 2 -- src/components/widgets/finance/Finance.tsx | 9 ++++++--- src/components/widgets/finance/FinanceDisplay.tsx | 5 ++++- src/components/widgets/redeem/Redeem.tsx | 7 ++++++- src/components/widgets/redeem/RedeemDisplay.tsx | 6 +++++- src/config.ts | 8 +------- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index d8b3cfa..97b6b53 100644 --- a/.env.example +++ b/.env.example @@ -3,8 +3,6 @@ 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= diff --git a/src/components/widgets/finance/Finance.tsx b/src/components/widgets/finance/Finance.tsx index 9b709de..f5a6031 100644 --- a/src/components/widgets/finance/Finance.tsx +++ b/src/components/widgets/finance/Finance.tsx @@ -1,4 +1,4 @@ -import { FinanceWidget } from "@bosonprotocol/react-kit"; +import { ConfigId, FinanceWidget } from "@bosonprotocol/react-kit"; import { useSearchParams } from "react-router-dom"; import { CONFIG } from "../../../config"; @@ -10,11 +10,14 @@ export function Finance() { if (!sellerId) { return

Missing 'sellerId' query param

; } - + const configId = searchParams.get("configId") as ConfigId; + if (!configId) { + return

Missing 'configId' query param

; + } return ( Missing 'configId' query param

; + } return (