loading...
;
+ if(!leader) return null;
+
return (
@@ -46,9 +94,9 @@ const PenaltyCard = (props) => {
{penalty.total_penalty}원
{
- (localStorage.getItem('user')===penalty.user_id)?
+ (localStorage.getItem('user')===leader)?
<>
-
+
>
:
<>
diff --git a/src/components/manage/TimeRecord.js b/src/components/manage/TimeRecord.js
index 496e706..20fe2d9 100644
--- a/src/components/manage/TimeRecord.js
+++ b/src/components/manage/TimeRecord.js
@@ -4,9 +4,17 @@ import { FaChevronLeft } from "react-icons/fa";
import { FaChevronRight } from "react-icons/fa";
import TimeRecordCard from './TimeRecordCard';
import '../../css/TimeRecord.css';
+import styled from 'styled-components';
+
+const Container = styled.div`
+ padding: 20px;
+`;
const TimeRecord = (props) => {
+ axios.defaults.withCredentials = true;
+ console.log('time_reocord');
+ var monthChange = false; //월 바뀌는 주간 flag
const studyId = props.studyID;
//리팩토링 필요, Attendance에서 중복 사용, weekTab 컴포넌트로 분리
@@ -24,12 +32,13 @@ const TimeRecord = (props) => {
var compare2 = [month,date]
var num = dayLabel;
var dateNum = date;
-
+ if(monthChange == true){ monthChange=false;}
for(var i = 0; i < 7; i++,num--,dateNum--){
if(dateNum == 0 ){
+ monthChange = true;
if((month-1)%2 == 0){
- if((month-1)==2) dateNum = 28;
- else dateNum = ((month-1)==8) ? 31 : 30;
+ if((month-1)==2){dateNum = 28;}
+ else{dateNum = ((month-1)==8) ? 31 : 30;}
//윤년 2월 예외처리 추가
}else{
dateNum = 31;
@@ -99,7 +108,7 @@ const changeAfter = () => {
const clickDate = async (e, index) => {
var clickdate = new Date(new Date().setDate(today.getDate()-6+index));
- var URL = '/api/studies/time/'+studyId;
+ var URL = 'https://nudo-study.cf/api/studies/time/'+studyId;
try{
const response = await axios.post(URL,{date:clickdate});
@@ -140,6 +149,13 @@ const changeAfter = () => {
paddingTop: '1.5%' //세로 위치
}
+ const weekTabMonthStyle2 = {
+ width: '10%',
+ textAlign: 'left',
+ paddingTop: '2%', //세로 위치
+ fontSize: 'small'
+ }
+
//시작일 포함된 주간이면 숨김 처리
const weekTabLeftButtonStyle = {
visibility: isInclude ? 'hidden' : 'visible',
@@ -160,7 +176,12 @@ const changeAfter = () => {
-
{month}월
+ {
+ (monthChange)?
+
{month-1}/{month}월
+ :
+
{month}월
+ }
changeBefore()}/>
{weekInfo&&weekInfo.map((day, index) => {
if(!isInclude || day.date >= startdate ){
@@ -177,7 +198,7 @@ const changeAfter = () => {
{/* 발표용-지우기 */}
- 시간
+ {/* 시간
@@ -186,18 +207,19 @@ const changeAfter = () => {
3
- 3.5
+ 3.5 */}
{/* 발표용-지우기 */}
-
+
{
time&&time.map(function(time,i){
return(
- <>
+
- >
+
)
})
}
+
);
};
diff --git a/src/components/manage/WriteComment.js b/src/components/manage/WriteComment.js
index d0c06c7..6a3ffb5 100644
--- a/src/components/manage/WriteComment.js
+++ b/src/components/manage/WriteComment.js
@@ -3,13 +3,14 @@ import React, { useState } from 'react';
import {Form,Button} from 'react-bootstrap';
const WriteComment = () => {
+ axios.defaults.withCredentials = true;
const studyID = window.location.href.split("/").reverse()[2];
const postID = window.location.href.split("/").reverse()[1];
console.log(studyID,'|',postID);
//게시글 댓글 작성 /api/studeis/{:studyId}/board/{:idx}/comment [POST]
// const URL = '/api/studies/board/comment/write/'+studyID+'/'+postID;
- const URL = '/api/studies/'+studyID+'/board/'+postID+'/comment';
+ const URL = 'https://nudo-study.cf/api/studies/'+studyID+'/board/'+postID+'/comment';
const [comment, setComment] = useState("");
const handleSubmit = async (e) => {
@@ -41,7 +42,7 @@ const WriteComment = () => {
onChange = {(e)=>setComment(e.target.value)} />
-