@dynamic-labs/wallet-book 0.0.1 → 0.0.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/src/components/WalletIcon.d.ts +5 -5
- package/dist/cjs/src/components/WalletIcon.js +1 -1
- package/dist/cjs/src/components/WalletIcon.js.map +1 -1
- package/dist/esm/src/components/WalletIcon.d.ts +5 -5
- package/dist/esm/src/components/WalletIcon.js +3 -3
- package/dist/esm/src/components/WalletIcon.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
type WalletIconProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {
|
|
3
3
|
walletName: string | undefined;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
};
|
|
5
|
+
export declare const WalletIcon: FC<WalletIconProps>;
|
|
6
|
+
export {};
|
|
@@ -7,7 +7,7 @@ const getIconUrl_1 = require("../helpers/getIconUrl");
|
|
|
7
7
|
const WalletIcon = ({ walletName, children, ...props }) => {
|
|
8
8
|
const walletData = (0, helpers_1.getWalletBookWallet)(walletName);
|
|
9
9
|
if (!walletData || !walletData.brand) {
|
|
10
|
-
return (
|
|
10
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
11
11
|
}
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)("img", { "data-testid": `wallet-icon-${walletName}`, ...props, alt: walletData.brand.alt, src: (0, getIconUrl_1.getWalletIconUrl)(walletName) }));
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletIcon.js","sourceRoot":"","sources":["../../../../src/components/WalletIcon.tsx"],"names":[],"mappings":";;;;AACA,wCAAiD;AACjD,sDAAyD;
|
|
1
|
+
{"version":3,"file":"WalletIcon.js","sourceRoot":"","sources":["../../../../src/components/WalletIcon.tsx"],"names":[],"mappings":";;;;AACA,wCAAiD;AACjD,sDAAyD;AASlD,MAAM,UAAU,GAAwB,CAAC,EAC9C,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,UAAU,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;QACpC,OAAO,2DAAG,QAAQ,GAAI,CAAC;KACxB;IAED,OAAO,CACL,+CACe,eAAe,UAAU,EAAE,KACpC,KAAK,EACT,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,EACzB,GAAG,EAAE,IAAA,6BAAgB,EAAC,UAAU,CAAC,GACjC,CACH,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,UAAU,cAkBrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
type WalletIconProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {
|
|
3
3
|
walletName: string | undefined;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
};
|
|
5
|
+
export declare const WalletIcon: FC<WalletIconProps>;
|
|
6
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getWalletBookWallet } from
|
|
3
|
-
import { getWalletIconUrl } from
|
|
2
|
+
import { getWalletBookWallet } from "../helpers";
|
|
3
|
+
import { getWalletIconUrl } from "../helpers/getIconUrl";
|
|
4
4
|
export const WalletIcon = ({ walletName, children, ...props }) => {
|
|
5
5
|
const walletData = getWalletBookWallet(walletName);
|
|
6
6
|
if (!walletData || !walletData.brand) {
|
|
7
|
-
return
|
|
7
|
+
return _jsx(_Fragment, { children: children });
|
|
8
8
|
}
|
|
9
9
|
return (_jsx("img", { "data-testid": `wallet-icon-${walletName}`, ...props, alt: walletData.brand.alt, src: getWalletIconUrl(walletName) }));
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletIcon.js","sourceRoot":"","sources":["../../../../src/components/WalletIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"WalletIcon.js","sourceRoot":"","sources":["../../../../src/components/WalletIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AASzD,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAC9C,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;QACpC,OAAO,4BAAG,QAAQ,GAAI,CAAC;KACxB;IAED,OAAO,CACL,6BACe,eAAe,UAAU,EAAE,KACpC,KAAK,EACT,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,EACzB,GAAG,EAAE,gBAAgB,CAAC,UAAU,CAAC,GACjC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED