From ac3fba54b2fe9e0221a8fc30148563b973785988 Mon Sep 17 00:00:00 2001 From: KangYeonbae <153577573+KangYeonbae@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:48:12 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 22 +++---- .../type/ItemType.js | 0 src/pages/category.js | 2 +- src/pages/registrationModal.js | 2 +- src/route/calender.js | 64 ------------------- src/route/farmList_public.js | 57 ----------------- 6 files changed, 13 insertions(+), 134 deletions(-) rename src/{components => constants}/type/ItemType.js (100%) delete mode 100644 src/route/calender.js delete mode 100644 src/route/farmList_public.js diff --git a/src/App.js b/src/App.js index abda8bb..cba1912 100644 --- a/src/App.js +++ b/src/App.js @@ -4,17 +4,17 @@ import React, { useState } from 'react'; import { BrowserRouter as Router, Routes, Route, Link, NavLink } from 'react-router-dom'; import { Container, Nav, Navbar, NavDropdown } from 'react-bootstrap'; import 'bootstrap/dist/css/bootstrap.min.css'; -import LoginModal from './route/login'; -import RenterMypage from './route/renter-mypage'; -import CategorySection from './route/category'; -import MyMapPage from './route/mapPage'; -import ImageCarousel from './route/mainpage' -import Booking from './route/booking'; -import IntroPage from './route/intropage'; -import OwnerMypage from './route/owner-mypag'; -import SpaceList from './route/spaceList'; -import SpaceDetail from './route/spaceDetail'; -import ItemType from './type/ItemType'; +import LoginModal from './pages/login'; +import RenterMypage from './pages/renter-mypage'; +import CategorySection from './pages/category'; +import MyMapPage from './pages/mapPage'; +import ImageCarousel from './pages/mainpage' +import Booking from './pages/booking'; +import IntroPage from './pages/intropage'; +import OwnerMypage from './pages/owner-mypag'; +import SpaceList from './pages/spaceList'; +import SpaceDetail from './pages/spaceDetail'; +import ItemType from './constants/type/ItemType'; diff --git a/src/components/type/ItemType.js b/src/constants/type/ItemType.js similarity index 100% rename from src/components/type/ItemType.js rename to src/constants/type/ItemType.js diff --git a/src/pages/category.js b/src/pages/category.js index 69e508f..f810ed5 100644 --- a/src/pages/category.js +++ b/src/pages/category.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import '../styles/category.css' -import ItemType from '../components/type/ItemType'; +import ItemType from '../constants/type/ItemType'; const categoryItems = { diff --git a/src/pages/registrationModal.js b/src/pages/registrationModal.js index eb33707..e27704e 100644 --- a/src/pages/registrationModal.js +++ b/src/pages/registrationModal.js @@ -1,7 +1,7 @@ import { useState } from 'react'; import { X } from 'lucide-react'; import '../styles/registration.css' -import ItemType from "../components/type/ItemType" +import ItemType from "../constants/type/ItemType" export default function RegistrationModal({ isOpen, onClose }) { const [formData, setFormData] = useState({ diff --git a/src/route/calender.js b/src/route/calender.js deleted file mode 100644 index 853d874..0000000 --- a/src/route/calender.js +++ /dev/null @@ -1,64 +0,0 @@ -import React, { useState } from 'react'; -import Calendar from 'react-calendar'; -import moment from 'moment'; -import 'react-calendar/dist/Calendar.css'; -import '../css/mycalender.css' - -export default function MyCalendar() { - const today = new Date(); - const [date, setDate] = useState(today); - const [activeStartDate, setActiveStartDate] = useState(new Date()); - - // 예시 출석일 - const attendDays = ["2024-11-03", "2024-11-13"]; - - const handleDateChange = (newDate) => { - setDate(newDate); - }; - - const handleTodayClick = () => { - const today = new Date(); - setActiveStartDate(today); - setDate(today); - }; - - return ( -
- moment(date).format("D")} - formatYear={(locale, date) => moment(date).format("YYYY")} - formatMonthYear={(locale, date) => moment(date).format("YYYY. MM")} - calendarType="gregory" - showNeighboringMonth={false} - next2Label={null} - prev2Label={null} - minDetail="year" - activeStartDate={activeStartDate} - onActiveStartDateChange={({ activeStartDate }) => - setActiveStartDate(activeStartDate) - } - tileContent={({ date, view }) => { - const html = []; - - if ( - view === "month" && - date.getMonth() === today.getMonth() && - date.getDate() === today.getDate() - ) { - html.push(
오늘
); - } - - if (attendDays.includes(moment(date).format("YYYY-MM-DD"))) { - html.push(
); - } - - return html; - }} - /> - -
- ); -}; diff --git a/src/route/farmList_public.js b/src/route/farmList_public.js deleted file mode 100644 index 6321c91..0000000 --- a/src/route/farmList_public.js +++ /dev/null @@ -1,57 +0,0 @@ -import {useState} from 'react'; -import { useNavigate } from 'react-router-dom'; -import { Pagination } from 'react-bootstrap'; - - -export default function FarmListPubilc(){ - const navigate = useNavigate(); - - const pubilcData = [ - {id:1, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:2, title:'금천구텃밭', plant:'상추, 딸기'}, - {id:3, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:4, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:5, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:6, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:7, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:7, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:9, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:10, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:11, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:12, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - {id:13, title:'서울텃밭', plant:'토마토, 깻잎, 상추'}, - ] - - - const handleClick = (id) => { - navigate('/') - }; - - const [currentPage, setCurrentPage] = useState(1); - const itemsPerPage = 10; - - const indexOfLastItem = currentPage * itemsPerPage; - const indexOfFirstItem = indexOfLastItem - itemsPerPage; - const currentItems = pubilcData.slice(indexOfFirstItem, indexOfLastItem); - - const totalPages = Math.ceil(pubilcData.length / itemsPerPage); - - const pageNumbers = []; - for (let i =1; i<=totalPages; i++){ - pageNumbers.push(i); - } - - - return( - <> -
-
- -
-
- - - ) - - -} \ No newline at end of file