Skip to content

Commit

Permalink
test: demo 영상을 위한 코드 정리 및 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
saa00123 committed Sep 8, 2023
1 parent 3fd8c53 commit 2c1f963
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 52 deletions.
11 changes: 8 additions & 3 deletions front/src/components/main/ProjectContribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ import {
PolarAngleAxis,
ResponsiveContainer,
} from "recharts";
import { useUser } from "../frames/token/UserContext";
import refresh from "../../images/refresh.png";
import mainData from "../graph/GraphData/mainData";
import subData1 from "../graph/GraphData/subData1";

function ProjectContribution() {
const [user] = useUser();
const currentNickname = user ? user.nickname : "권순호";

const activeData = currentNickname === "권순호" ? mainData : subData1;

return (
<div className='flex flex-col bg-white w-[500px] h-[400px] border'>
<div className='flex justify-between items-center p-5 h-[50px] bg-[#6A6A6A]'>
Expand All @@ -22,11 +29,9 @@ function ProjectContribution() {
/>
</div>
<div className='flex m-auto w-[500px] h-[500px]'>
{/* 부모 요소의 크기 조정 */}
<div className='m-auto w-[500px] h-[300px]'>
{/* RadarChart 영역 */}
<ResponsiveContainer width='100%' height='100%'>
<RadarChart cx='50%' cy='50%' outerRadius='80%' data={mainData}>
<RadarChart cx='50%' cy='50%' outerRadius='80%' data={activeData}>
<PolarGrid />
<PolarAngleAxis dataKey='subject' />
<Radar
Expand Down
30 changes: 15 additions & 15 deletions front/src/pages/agora/Agora.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { NavLink } from 'react-router-dom';
import moveImg from '../../images/login.png';
import Menu from '../../components/frames/Side/Sidebar';
import AgoraPopup from '../../components/frames/Agora/AgoraPopup';
import profileImg from '../../images/members.png';
import React, { useState, useEffect } from "react";
import axios from "axios";
import { NavLink } from "react-router-dom";
import moveImg from "../../images/login.png";
import Menu from "../../components/frames/Side/Sidebar";
import AgoraPopup from "../../components/frames/Agora/AgoraPopup";
import profileImg from "../../images/members.png";

interface Writer {
id: number;
Expand All @@ -27,7 +27,7 @@ function Agora() {
useEffect(() => {
async function fetchData(): Promise<void> {
try {
const response = await axios.get<AgoraData[]>('questions?writer-id=2');
const response = await axios.get<AgoraData[]>("questions?writer-id=2");
setAgoraData(response.data);
console.log(response.data, response.status);
} catch (error) {
Expand All @@ -38,7 +38,7 @@ function Agora() {
}, []);

const activeStyle = {
background: '#D8F1FF',
background: "#D8F1FF",
};

return (
Expand All @@ -50,9 +50,9 @@ function Agora() {
<AgoraPopup />
</div>
<div className='border mt-8'>
{' '}
{" "}
<ul className='p-5 space-y-3 mb-[50px] w-[950px] h-[650px] overflow-auto'>
<li className='flex justify-start pl-4 items-center m-auto w-[850px] h-[50px] bg-white border'>
{/* <li className='flex justify-start pl-4 items-center m-auto w-[850px] h-[50px] bg-white border'>
<div className='flex justify-between w-[500px]'>
<p>테스트 질문</p>
<p className='flex'>
Expand All @@ -61,7 +61,7 @@ function Agora() {
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</p>
<p>2023.05.20</p>
<p>개발</p>
Expand All @@ -77,17 +77,17 @@ function Agora() {
src={moveImg}
/>
</NavLink>
</li>
</li> */}
<li className='flex justify-start pl-4 items-center m-auto w-[850px] h-[50px] bg-white border'>
<div className='flex justify-between w-[500px]'>
<p>테스크 post 질문</p>
<p>post 질문</p>
<p className='flex'>
<img
className='w-[24px] h-[24px] mr-2'
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</p>
<p>2023.05.26</p>
<p>개발</p>
Expand Down
26 changes: 13 additions & 13 deletions front/src/pages/agora/Question.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { NavLink } from 'react-router-dom';
import profileImg from '../../images/members.png';
import backImg from '../../images/rightarrow.png';
import Menu from '../../components/frames/Side/Sidebar';
import React, { useState, useEffect } from "react";
import axios from "axios";
import { NavLink } from "react-router-dom";
import profileImg from "../../images/members.png";
import backImg from "../../images/rightarrow.png";
import Menu from "../../components/frames/Side/Sidebar";

interface Answer {
content: string;
Expand All @@ -25,7 +25,7 @@ interface Comment {

function Question() {
const [data, setData] = useState<Answer>({
content: '',
content: "",
answerId: 1,
});

Expand All @@ -42,9 +42,9 @@ function Question() {
const answerData = {
content: data.content,
};
axios.post('answer-comments', answerData).then((response) => {
axios.post("answer-comments", answerData).then((response) => {
console.log(response.status, response.data);
window.location.replace('/Question');
window.location.replace("/Question");
});
};

Expand All @@ -53,7 +53,7 @@ function Question() {
useEffect(() => {
async function fetchData(): Promise<void> {
try {
const response = await axios.get<Comment[]>('answer-comment/1');
const response = await axios.get<Comment[]>("answer-comment/1");
setCommentData(response.data);
console.log(response.data);
} catch (error) {
Expand All @@ -64,7 +64,7 @@ function Question() {
}, []);

const activeStyle = {
background: '#D8F1FF',
background: "#D8F1FF",
};

return (
Expand All @@ -89,7 +89,7 @@ function Question() {
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</p>
<p>2023.05.20</p>
<p>개발</p>
Expand All @@ -104,7 +104,7 @@ function Question() {
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</div>
<p className='flex bg-white p-2 mt-2 w-full h-full overflow-auto rounded-[15px] text-[15px]'>
작성자 추가 질문 테스트입니다.
Expand Down
28 changes: 14 additions & 14 deletions front/src/pages/agora/Question1.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { NavLink } from 'react-router-dom';
import profileImg from '../../images/members.png';
import backImg from '../../images/rightarrow.png';
import Menu from '../../components/frames/Side/Sidebar';
import React, { useState, useEffect } from "react";
import axios from "axios";
import { NavLink } from "react-router-dom";
import profileImg from "../../images/members.png";
import backImg from "../../images/rightarrow.png";
import Menu from "../../components/frames/Side/Sidebar";

interface Answer {
content: string;
Expand All @@ -25,7 +25,7 @@ interface Comment {

function Question1() {
const [data, setData] = useState<Answer>({
content: '',
content: "",
answerId: 1,
});

Expand All @@ -42,9 +42,9 @@ function Question1() {
const answerData = {
content: data.content,
};
axios.post('answer-comments', answerData).then((response) => {
axios.post("answer-comments", answerData).then((response) => {
console.log(response.status, response.data);
window.location.replace('/Question');
window.location.replace("/Question");
});
};

Expand All @@ -53,7 +53,7 @@ function Question1() {
useEffect(() => {
async function fetchData(): Promise<void> {
try {
const response = await axios.get<Comment[]>('answer-comment/1');
const response = await axios.get<Comment[]>("answer-comment/1");
setCommentData(response.data);
console.log(response.data);
} catch (error) {
Expand All @@ -64,7 +64,7 @@ function Question1() {
}, []);

const activeStyle = {
background: '#D8F1FF',
background: "#D8F1FF",
};

return (
Expand All @@ -82,14 +82,14 @@ function Question1() {
</div>
<div className='flex flex-col border mt-8 w-[950px] h-full m-5 overflow-y-auto'>
<div className='flex justify-evenly h-[200px] border items-center'>
<p>테스크 post 질문</p>
<p>post 질문</p>
<p className='flex'>
<img
className='w-[24px] h-[24px] mr-2'
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</p>
<p>2023.05.26</p>
<p>개발</p>
Expand All @@ -109,7 +109,7 @@ function Question1() {
alt='agoraIcon'
src={profileImg}
/>
sample
최정훈
</div>
<p className='flex bg-white p-2 mt-2 w-full h-full rounded-[15px] text-[15px]'>
summary: string; description: string; contributePoint: string;
Expand Down
12 changes: 6 additions & 6 deletions front/src/pages/main/DashBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import Menu from '../../components/frames/Side/Sidebar';
import Calendar from '../../components/main/DailyCalendar';
import CheckListBox from '../../components/main/CheckListBox';
import Progress from '../../components/main/ProjectProgress';
import Contribution from '../../components/main/ProjectContribution';
import React from "react";
import Menu from "../../components/frames/Side/Sidebar";
import Calendar from "../../components/main/DailyCalendar";
import CheckListBox from "../../components/main/CheckListBox";
import Progress from "../../components/main/ProjectProgress";
import Contribution from "../../components/main/ProjectContribution";

function MainPage() {
return (
Expand Down
2 changes: 1 addition & 1 deletion front/src/pages/sprint/Sprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Sprint() {
useEffect(() => {
async function fetchData(): Promise<void> {
try {
const response = await axios.get<SprintData[]>("sprints?project-id=5");
const response = await axios.get<SprintData[]>("sprints?project-id=2");
setSprintData(response.data);
console.log(response.data, response.status);
} catch (error) {
Expand Down

0 comments on commit 2c1f963

Please sign in to comment.