diff --git a/.env b/.env new file mode 100644 index 0000000..9a499cb --- /dev/null +++ b/.env @@ -0,0 +1 @@ +REACT_APP_API_HOST = https://dev.eatssu.shop/admin \ No newline at end of file diff --git a/src/components/Manage/Manage.js b/src/components/Manage/Manage.js index 840b7cd..1e89cd7 100644 --- a/src/components/Manage/Manage.js +++ b/src/components/Manage/Manage.js @@ -1,36 +1,38 @@ -import React, { useState } from 'react'; -import NavBar from '../NavBar/NavBar'; -import Inquiry from '../Inquiry/Inquiry'; -import Report from '../Report/Report'; -import Menu from '../Menu/Menu'; +import React, { useState } from "react"; +import NavBar from "../NavBar/NavBar"; +import Inquiry from "../Inquiry/Inquiry"; +import Report from "../Report/Report"; +import Menu from "../Menu/Menu"; +import WeeklyMenu from "components/Menu/WeeklyMenu"; function Manage() { - const [selectedComponent, setSelectedComponent] = useState('menu'); + const [selectedComponent, setSelectedComponent] = useState("menu"); - const renderSelectedComponent = () => { - switch (selectedComponent) { - case 'menu': - return ; - case 'report': - return ; - case 'inquiry': - return ; - default: - return ; - } - }; + const renderSelectedComponent = () => { + switch (selectedComponent) { + case "menu": + return ; + case "weeklyMenu": + return ; + case "report": + return ; + case "inquiry": + return ; + default: + return ; + } + }; - return ( -
- - {/* 선택된 컴포넌트 렌더링 */} - {renderSelectedComponent()} -
- ); + return ( +
+ + {/* 선택된 컴포넌트 렌더링 */} + {renderSelectedComponent()} +
+ ); } export default Manage; - diff --git a/src/components/Menu/WeeklyMenu.js b/src/components/Menu/WeeklyMenu.js new file mode 100644 index 0000000..d1fc1ce --- /dev/null +++ b/src/components/Menu/WeeklyMenu.js @@ -0,0 +1,38 @@ +import React, { useState } from "react"; +import Meal from "./Meal/Meal"; +import FixMenu from "./FixMenu/FixMenu"; +import DateNavigator from "./DateNavigator"; +import MenuTypeRadio from "./MenuTypeRadio"; +import TimePartSelector from "./TimePartSelector"; +import "./Menu.css"; + +function WeeklyMenu() { + const [selectedMenuType, setSelectedMenuType] = useState("meal"); + const [selectedDate, setSelectedDate] = useState(new Date()); + const [selectedTimePart, setSelectedTimePart] = useState("lunch"); + + const renderSelectedComponent = () => { + switch (selectedMenuType) { + case "meal": + return ; + case "fix-menu": + return ; + default: + return ; + } + }; + return ( +
+
+ ); +} +export default WeeklyMenu; diff --git a/src/components/NavBar/NavBar.js b/src/components/NavBar/NavBar.js index 90e961c..e1b1378 100644 --- a/src/components/NavBar/NavBar.js +++ b/src/components/NavBar/NavBar.js @@ -1,67 +1,77 @@ -import React from 'react'; -import { AppBar, Toolbar, Typography, Button } from '@mui/material'; -import './NavBar.css'; -import { styled } from '@mui/material/styles'; -import { useAuth } from '../../contexts/AuthContext'; +import React from "react"; +import { AppBar, Toolbar, Typography, Button } from "@mui/material"; +import "./NavBar.css"; +import { styled } from "@mui/material/styles"; +import { useAuth } from "../../contexts/AuthContext"; const navItems = [ - { label: '메뉴 관리', value: 'menu' }, - { label: '리뷰 신고', value: 'report' }, - { label: '문의 내역', value: 'inquiry' }, -] + { label: "메뉴 관리", value: "menu" }, + { label: "주간 메뉴 관리", value: "weeklyMenu" }, + { label: "리뷰 신고", value: "report" }, + { label: "문의 내역", value: "inquiry" }, +]; const MenuButton = styled(Button)({ - margin: '0 1rem', - '&:hover': { - backgroundColor: 'lightgray', - }, + margin: "0 1rem", + "&:hover": { + backgroundColor: "lightgray", + }, }); const LogoutButton = styled(Button)({ - fontSize: '1rem', - fontWeight: '700', - borderRadius: '0.7rem', - padding: '0.4rem 1rem', - backgroundColor: '#DF5757', - '&:hover': { - backgroundColor: '#DF5757', - }, + fontSize: "1rem", + fontWeight: "700", + borderRadius: "0.7rem", + padding: "0.4rem 1rem", + backgroundColor: "#DF5757", + "&:hover": { + backgroundColor: "#DF5757", + }, }); function NavBar({ selectedComponent, setSelectedComponent }) { + const { logout } = useAuth(); - const { logout } = useAuth(); + const handleComponentChange = (component) => { + setSelectedComponent(component); + }; - const handleComponentChange = (component) => { - setSelectedComponent(component); - }; - - return ( - - - - EAT - - SSU - -
- {navItems.map(item => ( - handleComponentChange(item.value)} - > - {item.label} - - ))} -
-
- 로그아웃 -
-
-
- ); + return ( + + + + EAT + + SSU + +
+ {navItems.map((item) => ( + handleComponentChange(item.value)} + > + {item.label} + + ))} +
+
+ + 로그아웃 + +
+
+
+ ); } -export default NavBar; \ No newline at end of file +export default NavBar;