-
Notifications
You must be signed in to change notification settings - Fork 1
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 #38 from JNU-econovation/feat/21/schedule-inquiry
Feat/21/schedule inquiry
- Loading branch information
Showing
1,843 changed files
with
246 additions
and
300,964 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ yarn-error.log* | |
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
.env | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
|
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.modal { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
background-color: white; | ||
z-index: 100; | ||
width: auto; | ||
height: auto; | ||
border-radius: 4px; | ||
box-shadow: 2px 2px 20px 2px rgba(0, 0, 0, 0.3); | ||
outline: none; | ||
} |
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,136 @@ | ||
import React, { useEffect, useState } from "react"; // useState 추가 | ||
import Modal from "react-modal"; | ||
import "./CheckCalendar.css"; | ||
import styled from "styled-components"; | ||
import { GoPencil } from "react-icons/go"; | ||
import { IoClose } from "react-icons/io5"; | ||
import axios from "axios"; | ||
import { MdOutlineLocationOn } from "react-icons/md"; | ||
import { MdOutlineAutoAwesomeMotion } from "react-icons/md"; | ||
import DeletEvent from "./DeleteEvent"; | ||
|
||
const CheckCalendar = ({ | ||
isOpen, | ||
onRequestClose, | ||
selectID, | ||
events, | ||
setEvents, | ||
}) => { | ||
const [event, setEvent] = useState({}); | ||
const Calendarmodify = () => {}; | ||
|
||
function createDate(title, startDate, endDate, place, info) { | ||
const specificEvent = { | ||
title: title, | ||
startDate: startDate, | ||
endDate: endDate, | ||
place: place, | ||
info: info, | ||
}; | ||
setEvent(specificEvent); | ||
} | ||
useEffect(() => { | ||
const instance = axios.create({ | ||
baseURL: `${import.meta.env.VITE_ERROR_API}`, | ||
}); | ||
instance.get("/api/calendar/" + selectID).then((res) => { | ||
createDate( | ||
res.data.data.eventName, | ||
res.data.data.eventStartDate, | ||
res.data.data.eventEndDate, | ||
res.data.data.eventPlace, | ||
res.data.data.eventInfo | ||
); | ||
}); | ||
}, [selectID]); | ||
|
||
/*function date(startDate, endDate) { | ||
if (startDate.split("T")[0] === endDate.split("T")[0]) return startDate; | ||
else { | ||
return `${startDate} - ${endDate}`; | ||
} | ||
}*/ | ||
|
||
return ( | ||
<Modal | ||
isOpen={isOpen} | ||
onRequestClose={onRequestClose} | ||
className="modal" | ||
overlayClassName="overlay" | ||
> | ||
<ModalBar> | ||
<button onClick={onRequestClose}> | ||
<IoClose size="1.2rem" /> | ||
</button> | ||
<button onClick={Calendarmodify}> | ||
<GoPencil size="1.2rem" /> | ||
</button> | ||
<DeletEvent events={events} setEvents={setEvents} selectID={selectID} /> | ||
</ModalBar> | ||
|
||
<ModalContent> | ||
<Title> | ||
<span></span> | ||
<div>{event.title}</div> | ||
</Title> | ||
{/*<Date> | ||
<p>{date(event.startDate, event.endDate)}</p> | ||
</Date>*/} | ||
<p> | ||
<MdOutlineLocationOn style={{ marginRight: "0.5rem" }} /> | ||
{event.place} | ||
</p> | ||
<p> | ||
<MdOutlineAutoAwesomeMotion style={{ marginRight: "0.5rem" }} /> | ||
{event.info} | ||
</p> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default CheckCalendar; | ||
|
||
const ModalBar = styled.div` | ||
margin-top: 0.5rem; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: row-reverse; | ||
outline: none; | ||
button { | ||
width: 3rem; | ||
background-color: #fff; | ||
border: none; | ||
svg { | ||
size: 5rem; | ||
} | ||
} | ||
`; | ||
|
||
const ModalContent = styled.div` | ||
padding: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
span { | ||
width: 1rem; | ||
height: 1rem; | ||
background-color: #beb9ff; | ||
margin-right: 0.5rem; | ||
} | ||
div { | ||
font-weight: bold; | ||
} | ||
p { | ||
margin-top: 0.6rem; | ||
margin-right: 0.6rem; | ||
} | ||
`; | ||
|
||
const Title = styled.div` | ||
display: flex; | ||
`; | ||
|
||
/*const Date = styled.div` | ||
margin-left: 1.55rem; | ||
`;*/ |
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,28 @@ | ||
import { RiDeleteBinLine } from "react-icons/ri"; | ||
import axios from "axios"; | ||
|
||
const DeletEvent = ({ events, setEvents, selectID }) => { | ||
const calendarDelete = () => { | ||
const instance = axios.create({ | ||
baseURL: `${import.meta.env.VITE_ERROR_API}`, | ||
}); | ||
instance | ||
.delete("/api/calendar/" + selectID) | ||
.then(() => { | ||
const updatedEvents = events.filter((event) => event.id !== selectID); | ||
setEvents(updatedEvents); | ||
window.location.reload(); | ||
}) | ||
.catch((error) => { | ||
console.error("Error deleting event:", error); | ||
}); | ||
}; | ||
|
||
return ( | ||
<button onClick={calendarDelete}> | ||
<RiDeleteBinLine size="1.2rem" /> | ||
</button> | ||
); | ||
}; | ||
|
||
export default DeletEvent; |
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
Binary file not shown.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
}) | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.