Skip to content

Commit

Permalink
[feat/#77] Style: change css
Browse files Browse the repository at this point in the history
  • Loading branch information
= authored and mjms0214 committed Sep 17, 2023
1 parent 706036e commit 80c6445
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
12 changes: 7 additions & 5 deletions src/components/AssignmentPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useState, useCallback, useEffect } from "react";
import { useNavigate, useLocation } from "react-router-dom";
import { useForm } from "react-hook-form";
import "../style/LecturePage.css";
import "../style/AssignmentPage.css";
import Paging from "../components/Paging";
import Assignment from "../props/Assignment";
import AssignmentModal from "../props/AssignmentModal";
Expand Down Expand Up @@ -178,7 +178,7 @@ const AssignmentPage: FC = () => {
</div>
{assignmentPropsList &&
assignmentPropsList.map((assignment) => (
<Assignment assignment={assignment} />
<Assignment key={assignment.assignment_id} assignment={assignment} />
))}
{isProfessor == true && (
<>
Expand All @@ -198,9 +198,11 @@ const AssignmentPage: FC = () => {
</button>
</>
)}
{assignmentPropsList == null && (
<Paging count={assignmentList.length} />
)}
{
assignmentPropsList != null && (
<Paging data={assignmentPropsList.length} perPage={3} />
)
}
</div>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LecturePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const LecturePage: FC = () => {
</div>
{lectureList &&
lectureList.map((lecture) => (
<Lecture lecture={lecture} isProfessor={isProfessor}></Lecture>
<Lecture key={lecture.lecture_id} lecture={lecture} isProfessor={isProfessor}></Lecture>
))}
{
lectureList != null && (
Expand Down
6 changes: 6 additions & 0 deletions src/components/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useForm } from "react-hook-form";
import { useNavigate, useLocation } from "react-router-dom";
import "../style/home.css";
import MyPageLectureList, { LectureType } from "../props/MyPageLectureList";
import Paging from "../components/Paging";
import Modal from "../props/Modal";
import Navbar from "./Navbar";
import api from "../utils/api";
Expand Down Expand Up @@ -359,6 +360,11 @@ const MyPage: FC = () => {
<p className="">진행 중 강의</p>
{/* 강의 리스트 */}
<MyPageLectureList lectureList={lectureList} />
{
lectureList != null && (
<Paging data={lectureList.length} perPage={6} />
)
}
</div>
</div>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/components/Paging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import "../style/Paging.css";

const Paging = (props:any) => {
const [page, setPage] = useState(1);
const count = props.data
let count = 0;
let perPage = 5;
if( props.data != undefined){
count = props.data
}
if(props.perPage != undefined){
perPage = props.perPage
}
console.log(props.data)
console.log(props.perPage)

const handlePageChange = (page: number) => {
setPage(page);
Expand All @@ -14,7 +22,7 @@ const Paging = (props:any) => {
return (
<Pagination
activePage={page}
itemsCountPerPage={5}
itemsCountPerPage={perPage}
totalItemsCount={count}
pageRangeDisplayed={5}
prevPageText={"‹"}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "../style/home.css";
import Navbar from "./Navbar";
import { useLocation } from "react-router-dom";
import { SubmitterPropType } from "../props/SubmitterList";
import Paging from "../components/Paging";
import api from "../utils/api";
import axios from "axios";
const Submit: FC = () => {
Expand Down Expand Up @@ -138,6 +139,11 @@ const Submit: FC = () => {
</button>
</div>
<SubmitterList submittersPropsList={submittersPropsList} />
{
submittersPropsList != null && (
<Paging data={submittersPropsList.length}/>
)
}
</div>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/style/AssignmentPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
background: #f5f5f5;
overflow: auto;
min-height: 800px;
height: 100%;
height: 100vh;
width: 100%;
}

Expand Down
23 changes: 1 addition & 22 deletions src/style/LecturePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,9 @@
background: #f5f5f5;
overflow: auto;
min-height: 800px;
height: 100%;
height: 100vh;
width: 100%;
}

.navbtn {
color: black;
background: #82b0ff;
width: 120px;
height: 55px;
border-radius: 5px;
border: none;
font-family: "Inter";
font-style: normal;
font-weight: 400;
font-size: 20px;
line-height: 29px;
}
.navbar {
height: 87px;
left: 0px;
top: 0px;
width: 100%;
background: #383839;
}

.listheader{
background: #95ABD2;
Expand Down

0 comments on commit 80c6445

Please sign in to comment.