linkup-lib 0.1.18 → 0.1.19
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/components/ui/Aside.d.ts +5 -2
- package/dist/components/ui/Aside.js +21 -5
- package/dist/image.d.ts +2 -2
- package/dist/image.js +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export declare const asideAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
2
3
|
init: boolean;
|
|
3
4
|
};
|
|
4
5
|
interface MenusProps {
|
|
5
6
|
key: string;
|
|
6
|
-
label:
|
|
7
|
+
label: React.ReactNode;
|
|
7
8
|
items?: MenusProps[];
|
|
9
|
+
onClick?: () => void;
|
|
8
10
|
}
|
|
9
11
|
export interface AsideProps {
|
|
10
12
|
primaryColor?: string;
|
|
11
13
|
menus: MenusProps[];
|
|
14
|
+
settingsUrl?: string;
|
|
12
15
|
}
|
|
13
|
-
declare const Component: ({ primaryColor, menus }: AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const Component: ({ primaryColor, menus, settingsUrl }: AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export default Component;
|
|
@@ -10,8 +10,10 @@ const fi_1 = require("react-icons/fi");
|
|
|
10
10
|
const im_1 = require("react-icons/im");
|
|
11
11
|
const jotai_1 = require("jotai");
|
|
12
12
|
exports.asideAtom = (0, jotai_1.atom)(true);
|
|
13
|
-
const Component = ({ primaryColor = "#E2702F", menus }) => {
|
|
13
|
+
const Component = ({ primaryColor = "#E2702F", menus, settingsUrl }) => {
|
|
14
14
|
var _a;
|
|
15
|
+
// 라우터
|
|
16
|
+
const router = (0, navigation_1.useRouter)();
|
|
15
17
|
// 세션
|
|
16
18
|
const session = (0, react_1.useSession)();
|
|
17
19
|
const user = (_a = session.data) === null || _a === void 0 ? void 0 : _a.user;
|
|
@@ -52,14 +54,22 @@ const Component = ({ primaryColor = "#E2702F", menus }) => {
|
|
|
52
54
|
alignItems: 'flex-end',
|
|
53
55
|
justifyContent: 'center',
|
|
54
56
|
overflow: 'hidden',
|
|
55
|
-
|
|
57
|
+
cursor: settingsUrl ? 'pointer' : 'default',
|
|
58
|
+
}, onClick: () => settingsUrl && router.push(settingsUrl), children: (0, jsx_runtime_1.jsx)(im_1.ImUser, { style: { fontSize: 75, color: "#C7CAD2", transform: "translateY(6px)" } }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
width: '100%',
|
|
63
|
+
gap: 6,
|
|
64
|
+
cursor: settingsUrl ? 'pointer' : 'default',
|
|
65
|
+
}, onClick: () => settingsUrl && router.push(settingsUrl), children: (0, jsx_runtime_1.jsx)("p", { style: { color: 'white', fontSize: 15, fontWeight: 'bold' }, children: user ? user.name : "" }) }), (0, jsx_runtime_1.jsx)("p", { style: { color: '#bbb', fontSize: 12 }, children: user ? user.levelName : "" })] }), (0, jsx_runtime_1.jsx)("ul", { style: {
|
|
56
66
|
borderTop: '1px solid #5F6673',
|
|
57
67
|
}, children: menus.map((r, idx) => {
|
|
58
68
|
return ((0, jsx_runtime_1.jsx)(Menu, { menu: r, primaryColor: primaryColor }, `menu-${r.key}`));
|
|
59
69
|
}) })] })] }));
|
|
60
70
|
};
|
|
61
71
|
// 메뉴 컴포넌트
|
|
62
|
-
const Menu = ({ menu, primaryColor }) => {
|
|
72
|
+
const Menu = ({ menu, primaryColor, }) => {
|
|
63
73
|
// 활성 메뉴
|
|
64
74
|
const pathname = (0, navigation_1.usePathname)();
|
|
65
75
|
const isActive = (0, react_2.useMemo)(() => {
|
|
@@ -84,8 +94,14 @@ const Menu = ({ menu, primaryColor }) => {
|
|
|
84
94
|
}, onClick: () => {
|
|
85
95
|
if (menu.items && menu.items.length > 0)
|
|
86
96
|
setOpen(!open);
|
|
87
|
-
else
|
|
88
|
-
|
|
97
|
+
else {
|
|
98
|
+
if (menu.onClick) {
|
|
99
|
+
menu.onClick();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
router.push(`/${menu.key}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
89
105
|
}, children: [(0, jsx_runtime_1.jsx)("p", { style: { color: isActive ? primaryColor : 'white', fontWeight: 'bold', fontSize: '15px', }, children: menu.label }), menu.items && menu.items.length > 0 ?
|
|
90
106
|
(0, jsx_runtime_1.jsx)(fi_1.FiChevronDown, { style: { color: '#6B7280', transition: '300ms', rotate: open ? '180deg' : '0deg' } })
|
|
91
107
|
: null] }), menu.items ?
|
package/dist/image.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const convertWebpAndUploadBuffer: ({ buffer, path, fileName, size
|
|
|
56
56
|
}>;
|
|
57
57
|
export declare const uploadS3Object: ({ file, type, sizes }: {
|
|
58
58
|
file: File;
|
|
59
|
-
type: "00" | "01" | "02" | "03";
|
|
59
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
60
60
|
sizes: number[];
|
|
61
61
|
}) => Promise<{
|
|
62
62
|
url: string;
|
|
@@ -72,7 +72,7 @@ export declare const deleteS3Object: (key: string) => Promise<{
|
|
|
72
72
|
declare const _default: {
|
|
73
73
|
uploadS3Object: ({ file, type, sizes }: {
|
|
74
74
|
file: File;
|
|
75
|
-
type: "00" | "01" | "02" | "03";
|
|
75
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
76
76
|
sizes: number[];
|
|
77
77
|
}) => Promise<{
|
|
78
78
|
url: string;
|
package/dist/image.js
CHANGED
|
@@ -154,7 +154,7 @@ const uploadS3Object = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file
|
|
|
154
154
|
throw new Error('이미지 변환에 실패했습니다.');
|
|
155
155
|
}
|
|
156
156
|
let filename = (0, dayjs_1.default)().format('YYYYMMDDHHmmssSSS');
|
|
157
|
-
let path = type === "00" ? "bizImage" : type === "01" ? "displayImage" : type === "02" ? "storeImage" : type === "03" ? "productImage" : "";
|
|
157
|
+
let path = type === "00" ? "bizImage" : type === "01" ? "displayImage" : type === "02" ? "storeImage" : type === "03" ? "productImage" : type === "04" ? "qna" : "";
|
|
158
158
|
if (path === "") {
|
|
159
159
|
throw new Error('잘못된 이미지 타입입니다.');
|
|
160
160
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare const _default: {
|
|
|
81
81
|
image: {
|
|
82
82
|
uploadS3Object: ({ file, type, sizes }: {
|
|
83
83
|
file: File;
|
|
84
|
-
type: "00" | "01" | "02" | "03";
|
|
84
|
+
type: "00" | "01" | "02" | "03" | "04";
|
|
85
85
|
sizes: number[];
|
|
86
86
|
}) => Promise<{
|
|
87
87
|
url: string;
|
|
@@ -97,7 +97,7 @@ declare const _default: {
|
|
|
97
97
|
};
|
|
98
98
|
Header: ({ logo }: import("./components/ui/Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
99
99
|
Header2: ({ logo }: import("./components/ui/Header2").Header2Props) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
-
Aside: ({ primaryColor, menus }: import("./components/ui/Aside").AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
Aside: ({ primaryColor, menus, settingsUrl }: import("./components/ui/Aside").AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
101
101
|
Page: ({ children }: import("./components/ui/Page").PageProps) => import("react/jsx-runtime").JSX.Element;
|
|
102
102
|
PageTitle: ({ title, section1, section2 }: import("./components/ui/PageTitle").PageTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
103
103
|
LinkupProvider: ({ size, children, color, theme }: import("./components/registry/Registry").Props) => import("react/jsx-runtime").JSX.Element;
|