@bosonprotocol/react-kit 0.28.2-alpha.0 → 0.28.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/lib/config/config.d.ts.map +1 -1
- package/dist/cjs/lib/config/config.js +7 -4
- package/dist/cjs/lib/config/config.js.map +1 -1
- package/dist/esm/lib/config/config.d.ts.map +1 -1
- package/dist/esm/lib/config/config.js +7 -4
- package/dist/esm/lib/config/config.js.map +1 -1
- package/package.json +3 -2
- package/src/lib/config/config.ts +13 -4
- package/src/stories/cta/funds/WithdrawFundsButton.stories.tsx +3 -6
- package/src/stories/searchBar/SearchBar.stories.tsx +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC"}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CONFIG = void 0;
|
|
4
4
|
const networks_1 = require("../const/networks");
|
|
5
|
-
const magicLinkKey = process.env.
|
|
5
|
+
const magicLinkKey = process.env.STORYBOOK_REACT_APP_MAGIC_API_KEY ||
|
|
6
|
+
process.env.REACT_APP_MAGIC_API_KEY;
|
|
6
7
|
if (!magicLinkKey) {
|
|
7
|
-
throw new Error("REACT_APP_MAGIC_API_KEY is not defined");
|
|
8
|
+
throw new Error("STORYBOOK_REACT_APP_MAGIC_API_KEY/REACT_APP_MAGIC_API_KEY is not defined");
|
|
8
9
|
}
|
|
9
|
-
const infuraKey = process.env.
|
|
10
|
+
const infuraKey = process.env.STORYBOOK_INFURA_PROJECT_SECRET ||
|
|
11
|
+
process.env.INFURA_PROJECT_SECRET ||
|
|
12
|
+
process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET;
|
|
10
13
|
if (!infuraKey) {
|
|
11
|
-
throw new Error("
|
|
14
|
+
throw new Error("STORYBOOK_INFURA_PROJECT_SECRET/INFURA_PROJECT_SECRET/REACT_APP_INFURA_IPFS_PROJECT_SECRET is not defined");
|
|
12
15
|
}
|
|
13
16
|
exports.CONFIG = {
|
|
14
17
|
magicLinkKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAE/C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAE/C,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,iCAAiC;IAC7C,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;AACtC,IAAI,CAAC,YAAY,EAAE;IACjB,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;CACH;AACD,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,+BAA+B;IAC3C,OAAO,CAAC,GAAG,CAAC,qBAAqB;IACjC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;AACnD,IAAI,CAAC,SAAS,EAAE;IACd,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;CACH;AAEY,QAAA,MAAM,GAAG;IACpB,YAAY;IACZ,SAAS;IACT,OAAO,EAAE,IAAA,qBAAU,EAAC,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { getRpcUrls } from "../const/networks";
|
|
2
|
-
const magicLinkKey = process.env.
|
|
2
|
+
const magicLinkKey = process.env.STORYBOOK_REACT_APP_MAGIC_API_KEY ||
|
|
3
|
+
process.env.REACT_APP_MAGIC_API_KEY;
|
|
3
4
|
if (!magicLinkKey) {
|
|
4
|
-
throw new Error("REACT_APP_MAGIC_API_KEY is not defined");
|
|
5
|
+
throw new Error("STORYBOOK_REACT_APP_MAGIC_API_KEY/REACT_APP_MAGIC_API_KEY is not defined");
|
|
5
6
|
}
|
|
6
|
-
const infuraKey = process.env.
|
|
7
|
+
const infuraKey = process.env.STORYBOOK_INFURA_PROJECT_SECRET ||
|
|
8
|
+
process.env.INFURA_PROJECT_SECRET ||
|
|
9
|
+
process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET;
|
|
7
10
|
if (!infuraKey) {
|
|
8
|
-
throw new Error("
|
|
11
|
+
throw new Error("STORYBOOK_INFURA_PROJECT_SECRET/INFURA_PROJECT_SECRET/REACT_APP_INFURA_IPFS_PROJECT_SECRET is not defined");
|
|
9
12
|
}
|
|
10
13
|
export const CONFIG = {
|
|
11
14
|
magicLinkKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/lib/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,iCAAiC;IAC7C,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;AACtC,IAAI,CAAC,YAAY,EAAE;IACjB,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;CACH;AACD,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,+BAA+B;IAC3C,OAAO,CAAC,GAAG,CAAC,qBAAqB;IACjC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;AACnD,IAAI,CAAC,SAAS,EAAE;IACd,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;CACH;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,YAAY;IACZ,SAAS;IACT,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC;CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bosonprotocol/react-kit",
|
|
3
3
|
"description": "React toolkit with smart components and hooks for building on top of the Boson Protocol.",
|
|
4
|
-
"version": "0.28.2-alpha.
|
|
4
|
+
"version": "0.28.2-alpha.2",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
7
7
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -146,6 +146,7 @@
|
|
|
146
146
|
"@web3-react/metamask": "8.2.4",
|
|
147
147
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
148
148
|
"buffer": "6.0.3",
|
|
149
|
+
"chromatic": "^11.0.8",
|
|
149
150
|
"copyfiles": "^2.4.1",
|
|
150
151
|
"customize-cra": "^1.0.0",
|
|
151
152
|
"eslint": "^8.10.0",
|
|
@@ -168,5 +169,5 @@
|
|
|
168
169
|
"overrides": {
|
|
169
170
|
"typescript": "^5.1.6"
|
|
170
171
|
},
|
|
171
|
-
"gitHead": "
|
|
172
|
+
"gitHead": "5bc6c1b1f83cb4cb08da7a417446fb442c7a4b38"
|
|
172
173
|
}
|
package/src/lib/config/config.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { getRpcUrls } from "../const/networks";
|
|
2
2
|
|
|
3
|
-
const magicLinkKey =
|
|
3
|
+
const magicLinkKey =
|
|
4
|
+
process.env.STORYBOOK_REACT_APP_MAGIC_API_KEY ||
|
|
5
|
+
process.env.REACT_APP_MAGIC_API_KEY;
|
|
4
6
|
if (!magicLinkKey) {
|
|
5
|
-
throw new Error(
|
|
7
|
+
throw new Error(
|
|
8
|
+
"STORYBOOK_REACT_APP_MAGIC_API_KEY/REACT_APP_MAGIC_API_KEY is not defined"
|
|
9
|
+
);
|
|
6
10
|
}
|
|
7
|
-
const infuraKey =
|
|
11
|
+
const infuraKey =
|
|
12
|
+
process.env.STORYBOOK_INFURA_PROJECT_SECRET ||
|
|
13
|
+
process.env.INFURA_PROJECT_SECRET ||
|
|
14
|
+
process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET;
|
|
8
15
|
if (!infuraKey) {
|
|
9
|
-
throw new Error(
|
|
16
|
+
throw new Error(
|
|
17
|
+
"STORYBOOK_INFURA_PROJECT_SECRET/INFURA_PROJECT_SECRET/REACT_APP_INFURA_IPFS_PROJECT_SECRET is not defined"
|
|
18
|
+
);
|
|
10
19
|
}
|
|
11
20
|
|
|
12
21
|
export const CONFIG = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
1
2
|
import React, { useRef } from "react";
|
|
2
|
-
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
3
|
|
|
4
4
|
import { WithdrawFundsButton } from "../../../components/cta/funds/WithdrawFundsButton";
|
|
5
5
|
|
|
6
|
+
import { BigNumber } from "ethers";
|
|
6
7
|
import { hooks } from "../../helpers/connect-wallet";
|
|
7
8
|
import { CtaButtonWrapper } from "../../helpers/CtaButtonWrapper";
|
|
8
|
-
import { BigNumberish } from "ethers";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: "Visual Components/CTA/funds/WithdrawFundsButton",
|
|
@@ -52,10 +52,7 @@ Simple.args = {
|
|
|
52
52
|
tokensToWithdraw: [
|
|
53
53
|
{
|
|
54
54
|
address: "",
|
|
55
|
-
amount:
|
|
56
|
-
type: "BigNumber",
|
|
57
|
-
hex: ""
|
|
58
|
-
} as unknown as BigNumberish
|
|
55
|
+
amount: BigNumber.from(0)
|
|
59
56
|
}
|
|
60
57
|
],
|
|
61
58
|
disabled: false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
3
|
|
|
4
|
+
import { EnvironmentType, getEnvConfigs } from "@bosonprotocol/core-sdk";
|
|
4
5
|
import { SearchBar } from "../../components/searchBar/SearchBar";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
@@ -13,8 +14,11 @@ const Template: ComponentStory<typeof SearchBar> = (args) => (
|
|
|
13
14
|
);
|
|
14
15
|
|
|
15
16
|
export const Primary: ComponentStory<typeof SearchBar> = Template.bind({});
|
|
16
|
-
|
|
17
|
+
const envName =
|
|
18
|
+
(process.env.STORYBOOK_DATA_ENV_NAME as EnvironmentType) || "testing";
|
|
19
|
+
const envConfig = getEnvConfigs(envName);
|
|
17
20
|
Primary.args = {
|
|
18
21
|
disabled: false,
|
|
19
|
-
envName
|
|
22
|
+
envName,
|
|
23
|
+
configId: envConfig[0].configId
|
|
20
24
|
};
|