@ludo.ninja/components 2.3.5 → 2.3.7
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/build/components/myWallets/index.d.ts +9 -0
- package/build/components/myWallets/index.js +24 -0
- package/build/components/myWallets/myWalletItem/index.d.ts +10 -0
- package/build/components/myWallets/myWalletItem/index.js +56 -0
- package/build/components/myWallets/myWalletItem/myWalletItemCheckBox/index.d.ts +7 -0
- package/build/components/myWallets/myWalletItem/myWalletItemCheckBox/index.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IWallet } from "@ludo.ninja/api/build/graphql_tools/__generated__/galleriesHost/schema";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare const MyWallets: ({ caption, userWallets, isLoading, children, }: {
|
|
4
|
+
caption?: string;
|
|
5
|
+
userWallets: IWallet[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MyWallets;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const ui_1 = require("@ludo.ninja/ui");
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const StyledMyWalletsCaption = (0, styled_components_1.default)(ui_1.H2) `
|
|
10
|
+
margin-bottom: 20px;
|
|
11
|
+
`;
|
|
12
|
+
const StyledMyWalletsWrapper = styled_components_1.default.div `
|
|
13
|
+
margin-bottom: 24px;
|
|
14
|
+
`;
|
|
15
|
+
const StyledMyWallets = styled_components_1.default.div `
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
width: 300px;
|
|
18
|
+
//height: 348px;
|
|
19
|
+
//overflow-y: scroll;
|
|
20
|
+
`;
|
|
21
|
+
const MyWallets = ({ caption, userWallets, isLoading, children, }) => {
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(StyledMyWalletsWrapper, { children: [!userWallets.length && !isLoading && (0, jsx_runtime_1.jsx)(ui_1.H5, { children: "No connected wallets." }), caption && (0, jsx_runtime_1.jsx)(StyledMyWalletsCaption, { children: caption }), (0, jsx_runtime_1.jsx)(StyledMyWallets, { children: children })] }));
|
|
23
|
+
};
|
|
24
|
+
exports.default = MyWallets;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { BlockChainEntity } from "@ludo.ninja/core";
|
|
3
|
+
type MyWalletItemProps = {
|
|
4
|
+
blockchain: BlockChainEntity;
|
|
5
|
+
address: string | null;
|
|
6
|
+
isMainWallet: boolean;
|
|
7
|
+
children?: ReactElement;
|
|
8
|
+
};
|
|
9
|
+
declare const MyWalletItem: ({ blockchain, address, isMainWallet, children, }: MyWalletItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default MyWalletItem;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const utils_1 = require("@ludo.ninja/utils");
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
10
|
+
const env_1 = require("../../../store/env");
|
|
11
|
+
const StyledMyWalletItem = styled_components_1.default.div `
|
|
12
|
+
position: relative;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
border: 1px solid ${(props) => (props.isMainWallet ? colors_1.AccentColor : "#cfd5ea")};
|
|
15
|
+
padding: 10px 12px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
min-height: 36px;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
user-select: none;
|
|
21
|
+
background-color: ${(props) => (props.isMainWallet ? colors_1.WhiteColor : "#f6f7fd")};
|
|
22
|
+
margin-bottom: 12px;
|
|
23
|
+
|
|
24
|
+
&:last-child {
|
|
25
|
+
margin-bottom: 0;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const StyledImg = styled_components_1.default.img `
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
`;
|
|
31
|
+
const StyledContent = styled_components_1.default.div `
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
margin-left: 12px;
|
|
36
|
+
height: 100%;
|
|
37
|
+
text-align: left;
|
|
38
|
+
|
|
39
|
+
span {
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
color: ${colors_1.BlackColor};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
p {
|
|
45
|
+
margin: 0;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
color: ${colors_1.TextGrayColor};
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
const MyWalletItem = ({ blockchain, address, isMainWallet, children, }) => {
|
|
51
|
+
const getStaticENVDomain = (0, env_1.useEnvStore)((state) => state.getStaticDomain);
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(StyledMyWalletItem, { isMainWallet: isMainWallet, children: [children, (0, jsx_runtime_1.jsx)(StyledImg, { width: 36, height: 36, src: blockchain.getBlockChainIconRegular({
|
|
53
|
+
domain: getStaticENVDomain(),
|
|
54
|
+
}), alt: blockchain.getBlockChainPublicLabel() }), (0, jsx_runtime_1.jsxs)(StyledContent, { children: [(0, jsx_runtime_1.jsx)("span", { children: (0, utils_1.shortenedText)(address) }), (0, jsx_runtime_1.jsx)("p", { children: blockchain.getBlockChainPublicLabel() })] })] }));
|
|
55
|
+
};
|
|
56
|
+
exports.default = MyWalletItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseFormRegister } from "react-hook-form";
|
|
2
|
+
declare const MyWalletItemCheckBox: ({ onChange, name, register, }: {
|
|
3
|
+
onChange: () => Promise<void>;
|
|
4
|
+
name: string;
|
|
5
|
+
register: UseFormRegister<any>;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default MyWalletItemCheckBox;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const Forms_1 = require("../../../../system/Forms");
|
|
9
|
+
const StyledCheckbox = styled_components_1.default.div `
|
|
10
|
+
position: absolute;
|
|
11
|
+
right: 12px;
|
|
12
|
+
`;
|
|
13
|
+
const MyWalletItemCheckBox = ({ onChange, name, register, }) => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(StyledCheckbox, { children: (0, jsx_runtime_1.jsx)(Forms_1.CheckboxInput, { label: "", data: { name }, register: register(name, { onChange }) }) }));
|
|
15
|
+
};
|
|
16
|
+
exports.default = MyWalletItemCheckBox;
|