-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from TABA-4th/dev
merge dev branch
- Loading branch information
Showing
9 changed files
with
304 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React, { useState } from 'react'; | ||
import FullCalendar from '@fullcalendar/react'; | ||
import dayGridPlugin from '@fullcalendar/daygrid'; | ||
|
||
/* | ||
Calendar 컴포넌트에서 매개변수로 받아야 하는 props :: diagnoseData | ||
*/ | ||
|
||
const Calendar = (props) => { | ||
const { diagnoseData } = props; // props로부터 diagnoseData를 추출 | ||
|
||
const [defaultView, setDefaultView] = useState('dayGridMonth'); | ||
|
||
const handleDateClick = (info) => { | ||
if (info.event.extendedProps && info.event.extendedProps.diagnoseResult) { | ||
alert(`검사 결과 : ${info.event.extendedProps.diagnoseResult}`); | ||
// 여기서 새로운 팝업을 띄우거나, 새로운 페이지로 넘어가는 작업 등 추가 가능. | ||
} | ||
}; | ||
|
||
const events = diagnoseData.map(data => ({ | ||
title: '두피 자가진단 검사결과', | ||
date: data.diagnoseDate, | ||
extendedProps: { | ||
diagnoseResult: data.diagnoseResult | ||
}, | ||
})); | ||
|
||
return ( | ||
<div> | ||
<FullCalendar | ||
defaultView={defaultView} | ||
plugins={[dayGridPlugin]} | ||
eventClick={handleDateClick} | ||
events={events} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Calendar; | ||
|
||
/* | ||
꼭 참고해서 사용하자 !!!! FullCalendar의 events 프롭 안에 선언할 수 있는 prop 목록 | ||
title (필수): 이벤트의 제목을 나타내는 문자열. | ||
date (필수): 이벤트가 발생하는 날짜를 나타내는 문자열 또는 Date 객체. | ||
start (선택적): 이벤트의 시작 날짜 및 시간을 나타내는 Date 객체 또는 문자열. | ||
end (선택적): 이벤트의 종료 날짜 및 시간을 나타내는 Date 객체 또는 문자열. | ||
allDay (선택적): 이벤트가 하루 종일인지 여부를 나타내는 불리언 값. | ||
extendedProps (선택적): 사용자 정의 속성을 나타내는 객체. 이 속성을 사용하여 추가적인 정보를 이벤트에 첨부할 수 있습니다. | ||
color (선택적): 이벤트의 배경색을 지정하는 문자열. | ||
editable (선택적): 이벤트가 사용자에 의해 편집 가능한지 여부를 나타내는 불리언 값. | ||
display (선택적): 이벤트를 표시하는 방법을 나타내는 문자열. | ||
classNames (선택적): 이벤트에 적용할 CSS 클래스를 나타내는 문자열 또는 문자열 배열. | ||
*/ |
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,41 @@ | ||
/* Signup.css */ | ||
|
||
form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-between; /* 양쪽 정렬 추가 */ | ||
width: 450px; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
|
||
label { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
margin-bottom: 10px; | ||
width: 100%; /* 부모인 form에 따라가도록 width 100% 설정 */ | ||
} | ||
|
||
label > span { | ||
width: 30%; | ||
margin-right: 10px; | ||
justify-content: space-between; | ||
} | ||
|
||
input { | ||
width: 70%; | ||
padding: 8px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
button { | ||
width: 40%; | ||
padding: 10px; | ||
background-color: #007bff; | ||
color: #fff; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
|
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
Oops, something went wrong.