diff --git a/public/favicon/android-chrome-192x192.png b/public/favicon/android-chrome-192x192.png deleted file mode 100644 index e9a2e17..0000000 Binary files a/public/favicon/android-chrome-192x192.png and /dev/null differ diff --git a/public/favicon/android-chrome-512x512.png b/public/favicon/android-chrome-512x512.png deleted file mode 100644 index 34055c4..0000000 Binary files a/public/favicon/android-chrome-512x512.png and /dev/null differ diff --git a/public/favicon/android-icon-144x144.png b/public/favicon/android-icon-144x144.png new file mode 100644 index 0000000..7f4fec2 Binary files /dev/null and b/public/favicon/android-icon-144x144.png differ diff --git a/public/favicon/android-icon-192x192.png b/public/favicon/android-icon-192x192.png new file mode 100644 index 0000000..7bf454e Binary files /dev/null and b/public/favicon/android-icon-192x192.png differ diff --git a/public/favicon/android-icon-36x36.png b/public/favicon/android-icon-36x36.png new file mode 100644 index 0000000..7692dcd Binary files /dev/null and b/public/favicon/android-icon-36x36.png differ diff --git a/public/favicon/android-icon-48x48.png b/public/favicon/android-icon-48x48.png new file mode 100644 index 0000000..3605c7f Binary files /dev/null and b/public/favicon/android-icon-48x48.png differ diff --git a/public/favicon/android-icon-72x72.png b/public/favicon/android-icon-72x72.png new file mode 100644 index 0000000..92fb3d4 Binary files /dev/null and b/public/favicon/android-icon-72x72.png differ diff --git a/public/favicon/android-icon-96x96.png b/public/favicon/android-icon-96x96.png new file mode 100644 index 0000000..9f74a4d Binary files /dev/null and b/public/favicon/android-icon-96x96.png differ diff --git a/public/favicon/apple-icon-114x114.png b/public/favicon/apple-icon-114x114.png new file mode 100644 index 0000000..a221fca Binary files /dev/null and b/public/favicon/apple-icon-114x114.png differ diff --git a/public/favicon/apple-icon-120x120.png b/public/favicon/apple-icon-120x120.png new file mode 100644 index 0000000..0fd4430 Binary files /dev/null and b/public/favicon/apple-icon-120x120.png differ diff --git a/public/favicon/apple-icon-144x144.png b/public/favicon/apple-icon-144x144.png new file mode 100644 index 0000000..7f4fec2 Binary files /dev/null and b/public/favicon/apple-icon-144x144.png differ diff --git a/public/favicon/apple-icon-152x152.png b/public/favicon/apple-icon-152x152.png new file mode 100644 index 0000000..7c25000 Binary files /dev/null and b/public/favicon/apple-icon-152x152.png differ diff --git a/public/favicon/apple-icon-180x180.png b/public/favicon/apple-icon-180x180.png new file mode 100644 index 0000000..3e5a645 Binary files /dev/null and b/public/favicon/apple-icon-180x180.png differ diff --git a/public/favicon/apple-icon-57x57.png b/public/favicon/apple-icon-57x57.png new file mode 100644 index 0000000..90dff76 Binary files /dev/null and b/public/favicon/apple-icon-57x57.png differ diff --git a/public/favicon/apple-icon-60x60.png b/public/favicon/apple-icon-60x60.png new file mode 100644 index 0000000..39d6367 Binary files /dev/null and b/public/favicon/apple-icon-60x60.png differ diff --git a/public/favicon/apple-icon-72x72.png b/public/favicon/apple-icon-72x72.png new file mode 100644 index 0000000..92fb3d4 Binary files /dev/null and b/public/favicon/apple-icon-72x72.png differ diff --git a/public/favicon/apple-icon-76x76.png b/public/favicon/apple-icon-76x76.png new file mode 100644 index 0000000..24fa327 Binary files /dev/null and b/public/favicon/apple-icon-76x76.png differ diff --git a/public/favicon/apple-icon-precomposed.png b/public/favicon/apple-icon-precomposed.png new file mode 100644 index 0000000..bf161a1 Binary files /dev/null and b/public/favicon/apple-icon-precomposed.png differ diff --git a/public/favicon/apple-icon.png b/public/favicon/apple-icon.png new file mode 100644 index 0000000..bf161a1 Binary files /dev/null and b/public/favicon/apple-icon.png differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png deleted file mode 100644 index 64a73c0..0000000 Binary files a/public/favicon/apple-touch-icon.png and /dev/null differ diff --git a/public/favicon/browserconfig.xml b/public/favicon/browserconfig.xml new file mode 100644 index 0000000..c554148 --- /dev/null +++ b/public/favicon/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff \ No newline at end of file diff --git a/public/favicon/favicon-16x16.png b/public/favicon/favicon-16x16.png index ebe6e05..ee8d091 100644 Binary files a/public/favicon/favicon-16x16.png and b/public/favicon/favicon-16x16.png differ diff --git a/public/favicon/favicon-32x32.png b/public/favicon/favicon-32x32.png index ae43756..ab8cabf 100644 Binary files a/public/favicon/favicon-32x32.png and b/public/favicon/favicon-32x32.png differ diff --git a/public/favicon/favicon-96x96.png b/public/favicon/favicon-96x96.png new file mode 100644 index 0000000..9f74a4d Binary files /dev/null and b/public/favicon/favicon-96x96.png differ diff --git a/public/favicon/favicon.ico b/public/favicon/favicon.ico index 45b0186..9101b5c 100644 Binary files a/public/favicon/favicon.ico and b/public/favicon/favicon.ico differ diff --git a/public/favicon/manifest.json b/public/favicon/manifest.json new file mode 100644 index 0000000..013d4a6 --- /dev/null +++ b/public/favicon/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "App", + "icons": [ + { + "src": "\/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/public/favicon/ms-icon-144x144.png b/public/favicon/ms-icon-144x144.png new file mode 100644 index 0000000..7f4fec2 Binary files /dev/null and b/public/favicon/ms-icon-144x144.png differ diff --git a/public/favicon/ms-icon-150x150.png b/public/favicon/ms-icon-150x150.png new file mode 100644 index 0000000..6198d13 Binary files /dev/null and b/public/favicon/ms-icon-150x150.png differ diff --git a/public/favicon/ms-icon-310x310.png b/public/favicon/ms-icon-310x310.png new file mode 100644 index 0000000..9a22d55 Binary files /dev/null and b/public/favicon/ms-icon-310x310.png differ diff --git a/public/favicon/ms-icon-70x70.png b/public/favicon/ms-icon-70x70.png new file mode 100644 index 0000000..dd5de4e Binary files /dev/null and b/public/favicon/ms-icon-70x70.png differ diff --git a/public/index.html b/public/index.html index 250d121..3ccd3ac 100644 --- a/public/index.html +++ b/public/index.html @@ -8,11 +8,24 @@ - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/_mock/_reserve.ts b/src/_mock/_reserve.ts index 974f474..255305b 100644 --- a/src/_mock/_reserve.ts +++ b/src/_mock/_reserve.ts @@ -9,33 +9,21 @@ export const RESERVE_STATUS_OPTIONS = [ { value: '자동취소', label: '자동취소' }, ]; -const ITEMS = [...Array(3)].map((_, index) => ({ +export const _reserve = [...Array(0)].map((_, index) => ({ id: _mock.id(index), - sku: `16H9UR${index}`, - quantity: index + 1, - name: _mock.productName(index), - coverUrl: _mock.image.product(index), - price: _mock.number.price(index), + spaceName: _mock.spaceName(index), + useDate: _mock.useDate(index), + startTime: _mock.startTime(index), + endTime: _mock.endTime(index), + user: _mock.fullName(index), + purpose: _mock.purpose(index), + // shippingAddress: { + // fullAddress: '19034 Verna Unions Apt. 164 - Honolulu, RI / 87535', + // phoneNumber: '365-374-4961', + // }, + // payment: { + // cardType: 'mastercard', + // cardNumber: '**** **** **** 5678', + // }, + status: (index % 2 && '승인') || (index % 3 && '미승인') || (index % 4 && '거절') || '자동취소', })); - -export const _reserve = [...Array(0)].map((_, index) => { - const createAt = new Date(); - return { - id: _mock.id(index), - spaceName: _mock.spaceName(index), - useDate: _mock.useDate(index), - startTime: _mock.startTime(index), - endTime: _mock.endTime(index), - user: _mock.fullName(index), - purpose: _mock.purpose(index), - // shippingAddress: { - // fullAddress: '19034 Verna Unions Apt. 164 - Honolulu, RI / 87535', - // phoneNumber: '365-374-4961', - // }, - // payment: { - // cardType: 'mastercard', - // cardNumber: '**** **** **** 5678', - // }, - status: (index % 2 && '승인') || (index % 3 && '미승인') || (index % 4 && '거절') || '자동취소', - }; -}); diff --git a/src/api/reserveApi.ts b/src/api/reserveApi.ts index 21e8f8f..c9efd6a 100644 --- a/src/api/reserveApi.ts +++ b/src/api/reserveApi.ts @@ -1,7 +1,6 @@ import axiosInstance, { endpoints } from 'src/utils/axios'; import { ICalendarEvent } from 'src/types/calendar'; import { palette as themePalette } from 'src/theme/palette'; -import { isEmpty } from 'lodash'; import { DailyReserveAdd, RegularReserveAdd } from 'src/types/reserve'; const palette = themePalette('light'); diff --git a/src/auth/context/jwt/auth-provider.tsx b/src/auth/context/jwt/auth-provider.tsx index 306e39c..7ae1fb6 100644 --- a/src/auth/context/jwt/auth-provider.tsx +++ b/src/auth/context/jwt/auth-provider.tsx @@ -30,9 +30,8 @@ type Payload = { [Types.LOGIN]: { user: AuthUserType; }; - [Types.REGISTER]: { - user: AuthUserType; - }; + [Types.REGISTER]: undefined; + [Types.LOGOUT]: undefined; }; @@ -61,7 +60,7 @@ const reducer = (state: AuthStateType, action: ActionsType) => { if (action.type === Types.REGISTER) { return { ...state, - user: action.payload.user, + user: null, }; } if (action.type === Types.LOGOUT) { @@ -154,28 +153,23 @@ export function AuthProvider({ children }: Props) { // REGISTER const register = useCallback( - async (email: string, password: string, firstName: string, lastName: string) => { + async (name: string, s_id: string, deptName: string, email: string, password: string) => { const data = { + name, + s_id, + deptName, email, password, - firstName, - lastName, }; - const res = await axiosInstance.post(endpoints.auth.register, data); + await axiosInstance.post(endpoints.auth.register, data); - const { accessToken, user } = res.data; + // const { accessToken, user } = res.data; - sessionStorage.setItem(STORAGE_KEY, accessToken); + // sessionStorage.setItem(STORAGE_KEY, accessToken); dispatch({ type: Types.REGISTER, - payload: { - user: { - ...user, - accessToken, - }, - }, }); }, [] diff --git a/src/auth/types.ts b/src/auth/types.ts index f235e43..f0fd28d 100644 --- a/src/auth/types.ts +++ b/src/auth/types.ts @@ -26,10 +26,11 @@ export type AuthStateType = { type CanRemove = { login?: (email: string, password: string) => Promise; register?: ( + name: string, + s_id: string, + deptName: string, email: string, - password: string, - firstName: string, - lastName: string + password: string ) => Promise; // loginWithGoogle?: () => Promise; @@ -52,7 +53,13 @@ export type JWTContextType = CanRemove & { authenticated: boolean; unauthenticated: boolean; login: (email: string, password: string) => Promise; - register: (email: string, password: string, firstName: string, lastName: string) => Promise; + register: ( + name: string, + s_id: string, + deptName: string, + email: string, + password: string + ) => Promise; logout: () => Promise; }; @@ -68,7 +75,13 @@ export type FirebaseContextType = CanRemove & { loginWithTwitter: () => Promise; forgotPassword?: (email: string) => Promise; login: (email: string, password: string) => Promise; - register: (email: string, password: string, firstName: string, lastName: string) => Promise; + register: ( + name: string, + s_id: string, + deptName: string, + email: string, + password: string + ) => Promise; }; export type AmplifyContextType = CanRemove & { @@ -79,10 +92,11 @@ export type AmplifyContextType = CanRemove & { unauthenticated: boolean; login: (email: string, password: string) => Promise; register: ( + name: string, + s_id: string, + deptName: string, email: string, - password: string, - firstName: string, - lastName: string + password: string ) => Promise; logout: () => Promise; confirmRegister: (email: string, code: string) => Promise; diff --git a/src/layouts/auth/classic.tsx b/src/layouts/auth/classic.tsx index ba82996..dda406b 100644 --- a/src/layouts/auth/classic.tsx +++ b/src/layouts/auth/classic.tsx @@ -86,18 +86,6 @@ export default function AuthClassicLayout({ children, image, title }: Props) { {title || 'Hi, Welcome To Hanspace'} - {/* */} handleGOAddDept(event)} > - + 새 기관 추가하기 - + diff --git a/src/pages/auth/jwt/register.tsx b/src/pages/auth/jwt/register.tsx index 17dd45d..f1ea631 100644 --- a/src/pages/auth/jwt/register.tsx +++ b/src/pages/auth/jwt/register.tsx @@ -8,7 +8,7 @@ export default function RegisterPage() { return ( <> - Jwt: Register + HANSPACE: 회원가입 diff --git a/src/routes/sections/auth.tsx b/src/routes/sections/auth.tsx index 5b839a9..1015c63 100644 --- a/src/routes/sections/auth.tsx +++ b/src/routes/sections/auth.tsx @@ -36,7 +36,7 @@ const authJwt = { { path: 'register', element: ( - + ), diff --git a/src/sections/auth/jwt/jwt-login-view.tsx b/src/sections/auth/jwt/jwt-login-view.tsx index ddf2e5d..8e4ebf2 100644 --- a/src/sections/auth/jwt/jwt-login-view.tsx +++ b/src/sections/auth/jwt/jwt-login-view.tsx @@ -78,7 +78,7 @@ export default function JwtLoginView() { 회원이 아니세요? - 회원가입 + 회원가입하기 diff --git a/src/sections/auth/jwt/jwt-register-view.tsx b/src/sections/auth/jwt/jwt-register-view.tsx index f895d4f..74e0290 100644 --- a/src/sections/auth/jwt/jwt-register-view.tsx +++ b/src/sections/auth/jwt/jwt-register-view.tsx @@ -15,17 +15,32 @@ import { useBoolean } from 'src/hooks/use-boolean'; // routes import { paths } from 'src/routes/paths'; import { RouterLink } from 'src/routes/components'; -import { useSearchParams, useRouter } from 'src/routes/hooks'; -// config -import { PATH_AFTER_LOGIN } from 'src/config-global'; +import { useRouter } from 'src/routes/hooks'; // auth import { useAuthContext } from 'src/auth/hooks'; // components import Iconify from 'src/components/iconify'; -import FormProvider, { RHFTextField } from 'src/components/hook-form'; +import FormProvider, { RHFSelect, RHFTextField } from 'src/components/hook-form'; +import { MenuItem } from '@mui/material'; // ---------------------------------------------------------------------- +const OPTIONS = [ + { value: '글로벌리더십학부', label: '글로벌리더십학부' }, + { value: '전산전자공학부', label: '전산전자공학부' }, + { value: '국제어문학부', label: '국제어문학부' }, + { value: '경영경제학부 ', label: '경영경제학부' }, + { value: '법학부', label: '법학부' }, + { value: '커뮤니케이션학부', label: '커뮤니케이션학부' }, + { value: '공간환경시스템공학부', label: '공간환경시스템공학부' }, + { value: '기계제어공학부', label: '기계제어공학부' }, + { value: '콘텐츠융합디자인학부', label: '콘텐츠융합디자인학부' }, + { value: '생명과학부', label: '생명과학부' }, + { value: '전산전자공학부', label: '전산전자공학부' }, + { value: '상담심리사회복지학부', label: '상담심리사회복지학부' }, + { value: 'ICT창업학부', label: 'ICT창업학부' }, +]; + export default function JwtRegisterView() { const { register } = useAuthContext(); @@ -33,22 +48,20 @@ export default function JwtRegisterView() { const [errorMsg, setErrorMsg] = useState(''); - const searchParams = useSearchParams(); - - const returnTo = searchParams.get('returnTo'); - const password = useBoolean(); const RegisterSchema = Yup.object().shape({ - firstName: Yup.string().required('First name required'), - lastName: Yup.string().required('Last name required'), - email: Yup.string().required('Email is required').email('Email must be a valid email address'), - password: Yup.string().required('Password is required'), + name: Yup.string().required('이름을 입력해주세요'), + s_id: Yup.string().required('학번을 입력해주세요'), + deptName: Yup.string().required('학부를 입력해주세요'), + email: Yup.string().required('메일을 입력해주세요').email('메일 형식이 올바르지 않습니다'), + password: Yup.string().required('비밀번호를 입력해주세요'), }); const defaultValues = { - firstName: '', - lastName: '', + name: '', + s_id: '', + deptName: '', email: '', password: '', }; @@ -66,9 +79,9 @@ export default function JwtRegisterView() { const onSubmit = handleSubmit(async (data) => { try { - await register?.(data.email, data.password, data.firstName, data.lastName); + await register?.(data.name, data.s_id, data.deptName, data.email, data.password); - router.push(returnTo || PATH_AFTER_LOGIN); + router.push(paths.auth.jwt.login); } catch (error) { console.error(error); reset(); @@ -78,55 +91,40 @@ export default function JwtRegisterView() { const renderHead = ( - Get started absolutely free + HANSPACE 시작하기 - Already have an account? + 계정이 있으신가요? - Sign in + 로그인하기 ); - const renderTerms = ( - - {'By signing up, I agree to '} - - Terms of Service - - {' and '} - - Privacy Policy - - . - - ); - const renderForm = ( {!!errorMsg && {errorMsg}} - - - - + + + - + + {OPTIONS.map((option) => ( + + {option.label} + + ))} + + + - Create account + 회원가입 @@ -158,8 +156,6 @@ export default function JwtRegisterView() { {renderHead} {renderForm} - - {renderTerms} ); } diff --git a/src/sections/dashboard/calendar/calendar-form.tsx b/src/sections/dashboard/calendar/calendar-form.tsx index 1fcecfb..98e734e 100644 --- a/src/sections/dashboard/calendar/calendar-form.tsx +++ b/src/sections/dashboard/calendar/calendar-form.tsx @@ -1,29 +1,20 @@ -import { useCallback, useEffect } from 'react'; import * as Yup from 'yup'; import { useForm, Controller } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; // @mui import { MobileDateTimePicker } from '@mui/x-date-pickers/MobileDateTimePicker'; -import LoadingButton from '@mui/lab/LoadingButton'; import Box from '@mui/material/Box'; import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; -import Tooltip from '@mui/material/Tooltip'; -import IconButton from '@mui/material/IconButton'; import DialogActions from '@mui/material/DialogActions'; // utils -import uuidv4 from 'src/utils/uuidv4'; import { fTimestamp } from 'src/utils/format-time'; // api -import { createEvent, updateEvent, deleteEvent } from 'src/api/calendar'; // components -import Iconify from 'src/components/iconify'; import { useSnackbar } from 'src/components/snackbar'; -import { ColorPicker } from 'src/components/color-utils'; -import FormProvider, { RHFTextField, RHFSwitch } from 'src/components/hook-form'; +import FormProvider, { RHFTextField } from 'src/components/hook-form'; // types import { ICalendarEvent, ICalendarDate } from 'src/types/calendar'; -import { defaultValues } from 'src/sections/reserve/reserve-daily-form1'; // ---------------------------------------------------------------------- @@ -34,7 +25,7 @@ type Props = { }; export default function CalendarForm({ currentEvent, onClose }: Props) { - const { enqueueSnackbar } = useSnackbar(); + // const { enqueueSnackbar } = useSnackbar(); const EventSchema = Yup.object().shape({ title: Yup.string().max(255).required('제목을 입력해주세요'), @@ -51,13 +42,12 @@ export default function CalendarForm({ currentEvent, onClose }: Props) { defaultValues: currentEvent, }); - const { - reset, + // reset, watch, control, - handleSubmit, - formState: { isSubmitting }, + // handleSubmit, + // formState: { isSubmitting }, } = methods; const values = watch(); @@ -106,8 +96,8 @@ export default function CalendarForm({ currentEvent, onClose }: Props) { // - - + + {/* */} {/* */} @@ -199,4 +189,4 @@ export default function CalendarForm({ currentEvent, onClose }: Props) { ); -} \ No newline at end of file +} diff --git a/src/sections/dashboard/calendar/hooks/admin-calendar.ts b/src/sections/dashboard/calendar/hooks/admin-calendar.ts index 283ffd8..366f8b9 100644 --- a/src/sections/dashboard/calendar/hooks/admin-calendar.ts +++ b/src/sections/dashboard/calendar/hooks/admin-calendar.ts @@ -2,8 +2,6 @@ import FullCalendar from '@fullcalendar/react'; import { DateSelectArg, EventClickArg, EventDropArg } from '@fullcalendar/core'; import { EventResizeDoneArg } from '@fullcalendar/interaction'; import { useState, useCallback, useRef } from 'react'; -// hooks -import { useResponsive } from 'src/hooks/use-responsive'; // utils import { fTimestamp } from 'src/utils/format-time'; // types diff --git a/src/sections/dashboard/calendar/hooks/use-calendar.ts b/src/sections/dashboard/calendar/hooks/use-calendar.ts index d6fe2d9..2368e60 100644 --- a/src/sections/dashboard/calendar/hooks/use-calendar.ts +++ b/src/sections/dashboard/calendar/hooks/use-calendar.ts @@ -3,7 +3,7 @@ import { DateSelectArg, EventClickArg, EventDropArg } from '@fullcalendar/core'; import { EventResizeDoneArg } from '@fullcalendar/interaction'; import { useState, useCallback, useRef } from 'react'; // hooks -import { useResponsive } from 'src/hooks/use-responsive'; +// import { useResponsive } from 'src/hooks/use-responsive'; // utils import { fTimestamp } from 'src/utils/format-time'; // types @@ -16,7 +16,7 @@ export default function useUserCalendar() { const calendarEl = calendarRef.current; - const smUp = useResponsive('up', 'sm'); + // const smUp = useResponsive('up', 'sm'); const [date, setDate] = useState(new Date()); diff --git a/src/sections/dashboard/calendar/view/admin-calendar-view.tsx b/src/sections/dashboard/calendar/view/admin-calendar-view.tsx index 2460b39..fcc1678 100644 --- a/src/sections/dashboard/calendar/view/admin-calendar-view.tsx +++ b/src/sections/dashboard/calendar/view/admin-calendar-view.tsx @@ -7,15 +7,12 @@ import timelinePlugin from '@fullcalendar/timeline'; // import { useState, useEffect, useCallback } from 'react'; import { useRecoilValue } from 'recoil'; -import { DeptUrlState, userDeptState } from 'src/utils/atom'; +import { userDeptState } from 'src/utils/atom'; // @mui import { useTheme } from '@mui/material/styles'; import Card from '@mui/material/Card'; -import Stack from '@mui/material/Stack'; -import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import Container from '@mui/material/Container'; -import Typography from '@mui/material/Typography'; import DialogTitle from '@mui/material/DialogTitle'; // utils import { fTimestamp } from 'src/utils/format-time'; @@ -24,19 +21,16 @@ import { useBoolean } from 'src/hooks/use-boolean'; import { useResponsive } from 'src/hooks/use-responsive'; // _mock import { CALENDAR_COLOR_OPTIONS } from 'src/_mock/_calendar'; -import { palette as themePalette } from 'src/theme/palette'; // api -import { useGetEvents, updateEvent } from 'src/api/calendar'; +import { updateEvent } from 'src/api/calendar'; import { GetReserveListByDept } from 'src/api/reserveApi'; // components -import Iconify from 'src/components/iconify'; import { useSettingsContext } from 'src/components/settings'; // types import { ICalendarFilters, ICalendarFilterValue, ICalendarEvent } from 'src/types/calendar'; // -import { useAdminCalendar, useEvent } from '../hooks'; +import { useAdminCalendar } from '../hooks'; import { StyledCalendar } from '../styles'; -import CalendarForm from '../calendar-form'; import CalendarUForm from '../calendar-uform'; import UCalendarToolbar from '../calendar-utoolbar'; import CalendarFilters from '../calendar-filters'; @@ -60,7 +54,6 @@ const defaultFilters: ICalendarFilters = { startDate: null, endDate: null, }; -const palette = themePalette('light'); // const eventsData: ICalendarEvent[] = [ // ex // { // id: "1", @@ -115,11 +108,11 @@ export default function UserCalendarView() { onInitialView, // openForm, - onOpenForm, + // onOpenForm, onCloseForm, // selectEventId, - selectedRange, + // selectedRange, // onClickEventInFilters, } = useAdminCalendar(); diff --git a/src/sections/dashboard/calendar/view/user-calendar-view.tsx b/src/sections/dashboard/calendar/view/user-calendar-view.tsx index 8490980..d7eca9a 100644 --- a/src/sections/dashboard/calendar/view/user-calendar-view.tsx +++ b/src/sections/dashboard/calendar/view/user-calendar-view.tsx @@ -21,7 +21,6 @@ import { useBoolean } from 'src/hooks/use-boolean'; import { useResponsive } from 'src/hooks/use-responsive'; // _mock import { CALENDAR_COLOR_OPTIONS } from 'src/_mock/_calendar'; -import { palette as themePalette } from 'src/theme/palette'; // api import { updateEvent } from 'src/api/calendar'; import { GetReserveListByMember } from 'src/api/reserveApi'; diff --git a/src/sections/department_c/dept-dialog.tsx b/src/sections/department_c/dept-dialog.tsx index d024e0c..1b65628 100644 --- a/src/sections/department_c/dept-dialog.tsx +++ b/src/sections/department_c/dept-dialog.tsx @@ -18,8 +18,7 @@ export default function DepartmentCreateSuccessDialog({ 기관 신청이 완료되었습니다. - {' '} - 기관에 장소를 추가하여 장소 대여를 시작해보세요!{' '} + 기관에 장소를 추가하여 장소 대여를 시작해보세요! diff --git a/src/sections/home/dept-list.tsx b/src/sections/home/dept-list.tsx index f5e7587..c331b24 100644 --- a/src/sections/home/dept-list.tsx +++ b/src/sections/home/dept-list.tsx @@ -8,139 +8,6 @@ import DeptCard from './dept-card'; import AccessedDialog from './success-modal-accessed'; import PendingDialog from './success-modal-pending'; -// const deptlist: IDeptInfo[] = [ -// { -// deptId: 1, -// deptName: '전산전자공학부', -// memberCount: 123, -// spaceCount: 15, -// userAccept: true, -// image: 'https://www.snunews.com/news/photo/201809/18599_11268_2922.jpg', -// deptMemberResponse: [], -// }, -// { -// deptId: 2, -// deptName: '상담심리사회복지', -// memberCount: 75, -// spaceCount: 8, -// userAccept: true, -// image: 'https://map.snu.ac.kr/api/upload/spot/84a71dc3-9891-4e67-8f8a-b1b0cf9bfe9c.jpg', -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'User', -// approve: '승인', -// }, -// ], -// }, -// { -// deptId: 3, -// deptName: '생명과학부', -// memberCount: 60, -// spaceCount: 10, -// userAccept: false, -// image: -// 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRyelkwHA6AFR2bCzp06Ceauo4YQ7nfA1XP30gGZkEffQ8ZP3-WcxygRO2PccgIfET6rXU&usqp=CAU', -// deptMemberResponse: [], -// }, -// { -// deptId: 4, -// deptName: 'ICT창업학부', -// memberCount: 100, -// image: -// 'https://wimg.mk.co.kr/news/cms/202212/14/news-p.v1.20221213.88bc4288ad01428c9f29203f20cba568_P1.jpg', -// spaceCount: 12, -// userAccept: true, -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'Admin', -// approve: '승인', -// }, -// ], -// }, -// { -// deptId: 5, -// deptName: '공간환경시스템디자인학부', -// memberCount: 45, -// image: -// 'https://search.pstatic.net/common/?src=http%3A%2F%2Fblogfiles.naver.net%2FMjAxOTAzMjlfNjYg%2FMDAxNTUzODM4MTg1MDEy.h7Vx5F3Fj8OsCpWnhZv9jI_54LFCFr-5k5jmuvfQkmgg.-2_GcmAI44-hRnKN_pawJH9ocytF4-ecMiqgLuK8dYcg.JPEG.su_mini214%2Foutput_2725856160.jpg&type=sc960_832', -// spaceCount: 5, -// userAccept: false, -// deptMemberResponse: [], -// }, -// { -// deptId: 6, -// deptName: '경영경제학부', -// memberCount: 50, -// image: 'https://cdn.crowdpic.net/detail-thumb/thumb_d_8B8E1C3B87961CEAC3D6AA8BA5AD7D4C.jpg', -// spaceCount: 7, -// userAccept: true, -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'Admin', -// approve: '승인', -// }, -// ], -// }, -// { -// deptId: 7, -// deptName: '기계제어공학부', -// memberCount: 40, -// image: -// 'https://search.pstatic.net/common/?src=http%3A%2F%2Fblogfiles.naver.net%2F20160725_172%2Fhyun_a_99_1469449498743J8Gp0_JPEG%2F20160528_165238_%25281%2529.jpg&type=sc960_832', -// spaceCount: 6, -// userAccept: true, -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'User', -// approve: '승인대기', -// }, -// ], -// }, -// { -// deptId: 8, -// deptName: '법학부', -// memberCount: 85, -// image: 'https://www.osan.ac.kr/usr/images/buildings/8_1.png', -// spaceCount: 9, -// userAccept: true, -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'User', -// approve: '승인대기', -// }, -// ], -// }, -// { -// deptId: 9, -// deptName: '심리학 프로이드 강당', -// memberCount: 110, -// image: 'https://source.unsplash.com/random', -// spaceCount: 11, -// userAccept: true, -// deptMemberResponse: [ -// { -// deptMemberId: 9, -// deptRole: 'Admin', -// approve: '승인', -// }, -// ], -// }, -// { -// deptId: 10, -// deptName: '경제 아담스미스 스튜디오', -// memberCount: 95, -// image: 'https://source.unsplash.com/random', -// spaceCount: 14, -// deptMemberResponse: [], -// userAccept: true, -// }, -// ]; - export default function DeptList({ deptList }: { deptList: IDeptInfo[] | null }) { const [currentDept, setCurrentDept] = useState(null); const [isAddSuccessDialogOpen, setIsAddSuccessDialogOpen] = useState(false); diff --git a/src/sections/home/success-modal-accessed.tsx b/src/sections/home/success-modal-accessed.tsx index 1f1f566..21ccccd 100644 --- a/src/sections/home/success-modal-accessed.tsx +++ b/src/sections/home/success-modal-accessed.tsx @@ -51,7 +51,7 @@ export default function AccessedDialog({ open, onClose, currentDept }: IAccessMo {`이제 ${currentDept?.deptName}에서 제공하는 장소들을 자유롭게 예약할 수 있습니다!`} - 장소대여를 더욱 편리하게, HanSpace + 장소대여를 더욱 편리하게, Hanspace @@ -65,7 +65,7 @@ export default function AccessedDialog({ open, onClose, currentDept }: IAccessMo onClick={() => moveToDept(currentDept?.link)} color="primary" autoFocus - style={{ padding: '15px 50px' }} + style={{ padding: '15px 50px', marginRight: '10px' }} > 기관 둘러보기 diff --git a/src/sections/reserve/reserve-csv.tsx b/src/sections/reserve/reserve-csv.tsx index 800a7ff..a1ac1ba 100644 --- a/src/sections/reserve/reserve-csv.tsx +++ b/src/sections/reserve/reserve-csv.tsx @@ -1,11 +1,8 @@ -// react -import styled from 'styled-components'; // @mui import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; // components -import { useSettingsContext } from 'src/components/settings'; import { useForm } from 'react-hook-form'; import FormProvider, { RHFUpload } from 'src/components/hook-form'; import { useCallback } from 'react'; @@ -40,11 +37,11 @@ export default function ReserveCSVForm({ selectedValue, handleRadioChange }: Res const { // watch, - reset, + // reset, // control, setValue, - handleSubmit, - formState: { isSubmitting }, + // handleSubmit, + // formState: { isSubmitting }, } = methods; const handleDropSingleFile = useCallback( diff --git a/src/sections/reserve/reserve-daily-dialog.tsx b/src/sections/reserve/reserve-daily-dialog.tsx index 6785cd5..9f4e42f 100644 --- a/src/sections/reserve/reserve-daily-dialog.tsx +++ b/src/sections/reserve/reserve-daily-dialog.tsx @@ -3,35 +3,20 @@ import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { useEffect, useState } from 'react'; import Dialog from '@mui/material/Dialog'; -import TextField from '@mui/material/TextField'; import DialogTitle from '@mui/material/DialogTitle'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; -import Stack, { StackProps } from '@mui/material/Stack'; -import Autocomplete from '@mui/material/Autocomplete'; +import Stack from '@mui/material/Stack'; import Grid from '@mui/material/Grid'; import { userDeptState } from 'src/utils/atom'; import { useRecoilValue } from 'recoil'; -import { DatePicker, DesktopTimePicker } from '@mui/x-date-pickers'; +import { DesktopTimePicker } from '@mui/x-date-pickers'; import { createReserve } from 'src/api/reserveApi'; // components import { useForm } from 'react-hook-form'; -import FormProvider, { - RHFEditor, - RHFSelect, - RHFUpload, - RHFSwitch, - RHFSlider, - RHFCheckbox, - RHFTextField, - RHFRadioGroup, - RHFMultiSelect, - RHFAutocomplete, - RHFMultiCheckbox, -} from 'src/components/hook-form'; +import FormProvider, { RHFTextField } from 'src/components/hook-form'; import dayjs from 'dayjs'; -import Image from 'src/components/image'; import ReserveSuccessDialog from './reserve-dialog'; interface ReserveDailyForm2Props { @@ -73,9 +58,9 @@ export default function DailyReserveFormDialog({ // watch, reset, // control, - setValue, + // setValue, handleSubmit, - formState: { isSubmitting }, + // formState: { isSubmitting }, } = methods; // 기관이 등록한 extra 요구 정보들을 불러오기 @@ -85,6 +70,7 @@ export default function DailyReserveFormDialog({ let deptId = 0; if (typeof userDeptValue === 'object') { + // eslint-disable-next-line @typescript-eslint/no-unused-vars ({ deptId } = userDeptValue); setExtraData(userDeptValue.extraInfo); console.log(userDeptState); diff --git a/src/sections/reserve/reserve-daily-form1.tsx b/src/sections/reserve/reserve-daily-form1.tsx index 6cfa81f..54a28f7 100644 --- a/src/sections/reserve/reserve-daily-form1.tsx +++ b/src/sections/reserve/reserve-daily-form1.tsx @@ -1,6 +1,5 @@ // react import { useCallback, useEffect, useState } from 'react'; -import styled from 'styled-components'; // @mui import Box from '@mui/material/Box'; import { DesktopTimePicker } from '@mui/x-date-pickers'; @@ -12,18 +11,10 @@ import { DatePicker } from '@mui/x-date-pickers/DatePicker'; import Fab from '@mui/material/Fab'; import AddIcon from '@mui/icons-material/Add'; import MinusIcon from '@mui/icons-material/Remove'; -// hooks -// import { useBoolean } from 'src/hooks/use-boolean'; // components -import { useSettingsContext } from 'src/components/settings'; -import { useForm } from 'react-hook-form'; import dayjs, { Dayjs } from 'dayjs'; import FormProvider from 'src/components/hook-form'; -import axiosInstance, { endpoints } from 'src/utils/axios'; -// api -import { GetSpace } from 'src/api/spaceApi'; -import { useQuery } from 'react-query'; -import { TextField, TextFieldProps } from '@mui/material'; +import { useForm } from 'react-hook-form'; import RowRadioButtonsGroup from './reserve-radio'; // ——————————————————————————————————— @@ -55,8 +46,9 @@ export default function ReserveDailyForm1({ // watch, // reset, // control, - setValue, + // setValue, // handleSubmit, + // eslint-disable-next-line @typescript-eslint/no-unused-vars formState: { isSubmitting }, } = methods; diff --git a/src/sections/reserve/reserve-daily-space.tsx b/src/sections/reserve/reserve-daily-space.tsx index d5eaa55..d4400c5 100644 --- a/src/sections/reserve/reserve-daily-space.tsx +++ b/src/sections/reserve/reserve-daily-space.tsx @@ -3,7 +3,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; // types -import { ISpaceItem, EXSpaceItem, IReservedItem } from 'src/types/space'; +import { EXSpaceItem } from 'src/types/space'; // components import Image from 'src/components/image'; import { useEffect, useState } from 'react'; diff --git a/src/sections/reserve/reserve-regularly-dialog.tsx b/src/sections/reserve/reserve-regularly-dialog.tsx index 7dedcc7..3e608c6 100644 --- a/src/sections/reserve/reserve-regularly-dialog.tsx +++ b/src/sections/reserve/reserve-regularly-dialog.tsx @@ -1,227 +1,244 @@ -import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { useEffect, useState } from 'react'; import Dialog from '@mui/material/Dialog'; -import TextField from '@mui/material/TextField'; import DialogTitle from '@mui/material/DialogTitle'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; -import Stack, { StackProps } from '@mui/material/Stack'; +import Stack from '@mui/material/Stack'; import Grid from '@mui/material/Grid'; import { DesktopTimePicker } from '@mui/x-date-pickers'; // components import { useForm } from 'react-hook-form'; -import FormProvider , { - RHFEditor, - RHFSelect, - RHFUpload, - RHFSwitch, - RHFSlider, - RHFCheckbox, - RHFTextField, - RHFRadioGroup, - RHFMultiSelect, - RHFAutocomplete, - RHFMultiCheckbox, -} from 'src/components/hook-form'; +import FormProvider, { RHFTextField } from 'src/components/hook-form'; import dayjs from 'dayjs'; import Image from 'src/components/image'; import ReserveSuccessDialog from './reserve-dialog'; +interface ReserveRegularlyForm2Props { + selectedData: { + startDate: Date | null; + endDate: Date | null; + week: string | null; + startTime: string | null; + endTime: string | null; + // headCount: number | null; + spaceId: number | null; + spaceName: string; + spaceImage: string; + }; + open: boolean; + onClose: () => void; +} +interface InputField { + value: string; +} +export default function RegularlyReserveDialog({ + open, + onClose, + selectedData, +}: ReserveRegularlyForm2Props) { + const defaultValues = { + memberId: 1, + startDate: selectedData.startDate, + endDate: selectedData.endDate, + week: selectedData.week, + startTime: selectedData.startTime, + endTime: selectedData.endTime, + // headCount: selectedData.headCount, + spaceId: selectedData.spaceId, + purpose: '', + // phoneNumber: '', + status: '미승인', + extraInfoAns: [], + reserveCount: 0, + reserveDate: [], + }; + const methods = useForm({ + defaultValues, + }); + const { + // watch, + reset, + // control, + // setValue, + handleSubmit, + // formState: { isSubmitting }, + } = methods; + const [isSuccessDialogOpen, setIsSuccessDialogOpen] = useState(false); + const handleSuccessDialogControl = () => { + setIsSuccessDialogOpen(true); + }; -interface ReserveRegularlyForm2Props { - selectedData: { - startDate: Date | null; - endDate: Date | null; - week: string | null; - startTime: string | null; - endTime: string | null; - // headCount: number | null; - spaceId: number | null; - spaceName: string; - spaceImage: string; - }; - open: boolean; - onClose: () => void; - } - - interface InputField { - value: string; - } -export default function RegularlyReserveDialog({ open, onClose, selectedData}: ReserveRegularlyForm2Props) { - const defaultValues = { + const onSubmit = handleSubmit(async (data) => { + try { + reset(); + // extraInfoAnsList를 문자열로 결합 + const extraInfoAns1 = data.extraInfoAns.join(', '); + const week1 = Array.isArray(data.week) ? data.week.join(', ') : data.week; + const start_date = dayjs(selectedData.startDate); + const start_year = start_date.year(); + const start_month = start_date.month(); // 월은 0부터 시작 + const start_day = start_date.date(); + const end_date = dayjs(selectedData.endDate); + const end_year = end_date.year(); + const end_month = end_date.month(); // 월은 0부터 시작 + const end_day = end_date.date(); + const startDate = new Date(start_year, start_month, start_day); // 월은 0부터 시작해서 9는 10월입니다. + const endDate = new Date(end_year, end_month, end_day); + const dayOfWeek = ['일', '월', '화', '수', '목', '금', '토']; + const reserve_Date = []; + + while (startDate <= endDate) { + for (let i = 0; i < 7; i += 1) { + if (selectedData.week?.includes(dayOfWeek[i]) && startDate.getDay() === i) { + const dateStr = startDate.toISOString().split('T')[0]; + reserve_Date.push(dateStr); + defaultValues.reserveCount += 1; + } + } + startDate.setDate(startDate.getDate() + 1); + } + const dataToSend = { memberId: 1, - startDate: selectedData.startDate, - endDate: selectedData.endDate, - week: selectedData.week, + startDate: startDate.toISOString().split('T')[0], + endDate: endDate.toISOString().split('T')[0], + week: week1, startTime: selectedData.startTime, endTime: selectedData.endTime, // headCount: selectedData.headCount, spaceId: selectedData.spaceId, - purpose: '', - // phoneNumber: '', + purpose: data.purpose, status: '미승인', - extraInfoAns: [ ], - reserveCount: 0, - reserveDate: [ ], + extraInfoAns: extraInfoAns1, + reserveCount: defaultValues.reserveCount, + reserveDate: reserve_Date, }; - const methods = useForm({ - defaultValues - }); - const { - // watch, - reset, - // control, - setValue, - handleSubmit, - formState: { isSubmitting }, - } = methods; - const [isSuccessDialogOpen, setIsSuccessDialogOpen] = useState(false); - const handleSuccessDialogControl = () => { - setIsSuccessDialogOpen(true); - }; + console.info('DATA', dataToSend); - const onSubmit = handleSubmit(async (data) => { - try { - reset(); - // extraInfoAnsList를 문자열로 결합 - const extraInfoAns1 = data.extraInfoAns.join(', '); - const week1 = Array.isArray(data.week) ? data.week.join(', ') : data.week; - const start_date = dayjs(selectedData.startDate); - const start_year = start_date.year(); - const start_month = start_date.month(); // 월은 0부터 시작 - const start_day = start_date.date(); - const end_date = dayjs(selectedData.endDate); - const end_year = end_date.year(); - const end_month = end_date.month(); // 월은 0부터 시작 - const end_day = end_date.date(); - const startDate = new Date(start_year, start_month, start_day); // 월은 0부터 시작해서 9는 10월입니다. - const endDate = new Date(end_year, end_month, end_day); - const dayOfWeek = ["일", "월", "화", "수", "목", "금", "토"]; - const reserve_Date = [ ]; - - while (startDate <= endDate) { - for (let i = 0; i < 7; i += 1) { - if (selectedData.week?.includes(dayOfWeek[i]) && startDate.getDay() === i) { - const dateStr = startDate.toISOString().split('T')[0]; - reserve_Date.push(dateStr); - defaultValues.reserveCount += 1; - } - } - startDate.setDate(startDate.getDate() + 1); - } - const dataToSend = { - memberId: 1, - startDate: startDate.toISOString().split('T')[0], - endDate: endDate.toISOString().split('T')[0], - week: week1, - startTime: selectedData.startTime, - endTime: selectedData.endTime, - // headCount: selectedData.headCount, - spaceId: selectedData.spaceId, - purpose: data.purpose, - status: '미승인', - extraInfoAns: extraInfoAns1, - reserveCount: defaultValues.reserveCount, - reserveDate: reserve_Date, - }; - - console.info('DATA', dataToSend); - - // const response = await axios - // .post(`${BASE_URL}/reserve`, dataToSend) - // .then((log) => console.log('log', log)); + // const response = await axios + // .post(`${BASE_URL}/reserve`, dataToSend) + // .then((log) => console.log('log', log)); - handleSuccessDialogControl(); - } catch (error) { - console.error(error); - } - onClose(); - }); - // 기관이 등록한 extra 요구 정보들을 불러오기 - // const [extraData, setextraData] = useState(null); - const [extraData, setextraData] = useState("담당 교수님 성함, 사용 인원") - // useEffect(() => { - // // 데이터를 가져오는 함수 정의 - // const fetchData = async () => { - // try { - // // API생성되면 department id 받아서 그 id를 가지고 해당 dept/id로 호출해서 정보 받아오기 - // const response = await axios.get(`${BASE_URL}/dept/deptId/1`); - // setextraData(response.data.extraInfo); // 데이터 설정 - // console.log(response.data.extraInfo); - // } catch (error) { - // console.log("error"); - // } - // }; - - // fetchData(); // 데이터 가져오기 함수 호출 - // }, []); - const [inputFields, setInputFields] = useState([]); - const [words, setWords] = useState([]); - useEffect(() => { - if (extraData) { - const word = extraData.split(','); - const initialFields = word.map(() => ({ value: '' })); - setInputFields(initialFields); - setWords(word); - } - }, [extraData, words]); - const startTimeAsDate = new Date(`1970-01-01T${selectedData.startTime}`); - const endTimeAsDate = new Date(`1970-01-01T${selectedData.endTime}`); - return ( -
+ handleSuccessDialogControl(); + } catch (error) { + console.error(error); + } + onClose(); + }); + // 기관이 등록한 extra 요구 정보들을 불러오기 + // const [extraData, setextraData] = useState(null); + const [extraData] = useState('담당 교수님 성함, 사용 인원'); + // useEffect(() => { + // // 데이터를 가져오는 함수 정의 + // const fetchData = async () => { + // try { + // // API생성되면 department id 받아서 그 id를 가지고 해당 dept/id로 호출해서 정보 받아오기 + // const response = await axios.get(`${BASE_URL}/dept/deptId/1`); + // setextraData(response.data.extraInfo); // 데이터 설정 + // console.log(response.data.extraInfo); + // } catch (error) { + // console.log("error"); + // } + // }; + + // fetchData(); // 데이터 가져오기 함수 호출 + // }, []); + const [inputFields, setInputFields] = useState([]); + const [words, setWords] = useState([]); + useEffect(() => { + if (extraData) { + const word = extraData.split(','); + const initialFields = word.map(() => ({ value: '' })); + setInputFields(initialFields); + setWords(word); + } + }, [extraData, words]); + const startTimeAsDate = new Date(`1970-01-01T${selectedData.startTime}`); + const endTimeAsDate = new Date(`1970-01-01T${selectedData.endTime}`); + return ( +
{selectedData.spaceName} 공간 대여하기 - - - 선택한 정보 - - - 요일 : {selectedData.week} - - - - - - 목적 * - - {inputFields.map((field, index) => ( -
- {words[index]} * - -
- ))} -
- - - - -
+ + + + 선택한 정보 + + + + + {' '} + 요일 : {selectedData.week} + + + + + + + 목적 * + + {inputFields.map((field, index) => ( +
+ {words[index]} * + +
+ ))} +
+ + + + +
+
-
- setIsSuccessDialogOpen(false)} /> -
- ); -} \ No newline at end of file + setIsSuccessDialogOpen(false)} + /> +
+ ); +} diff --git a/src/sections/reserve/reserve-regularly-form1.tsx b/src/sections/reserve/reserve-regularly-form1.tsx index df842ac..f67ff2e 100644 --- a/src/sections/reserve/reserve-regularly-form1.tsx +++ b/src/sections/reserve/reserve-regularly-form1.tsx @@ -3,40 +3,21 @@ import { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; // @mui import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; import { DesktopTimePicker } from '@mui/x-date-pickers'; import { DemoContainer } from '@mui/x-date-pickers/internals/demo'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import Typography from '@mui/material/Typography'; import { DatePicker } from '@mui/x-date-pickers/DatePicker'; -import FormControl from '@mui/material/FormControl'; -import Select, { SelectChangeEvent } from '@mui/material/Select'; import Fab from '@mui/material/Fab'; import AddIcon from '@mui/icons-material/Add'; import MinusIcon from '@mui/icons-material/Remove'; // hooks // import { useBoolean } from 'src/hooks/use-boolean'; // components -import { useSettingsContext } from 'src/components/settings'; import { useForm } from 'react-hook-form'; -import FormProvider, { - RHFEditor, - RHFSelect, - RHFUpload, - RHFSwitch, - RHFSlider, - RHFCheckbox, - RHFTextField, - RHFRadioGroup, - RHFMultiSelect, - RHFAutocomplete, - RHFMultiCheckbox, -} from 'src/components/hook-form'; +import FormProvider from 'src/components/hook-form'; import dayjs, { Dayjs } from 'dayjs'; -// api -import { GetSpace } from 'src/api/spaceApi'; -import { useQuery } from 'react-query'; import RowRadioButtonsGroup from './reserve-radio'; const DayButton = styled.button` @@ -74,14 +55,14 @@ export default function ReserveRegularyForm1({ defaultValues, }); - const { - // watch, - // reset, - // control, - setValue, - // handleSubmit, - formState: { isSubmitting }, - } = methods; + // const { + // // watch, + // // reset, + // // control, + // // setValue, + // // handleSubmit, + // formState: { isSubmitting }, + // } = methods; const [startDate, setstartDate] = useState(dayjs()); const [endDate, setendDate] = useState(dayjs()); diff --git a/src/sections/reserve/reserve-regularly-space.tsx b/src/sections/reserve/reserve-regularly-space.tsx index 91456ff..2528432 100644 --- a/src/sections/reserve/reserve-regularly-space.tsx +++ b/src/sections/reserve/reserve-regularly-space.tsx @@ -1,20 +1,12 @@ // @mui -import Box from '@mui/material/Box'; -import Link from '@mui/material/Link'; import Stack from '@mui/material/Stack'; -import MenuItem from '@mui/material/MenuItem'; -import IconButton from '@mui/material/IconButton'; -import ListItemText from '@mui/material/ListItemText'; -import Card from '@mui/material/Card'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; // types -import { ISpaceItem, EXSpaceItem } from 'src/types/space'; +import { EXSpaceItem } from 'src/types/space'; // components -import { usePopover } from 'src/components/custom-popover'; import Image from 'src/components/image'; -import styled from 'styled-components'; -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; // api import SpacingGrid from './reserve-time'; @@ -39,14 +31,14 @@ export default function RegularlySpaceCardList({ space, selectedData, handleModa }, [selectedData]); const { - id, - name, - headCount, - availableStart, - availableEnd, + // id, + // name, + // headCount, + // availableStart, + // availableEnd, detail, // lableColor, - availability, + // availability, image, // regDate, // modDate, diff --git a/src/sections/reserve/reserve-time.tsx b/src/sections/reserve/reserve-time.tsx index 1ae5b71..c426bc8 100644 --- a/src/sections/reserve/reserve-time.tsx +++ b/src/sections/reserve/reserve-time.tsx @@ -1,5 +1,5 @@ import { useTheme } from '@mui/material'; -import React, { useState } from 'react'; +import { useState } from 'react'; import styled, { ThemeProvider } from 'styled-components'; import { palette as themePalette } from 'src/theme/palette'; diff --git a/src/sections/reserve/view.tsx b/src/sections/reserve/view.tsx index 2748aaa..5d446e7 100644 --- a/src/sections/reserve/view.tsx +++ b/src/sections/reserve/view.tsx @@ -33,6 +33,7 @@ import RegularlyReserveDialog from './reserve-regularly-dialog'; export default function ReserveView() { const userDeptValue = useRecoilValue(userDeptState); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const [reserveInfo, setReserveInfo] = useState(null); let deptId = 0; @@ -73,7 +74,6 @@ export default function ReserveView() { // }, []); // 더미데이터로 확인 중 - const settings = useSettingsContext(); const [selectedDailyData1, setSelectedDailyData1] = useState({ reserveDate: new Date(), diff --git a/src/sections/user/user-quick-edit-form.tsx b/src/sections/user/user-quick-edit-form.tsx index 856591f..d2e12f4 100644 --- a/src/sections/user/user-quick-edit-form.tsx +++ b/src/sections/user/user-quick-edit-form.tsx @@ -18,7 +18,6 @@ import { IUserItem } from 'src/types/user'; // components import { useSnackbar } from 'src/components/snackbar'; import FormProvider, { RHFSelect } from 'src/components/hook-form'; -import axiosInstance, { endpoints } from 'src/utils/axios'; // ---------------------------------------------------------------------- diff --git a/src/sections/user/view/user-list-view.tsx b/src/sections/user/view/user-list-view.tsx index 683cf4c..e35317a 100644 --- a/src/sections/user/view/user-list-view.tsx +++ b/src/sections/user/view/user-list-view.tsx @@ -19,7 +19,6 @@ import { USER_ROLE_OPTIONS } from 'src/_mock'; import { useBoolean } from 'src/hooks/use-boolean'; // components import Label from 'src/components/label'; -import Iconify from 'src/components/iconify'; import Scrollbar from 'src/components/scrollbar'; import { useSettingsContext } from 'src/components/settings'; import { @@ -35,8 +34,6 @@ import { // types import { IUserItem, IUserTableFilters, IUserTableFilterValue } from 'src/types/user'; // -// import { useQuery } from 'react-query'; -// import { GetUser } from 'src/api/userApi'; import { Button, Typography } from '@mui/material'; import { useQuery } from 'react-query'; import { useRecoilValue } from 'recoil'; diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 7e6d1f4..fb43177 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -36,13 +36,11 @@ export const fetcher = async (args: string | [string, AxiosRequestConfig]) => { // ---------------------------------------------------------------------- export const endpoints = { - chat: '/api/chat', - kanban: '/api/kanban', calendar: '/api/calendar', auth: { me: '/api/auth/me', login: '/hanSpace/login', - register: '/api/auth/register', + register: '/hanSpace/member/signup', info: '/hanSpace/info', }, reserve: {