@ludo.ninja/components 2.2.20 → 2.2.21
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.
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -13,11 +36,10 @@ const constants_1 = require("@ludo.ninja/core/build/constants");
|
|
|
13
36
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
14
37
|
const image_1 = __importDefault(require("next/image"));
|
|
15
38
|
const link_1 = __importDefault(require("next/link"));
|
|
16
|
-
const styled_components_1 =
|
|
39
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
17
40
|
// Styles
|
|
18
|
-
const
|
|
41
|
+
const ExperienceLabelStyles = () => (0, styled_components_1.css) `
|
|
19
42
|
${boxShadow_1.default};
|
|
20
|
-
${boxTransform_1.default};
|
|
21
43
|
display: flex;
|
|
22
44
|
gap: 8px;
|
|
23
45
|
user-select: none;
|
|
@@ -37,6 +59,7 @@ const StyledExpTab = (0, styled_components_1.default)(link_1.default) `
|
|
|
37
59
|
line-height: 1.3;
|
|
38
60
|
color: ${({ theme }) => theme.colors?.experienceGradientLabel?.color};
|
|
39
61
|
}
|
|
62
|
+
|
|
40
63
|
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
41
64
|
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
42
65
|
padding: ${(0, _4k_1.adaptiveValueCalc)(5)} ${(0, _4k_1.adaptiveValueCalc)(8)} ${(0, _4k_1.adaptiveValueCalc)(5)} ${(0, _4k_1.adaptiveValueCalc)(6)};
|
|
@@ -54,12 +77,22 @@ const StyledExpTab = (0, styled_components_1.default)(link_1.default) `
|
|
|
54
77
|
}
|
|
55
78
|
}
|
|
56
79
|
`;
|
|
80
|
+
const StyledExpLink = (0, styled_components_1.default)(link_1.default) `
|
|
81
|
+
${boxTransform_1.default};
|
|
82
|
+
${ExperienceLabelStyles};
|
|
83
|
+
`;
|
|
84
|
+
const StyledExpTab = styled_components_1.default.div `
|
|
85
|
+
${ExperienceLabelStyles};
|
|
86
|
+
`;
|
|
57
87
|
//Component
|
|
58
88
|
const ExperienceLabel = ({ value = 0, link, loading }) => {
|
|
59
89
|
if (loading)
|
|
60
90
|
return (0, jsx_runtime_1.jsx)(SkeletonLabel_1.default, {});
|
|
61
91
|
if (!value)
|
|
62
92
|
return null;
|
|
63
|
-
return ((0, jsx_runtime_1.
|
|
93
|
+
return link ? ((0, jsx_runtime_1.jsx)(StyledExpLink, { href: link, children: (0, jsx_runtime_1.jsx)(LabelContent, { value: value }) })) : ((0, jsx_runtime_1.jsx)(StyledExpTab, { children: (0, jsx_runtime_1.jsx)(LabelContent, { value: value }) }));
|
|
94
|
+
};
|
|
95
|
+
const LabelContent = ({ value }) => {
|
|
96
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(image_1.default, { src: `${constants_1.staticLink}/public/rewardsPage/XP_logo.svg`, alt: "Experience logo", width: 20, height: 20 }), (0, jsx_runtime_1.jsxs)("p", { className: `value`, children: [value, " XP"] })] }));
|
|
64
97
|
};
|
|
65
98
|
exports.default = ExperienceLabel;
|