Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: 시연용 데이터 추가 및 기능 보완 #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<title>PEER:RE</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<!-- noto sans kr font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:[email protected]&display=swap" rel="stylesheet">
<title>PEER:RE</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
1 change: 0 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import ResultReport from "/src/pages/result-report/ResultReport";
import PersonalReport from "./pages/personal-report/PersonalReport";
import CreateTeam from "./pages/create-team/CreateTeam";
import CreateProject from "./pages/create-team/CreateProject";

import Feedback from "./pages/feedback/Feedback";
import FeedbackUsers from "./pages/feedback-users/FeedbackUsers";
import Home from "./pages/home/Home";
Expand Down
7 changes: 5 additions & 2 deletions src/components/feedback-users/FeedbackBlock.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useState} from "react";
import { useNavigate } from "react-router-dom";
import {
ReportBox2,
ContentLine,
Expand All @@ -18,7 +19,7 @@ import FeedbacksStore from "/src/stores/feedback/FeedbackStore";
import axios from "axios";

export default function FeedbackBlock({ yesData, noData, selectedUser }){

const navigate = useNavigate();
const selectedPRId = ProjectIdStore((state) => state.selectedPRId); // 프로젝트 id

// 선택 데이터 저장
Expand All @@ -37,6 +38,7 @@ export default function FeedbackBlock({ yesData, noData, selectedUser }){
'thorough': data[4],
'engaging': data[5],
};


console.log(newData);

Expand Down Expand Up @@ -101,7 +103,8 @@ export default function FeedbackBlock({ yesData, noData, selectedUser }){
</FeedbackData>
</FeedBackType2>
</div>
<SaveFeedbackBtn onClick={() => SendUserFeedback()}>완료</SaveFeedbackBtn>
{/* <SaveFeedbackBtn onClick={() => SendUserFeedback()}>완료</SaveFeedbackBtn> */}
<SaveFeedbackBtn onClick={() => navigate("/feedback")}>완료</SaveFeedbackBtn>
</ReportBox2>
);
}
14 changes: 8 additions & 6 deletions src/components/feedback/FeedbackPerson.jsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
import React from "react";
import PropTypes from 'prop-types';
import { useNavigate } from "react-router-dom";
import PropTypes from "prop-types";
import {
Person,
Member,
TeamProfImg,
TeamPerson,
MemberName,
MemberTeam,
How,
FeedbackContentBox,
FeedbackContent,
} from "/src/styles/style";

const FeedbackPerson = ({ name, image_url, no_feedbacks, yes_feedbacks }) => {

const navigate = useNavigate();
return (
<Person>
<Member>
<TeamProfImg src={image_url} />
<TeamProfImg src={image_url} onClick={() => navigate("/feedback/users")}/>
<TeamPerson>
<MemberName>{name}</MemberName>
<MemberName onClick={() => navigate("/feedback/users")}>{name}</MemberName>
</TeamPerson>
</Member>
<How>
<FeedbackContentBox>
<FeedbackContent>
{yes_feedbacks.map((feedback, index) => (
{yes_feedbacks.map((feedback, index) => (
<p key={index}>• {feedback}</p>
))}
</FeedbackContent>
<FeedbackContent>
{no_feedbacks.map((feedback, index) => (
{no_feedbacks.map((feedback, index) => (
<p key={index}>• {feedback}</p>
))}
</FeedbackContent>
Expand Down
6 changes: 4 additions & 2 deletions src/components/result-report/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export default function Input() {
const accessToken = localStorage.getItem('accessToken');

const [content, setContent] = useState("");
const [userNameInfo, setuserNameInfo] = useState("");
const [userProfileImg, setuserProfileImg] = useState("");
// const [userNameInfo, setuserNameInfo] = useState(""); // 원 데이터
// const [userProfileImg, setuserProfileImg] = useState(""); // 원 데이터
const [userNameInfo, setuserNameInfo] = useState("홍길동"); // 임시 더미 데이터 (api 연결 성공시 삭제)
const [userProfileImg, setuserProfileImg] = useState("/src/assets/images/result-report/미모티콘1.png"); // 임시 더미 데이터 (api 연결 성공시 삭제)

const selectedPRId = ProjectIdStore((state) => state.selectedPRId); // 프로젝트 id
const [isSend, setIsSend] = useState(false); // 보냈는지 확인하는 상태관리
Expand Down
20 changes: 15 additions & 5 deletions src/components/result-report/Review.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ import {
ProfileText,
ProfileName,
} from "/src/styles/style";
import {
nickname,
profileImgUrl,
content,
} from "../../data/result-report/review_dummy"; // 임시 더미 데이터 (api 연결 성공시 삭제)
import React, { useState, useEffect } from "react";
import axios from "axios";

import ProjectIdStore from "/src/stores/projectId/ProjectIdStore";

export default function Review() {
const [nicknames, setnicknames] = useState([]);
const [profileImgUrls, setprofileImgUrls] = useState([]);
const [contents, setcontents] = useState([]);
// 원 데이터
// const [nicknames, setnicknames] = useState([]);
// const [profileImgUrls, setprofileImgUrls] = useState([]);
// const [contents, setcontents] = useState([]);
const [nicknames, setnicknames] = useState(nickname); // 임시 더미 데이터 (api 연결 성공시 삭제)
const [profileImgUrls, setprofileImgUrls] = useState(profileImgUrl); // 임시 더미 데이터 (api 연결 성공시 삭제)
const [contents, setcontents] = useState(content); // 임시 더미 데이터 (api 연결 성공시 삭제)

const selectedPRId = ProjectIdStore((state) => state.selectedPRId); // 프로젝트 id

Expand All @@ -28,9 +37,10 @@ export default function Review() {

const sendGetRequest = async () => {
try {

const response = await axios.get(
`${import.meta.env.VITE_APP_SERVER_HOST}/api/project/${selectedPRId}/comments`,
`${
import.meta.env.VITE_APP_SERVER_HOST
}/api/project/${selectedPRId}/comments`,
{
headers: {
"Content-Type": "application/json",
Expand Down
19 changes: 16 additions & 3 deletions src/components/result-report/Summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
Team_Table,
VerticalLine,
} from "/src/styles/style";
import { summary_dummy, summary_feedback_dummy } from "../../data/result-report/summary_dummy";
import { useState, useEffect } from "react";
import axios from "axios";
import styled from "styled-components";
import PropTypes from "prop-types";

Summary.propTypes = {
Expand All @@ -35,8 +35,21 @@ export default function Summary({
projectName,
}) {
const [button, setButton] = useState("team");
const [yesFeedbackContents, setYesFeedbackContents] = useState([]);
const [noFeedbackContents, setNoFeedbackContents] = useState([]);

// 임시 더미 데이터 (api 연결 성공시 삭제)
startDay = summary_dummy[0].startDay;
endDay = summary_dummy[0].endDay;
memberNum = summary_dummy[0].memberNum;
teamName = summary_dummy[0].teamName;
totalNoFeedbackCount = summary_dummy[0].totalNoFeedbackCount;
totalParticipateRate = summary_dummy[0].totalParticipateRate;
totalYesFeedbackCount = summary_dummy[0].totalYesFeedbackCount;
projectName = summary_dummy[0].projectName;

// const [yesFeedbackContents, setYesFeedbackContents] = useState([]); // 원 데이터
// const [noFeedbackContents, setNoFeedbackContents] = useState([]); // 원 데이터
const [yesFeedbackContents, setYesFeedbackContents] = useState(summary_feedback_dummy[0].yesFeedbackList); // 임시 더미 데이터 (api 연결 성공시 삭제)
const [noFeedbackContents, setNoFeedbackContents] = useState(summary_feedback_dummy[1].noFeedbackList); // 임시 더미 데이터 (api 연결 성공시 삭제)

const handleButtonClick = (btn) => {
setButton(btn);
Expand Down
9 changes: 5 additions & 4 deletions src/components/sidebar/SideBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ export default function SideBar(location) {
return (
<Body>
<BarHeader>
<BarHeaderImage src={userImage} alt="bar-header-image"/>

{/* <BarHeaderImage src={userImage} alt="bar-header-image"/> */}
<BarHeaderImage src={T_L} alt="bar-header-image"/>
<BarHeaderText>
<p>
{userName}
</p>
{/* <p>{userName}</p> */}
<p>홍길동</p>
</BarHeaderText>
</BarHeader>
<Hr $top="15px"/>
Expand Down
27 changes: 27 additions & 0 deletions src/data/feedback-users/feedbackUsers_dummy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const getRandomImageUrl = () => {
return `https://picsum.photos/80/80?random=${Math.floor(Math.random() * 1000)}`;
};

export const yesData_dummy = [
{ comment: "연락이 잘 돼요." },
{ comment: "시간약속을 잘 지켜요." },
{ comment: "능력이 뛰어나요" },
{ comment: "말을 조리있게 잘 해요." },
{ comment: "빈틈이 없어요" },
{ comment: "친절해요." },
{ comment: "최선을 다해요." },
{ comment: "긍정적인 태도를 지녔어요." },
{ comment: "매너가 있어요." },
];

export const noData_dummy = [
{ comment: "연락이 안 돼요." },
{ comment: "시간약속을 안 지켜요." },
{ comment: "능력이 부족해요." },
{ comment: "말을 조리있게 못해요." },
{ comment: "빈틈이 있어요" },
{ comment: "불친절해요" },
{ comment: "최선을 다하지 않아요." },
{ comment: "부정적인 태로를 지녔어요." },
{ comment: "매너가 없어요." },
];
Loading