-
Notifications
You must be signed in to change notification settings - Fork 0
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 #14 from HappyScrolls/feature/#11_dayCalendar
Feature/#11 day calendar
- Loading branch information
Showing
22 changed files
with
1,765 additions
and
33 deletions.
There are no files selected for viewing
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,5 @@ | ||
export interface ApiResponse<T = any> { | ||
data: T; | ||
message: string; | ||
statusCode: number; | ||
} |
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,43 @@ | ||
import { ScheduleData } from "../../types/ISchedule"; | ||
import { ApiResponse } from "../ApiResponse"; | ||
import { scheduleAxiosInstance } from "../axios"; | ||
|
||
// 일정 생성 | ||
export const createSchedule = async ( | ||
scheduleData: ScheduleData | ||
): Promise<ApiResponse> => { | ||
try { | ||
const response = await scheduleAxiosInstance.post<ApiResponse>( | ||
"/schedule", | ||
scheduleData | ||
); | ||
return response.data; | ||
} catch (error) { | ||
console.error("일정 생성 중 오류 발생:", error); | ||
throw error; | ||
} | ||
}; | ||
|
||
// 일정 삭제 | ||
export const deleteSchedule = async (scheduleNo: number) => { | ||
try { | ||
const response = await scheduleAxiosInstance.delete( | ||
`/schedule/${scheduleNo}` | ||
); | ||
return response.data; | ||
} catch (error) { | ||
console.error("일정 삭제 중 오류 발생:", error); | ||
throw error; | ||
} | ||
}; | ||
|
||
// 일정 조회 | ||
export const fetchSchedulesByDate = async (date: string) => { | ||
try { | ||
const response = await scheduleAxiosInstance.get(`/schedule?date=${date}`); | ||
return response.data; | ||
} catch (error) { | ||
console.error("일정 조회 중 오류 발생:", error); | ||
throw error; | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,34 @@ | ||
import React, { useState } from "react"; | ||
import { Container } from "../../components/layout/Layout"; | ||
import ViewChangeHeader from "./components/ViewChangeHeader"; | ||
import { useParams } from "react-router-dom"; | ||
import ListView from "./components/ListView"; | ||
import TimeTable from "./components/TimeTableView"; | ||
import { styled } from "styled-components"; | ||
|
||
const CalendarPage = () => { | ||
const { date } = useParams<{ date: string }>(); | ||
console.log(date); | ||
|
||
const [isTimetableView, setIsTimetableView] = useState(true); | ||
|
||
const toggleView = () => { | ||
setIsTimetableView(!isTimetableView); | ||
}; | ||
|
||
return ( | ||
<> | ||
<CalendarContainer> | ||
<ViewChangeHeader | ||
isTimetableView={isTimetableView} | ||
toggleView={toggleView} | ||
/> | ||
{isTimetableView ? <TimeTable /> : <ListView />} | ||
</CalendarContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default CalendarPage; | ||
|
||
const CalendarContainer = styled(Container)``; |
Oops, something went wrong.