@gustavo-valsechi/client 1.3.0 → 1.3.1
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.
|
@@ -8,7 +8,7 @@ exports.Avatar = Avatar;
|
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const styles_1 = require("./styles");
|
|
11
|
-
const
|
|
11
|
+
const server_1 = require("@gustavo-valsechi/server");
|
|
12
12
|
const randomcolor_1 = __importDefault(require("randomcolor"));
|
|
13
13
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
14
|
function Avatar(props) {
|
|
@@ -19,11 +19,11 @@ function Avatar(props) {
|
|
|
19
19
|
return;
|
|
20
20
|
(async () => {
|
|
21
21
|
const storageKey = process.env.NEXT_PUBLIC_STORAGE_AVATAR;
|
|
22
|
-
const storageColor = await (0,
|
|
22
|
+
const storageColor = await (0, server_1.getStorage)(storageKey);
|
|
23
23
|
if (storageColor)
|
|
24
24
|
return setColor(storageColor);
|
|
25
25
|
const random = (0, randomcolor_1.default)({ luminosity: "light" });
|
|
26
|
-
await (0,
|
|
26
|
+
await (0, server_1.setStorage)(storageKey, random);
|
|
27
27
|
setColor(random);
|
|
28
28
|
})();
|
|
29
29
|
}, [color]);
|
|
@@ -9,7 +9,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const styles_1 = require("./styles");
|
|
11
11
|
const tools_1 = require("../tools");
|
|
12
|
-
const
|
|
12
|
+
const server_1 = require("@gustavo-valsechi/server");
|
|
13
13
|
const assets_1 = __importDefault(require("../assets"));
|
|
14
14
|
const lodash_1 = __importDefault(require("lodash"));
|
|
15
15
|
function CreditCardComponent(props) {
|
|
@@ -25,5 +25,5 @@ function CreditCardComponent(props) {
|
|
|
25
25
|
}
|
|
26
26
|
flagRef.current.style.backgroundImage = `url(${content.logo})`;
|
|
27
27
|
}, [flagRef, props.number]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-left", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-top", children: (0, jsx_runtime_1.jsx)("div", { id: "iz-credit-card-chip", style: { backgroundImage: `url(${assets_1.default.Chip})` } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-bottom", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-number", children: (0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-elipse", children:
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Container, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-left", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-top", children: (0, jsx_runtime_1.jsx)("div", { id: "iz-credit-card-chip", style: { backgroundImage: `url(${assets_1.default.Chip})` } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-bottom", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-number", children: (0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-elipse", children: server_1.Utils.mask.loop(props.number, { sequencyNumber: 4, maxSequency: 4, placeholder: "•" }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-name", children: (0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-elipse", children: lodash_1.default.deburr((_a = props.name) === null || _a === void 0 ? void 0 : _a.replace(/[^A-Za-zÀ-ÿ\s]/g, "").toUpperCase()) || "Nome do Titular" }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "iz-credit-card-top", children: (0, jsx_runtime_1.jsx)("div", { id: "iz-credit-card-flag", ref: flagRef }) }), (0, jsx_runtime_1.jsxs)("div", { className: "iz-credit-card-bottom", children: [(0, jsx_runtime_1.jsx)("span", { children: "validade" }), (0, jsx_runtime_1.jsx)("span", { children: server_1.Utils.mask.loop(props.expiry, { sequencyNumber: 2, maxSequency: 2, placeholder: "•", separator: "/" }) })] })] })] }));
|
|
29
29
|
}
|
|
@@ -7,7 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const styled_components_1 = require("styled-components");
|
|
8
8
|
const styles_1 = require("./styles");
|
|
9
9
|
const content_1 = require("./content");
|
|
10
|
-
const
|
|
10
|
+
const server_1 = require("@gustavo-valsechi/server");
|
|
11
11
|
const ThemeContext = (0, react_1.createContext)({});
|
|
12
12
|
const ThemeProviderContainer = (props) => {
|
|
13
13
|
const [theme, setTheme] = (0, react_1.useState)("light");
|
|
@@ -15,7 +15,7 @@ const ThemeProviderContainer = (props) => {
|
|
|
15
15
|
(0, react_1.useEffect)(() => {
|
|
16
16
|
if (!theme)
|
|
17
17
|
return;
|
|
18
|
-
(async () => await (0,
|
|
18
|
+
(async () => await (0, server_1.setStorage)(process.env.NEXT_PUBLIC_STORAGE_THEME, theme))();
|
|
19
19
|
}, [theme]);
|
|
20
20
|
const SwitcherComponent = () => {
|
|
21
21
|
return ((0, jsx_runtime_1.jsxs)(styles_1.Switcher, { onClick: () => setTheme(theme === "light" ? "dark" : "light"), "data-theme": theme || defaultTheme, children: [(0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-moon" }), (0, jsx_runtime_1.jsx)("div", { className: "switcher", children: (0, jsx_runtime_1.jsx)("div", {}) }), (0, jsx_runtime_1.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-sun" })] }));
|