@edu-tosel/design 1.0.67 → 1.0.69
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/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.69
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { State } from "../../interface";
|
|
2
2
|
interface PaginationProps<T> {
|
|
3
|
-
state: State<
|
|
4
|
-
|
|
3
|
+
state: State<T>;
|
|
4
|
+
selectOptions: T[];
|
|
5
5
|
}
|
|
6
|
-
export default function Pagination<T>({ state,
|
|
6
|
+
export default function Pagination<T>({ state, selectOptions, }: PaginationProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import SVG from "../../asset/SVG";
|
|
4
|
-
export default function Pagination({ state,
|
|
5
|
-
const [
|
|
4
|
+
export default function Pagination({ state, selectOptions, }) {
|
|
5
|
+
const [value, setValue] = state;
|
|
6
6
|
const container = {
|
|
7
7
|
displays: "flex items-center justify-between",
|
|
8
8
|
sizes: "w-23.5 h-6.25",
|
|
@@ -10,11 +10,12 @@ export default function Pagination({ state, items }) {
|
|
|
10
10
|
boundaries: "rounded-full px-2.5",
|
|
11
11
|
fonts: "text-xs",
|
|
12
12
|
};
|
|
13
|
+
const index = selectOptions.indexOf(value);
|
|
13
14
|
return (_jsxs("div", { className: cn(container), children: [_jsx(SVG.Symbol.LessThan, { onClick: () => {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
} }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
if (index > 0)
|
|
16
|
+
setValue(selectOptions[index - 1]);
|
|
17
|
+
} }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [index + 1, _jsx("div", { className: "text-gray-medium text-base font-pretendard-bold", children: "/" }), selectOptions.length] }), _jsx(SVG.Symbol.GreaterThan, { onClick: () => {
|
|
18
|
+
if (index < selectOptions.length - 1)
|
|
19
|
+
setValue(selectOptions[index + 1]);
|
|
19
20
|
} })] }));
|
|
20
21
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { State } from "../../../interface";
|
|
1
2
|
interface SwipeProps<T> {
|
|
2
3
|
title: string;
|
|
4
|
+
state: State<T>;
|
|
5
|
+
selectOptions: T[];
|
|
3
6
|
children: React.ReactNode;
|
|
4
|
-
selectOptions: {
|
|
5
|
-
title: string;
|
|
6
|
-
value: T;
|
|
7
|
-
}[];
|
|
8
7
|
}
|
|
9
|
-
export default function Swipe<T>({ title,
|
|
8
|
+
export default function Swipe<T>({ title, state, selectOptions, children, }: SwipeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import Pagination from "../Pagination";
|
|
4
3
|
import { cn } from "../../../util";
|
|
5
|
-
export default function Swipe({ title,
|
|
6
|
-
const page = useState(1);
|
|
4
|
+
export default function Swipe({ title, state, selectOptions, children, }) {
|
|
7
5
|
const container = {
|
|
8
6
|
displays: "flex flex-col gap-y-3",
|
|
9
7
|
};
|
|
10
|
-
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("div", { children: title }), _jsx(Pagination, { state:
|
|
8
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("div", { children: title }), _jsx(Pagination, { state: state, selectOptions: selectOptions })] }), children] }));
|
|
11
9
|
}
|