@daeryun/dr_components 1.1.71 → 1.1.73
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/PaginationForGroup/PaginationForGroup.d.ts +2 -1
- package/dist/components/PaginationForGroup/PaginationForGroup.jsx +6 -2
- package/dist/components/PaginationForGroup/PaginationForGroup.tsx +7 -1
- package/dist/components/page/Success/SuccessList.jsx +4 -1
- package/dist/components/page/Success/SuccessList.tsx +11 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ interface PaginationProps {
|
|
|
5
5
|
currentPage: number;
|
|
6
6
|
className?: string;
|
|
7
7
|
query?: string;
|
|
8
|
+
onChange?: (pageNum: number) => void;
|
|
8
9
|
}
|
|
9
|
-
declare const PaginationForGroup: ({ total, size, currentPage, className }: PaginationProps) => React.JSX.Element;
|
|
10
|
+
declare const PaginationForGroup: ({ total, size, currentPage, className, onChange }: PaginationProps) => React.JSX.Element;
|
|
10
11
|
export default PaginationForGroup;
|
|
@@ -17,7 +17,7 @@ import { usePathname, useSearchParams } from 'next/navigation';
|
|
|
17
17
|
import arrowLeft from '../../asset/images/myCase/pagination/arrow_l_on.webp';
|
|
18
18
|
import arrowRight from '../../asset/images/myCase/pagination/arrow_r_on.webp';
|
|
19
19
|
import Image from 'next/image';
|
|
20
|
-
const PaginationForGroup = ({ total, size, currentPage, className }) => {
|
|
20
|
+
const PaginationForGroup = ({ total, size, currentPage, className, onChange }) => {
|
|
21
21
|
const totalPages = Math.ceil(total / size);
|
|
22
22
|
const pathname = usePathname();
|
|
23
23
|
const searchParams = useSearchParams();
|
|
@@ -41,7 +41,11 @@ const PaginationForGroup = ({ total, size, currentPage, className }) => {
|
|
|
41
41
|
}} alwaysBg/>
|
|
42
42
|
|
|
43
43
|
{/* 그룹 내 페이지 버튼 */}
|
|
44
|
-
{pages.map(page => (<PageBtn
|
|
44
|
+
{pages.map(page => (<PageBtn onClick={() => {
|
|
45
|
+
if (onChange) {
|
|
46
|
+
onChange(page);
|
|
47
|
+
}
|
|
48
|
+
}} index={<div className={'flex aspect-square h-[30px] items-center justify-center'}>{page}</div>} key={`${pathname}_${page}`} href={{
|
|
45
49
|
pathname,
|
|
46
50
|
query: Object.assign({ page }, query)
|
|
47
51
|
}} active={page === currentPage}>
|
|
@@ -17,9 +17,10 @@ interface PaginationProps {
|
|
|
17
17
|
currentPage: number;
|
|
18
18
|
className?: string;
|
|
19
19
|
query?: string;
|
|
20
|
+
onChange?: (pageNum: number) => void;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
const PaginationForGroup = ({ total, size, currentPage, className }: PaginationProps) => {
|
|
23
|
+
const PaginationForGroup = ({ total, size, currentPage, className, onChange }: PaginationProps) => {
|
|
23
24
|
const totalPages = Math.ceil(total / size);
|
|
24
25
|
const pathname = usePathname();
|
|
25
26
|
const searchParams = useSearchParams();
|
|
@@ -69,6 +70,11 @@ const PaginationForGroup = ({ total, size, currentPage, className }: PaginationP
|
|
|
69
70
|
{/* 그룹 내 페이지 버튼 */}
|
|
70
71
|
{pages.map(page => (
|
|
71
72
|
<PageBtn
|
|
73
|
+
onClick={() => {
|
|
74
|
+
if (onChange) {
|
|
75
|
+
onChange(page);
|
|
76
|
+
}
|
|
77
|
+
}}
|
|
72
78
|
index={
|
|
73
79
|
<div className={'flex aspect-square h-[30px] items-center justify-center'}>{page}</div>
|
|
74
80
|
}
|
|
@@ -32,6 +32,9 @@ const Index = (props) => {
|
|
|
32
32
|
setSearch(s);
|
|
33
33
|
setSearchInput(s);
|
|
34
34
|
}, [searchParams]);
|
|
35
|
+
const onPaginationChange = (pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
removeScrollPosCheck(`/success?page=${pageNum}${search ? `&search=${encodeURIComponent(search)}` : ''}`);
|
|
37
|
+
});
|
|
35
38
|
const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
39
|
const query = new URLSearchParams();
|
|
37
40
|
query.set('page', '1');
|
|
@@ -53,7 +56,7 @@ const Index = (props) => {
|
|
|
53
56
|
<p className={'w-fit'}>검색 결과가 없습니다.</p>
|
|
54
57
|
</div>)}
|
|
55
58
|
|
|
56
|
-
<PaginationForGroup total={totalCount} currentPage={Number(currentPage)} size={12}/>
|
|
59
|
+
<PaginationForGroup total={totalCount} currentPage={Number(currentPage)} size={12} className={'my-[100px]'} onChange={onPaginationChange}/>
|
|
57
60
|
</PageWrapper>
|
|
58
61
|
</>);
|
|
59
62
|
};
|
|
@@ -27,6 +27,10 @@ const Index = (props: { list: ISuccessListTypes[]; totalCount: number; currentPa
|
|
|
27
27
|
setSearchInput(s);
|
|
28
28
|
}, [searchParams]);
|
|
29
29
|
|
|
30
|
+
const onPaginationChange = async (pageNum: number) => {
|
|
31
|
+
removeScrollPosCheck(`/success?page=${pageNum}${search ? `&search=${encodeURIComponent(search)}` : ''}`);
|
|
32
|
+
};
|
|
33
|
+
|
|
30
34
|
const handleClick = async () => {
|
|
31
35
|
const query = new URLSearchParams();
|
|
32
36
|
query.set('page', '1');
|
|
@@ -69,7 +73,13 @@ const Index = (props: { list: ISuccessListTypes[]; totalCount: number; currentPa
|
|
|
69
73
|
</div>
|
|
70
74
|
)}
|
|
71
75
|
|
|
72
|
-
<PaginationForGroup
|
|
76
|
+
<PaginationForGroup
|
|
77
|
+
total={totalCount}
|
|
78
|
+
currentPage={Number(currentPage)}
|
|
79
|
+
size={12}
|
|
80
|
+
className={'my-[100px]'}
|
|
81
|
+
onChange={onPaginationChange}
|
|
82
|
+
/>
|
|
73
83
|
</PageWrapper>
|
|
74
84
|
</>
|
|
75
85
|
);
|