-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
243 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import "./Preview.css"; | ||
|
||
function Pagination({ total, limit, page, setPage }) { | ||
const numPages = Math.ceil(total / limit); | ||
|
||
return ( | ||
<div className="pageContainer"> | ||
<button | ||
className="pageBtn" | ||
id="setPageBtn" | ||
onClick={() => setPage(page - 5)} | ||
disabled={page < 6} | ||
> | ||
<< | ||
</button> | ||
<button | ||
className="pageBtn" | ||
id="setPageBtn" | ||
onClick={() => setPage(page - 1)} | ||
disabled={page === 1} | ||
> | ||
< | ||
</button> | ||
{Array(numPages) | ||
.fill() | ||
.map((_, i) => ( | ||
<button | ||
className="pageBtn" | ||
key={i + 1} | ||
onClick={() => setPage(i + 1)} | ||
aria-current={page === i + 1 ? "page" : null} | ||
> | ||
{i + 1} | ||
</button> | ||
))} | ||
<button | ||
className="pageBtn" | ||
id="setPageBtn" | ||
onClick={() => setPage(page + 1)} | ||
disabled={page === numPages} | ||
> | ||
> | ||
</button> | ||
<button | ||
className="pageBtn" | ||
id="setPageBtn" | ||
onClick={() => setPage(page + 5)} | ||
disabled={page > numPages - 5} | ||
> | ||
>> | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default Pagination; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
import Search from "./Search"; | ||
import MoreInfo from "../Main/MoreInfo"; | ||
import Preview from "../Main/Preview/Preview"; | ||
|
||
function Board(){ | ||
return( | ||
<div> | ||
<Search /> | ||
board | ||
<MoreInfo /> | ||
</div> | ||
) | ||
function Board() { | ||
return ( | ||
<div> | ||
<Search /> | ||
<Preview typeTitle="게시판" type="community" view="detail" /> | ||
<MoreInfo /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Board; | ||
export default Board; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
import Search from "./Search"; | ||
import MoreInfo from "../Main/MoreInfo"; | ||
import Preview from "../Main/Preview/Preview"; | ||
|
||
function Laws(){ | ||
return( | ||
<div> | ||
<Search /> | ||
laws | ||
<MoreInfo /> | ||
</div> | ||
) | ||
function Laws() { | ||
return ( | ||
<div> | ||
<Search /> | ||
<Preview typeTitle="법률" type="laws" view="detail" /> | ||
<MoreInfo /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Laws; | ||
export default Laws; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
import Search from "./Search"; | ||
import MoreInfo from "../Main/MoreInfo"; | ||
import Preview from "../Main/Preview/Preview"; | ||
|
||
function News(){ | ||
return( | ||
<div> | ||
<Search /> | ||
news | ||
<MoreInfo /> | ||
</div> | ||
) | ||
function News() { | ||
return ( | ||
<div> | ||
<Search /> | ||
<Preview typeTitle="새소식" type="news" view="detail" /> | ||
<MoreInfo /> | ||
</div> | ||
); | ||
} | ||
|
||
export default News; | ||
export default News; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters