Skip to content

Commit

Permalink
Merge pull request #74 from rktdnjs/develop
Browse files Browse the repository at this point in the history
[9주차] : 9주차 개발 코드 Merge
  • Loading branch information
rktdnjs authored Nov 5, 2023
2 parents b397d90 + 4ad6dd6 commit f2129d9
Show file tree
Hide file tree
Showing 53 changed files with 158 additions and 140 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@hookform/error-message": "^2.0.1",
"@tanstack/react-query": "^4.35.3",
"@tanstack/react-query-devtools": "^4.35.3",
"@testing-library/jest-dom": "^5.17.0",
Expand Down
13 changes: 7 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import MyPage from './pages/MyPage';
import AdminPage from './pages/AdminPage';
import AdminAuthPage from './pages/AdminAuthPage';
import ErrorPage from './pages/ErrorPage';
import ProtectedRoute from './components/templates/ProtectedRoute';
import ProtectedRoute from './components/layout/ProtectedRoute';
import UploadStudentCardPage from './pages/UploadStudentCardPage';
import routes from './constant/routes';

Expand All @@ -27,6 +27,11 @@ function App() {
<Route path={routes.login} element={<LoginPage />} />
<Route path={routes.loginKakao} element={<KakaoOuathPage />} />
<Route path={routes.registerBank} element={<RegisterBankPage />} />
<Route path={routes.post} element={<PostListPage />} />
<Route path={routes.detailPost} element={<PostDetailPage />} />
{/* 아래 각 페이지들에 대해 requiedAuth 추가 필요 */}
<Route path={routes.postWriteIntro} element={<PostWriteIntroPage />} />
<Route path={routes.postWrite} element={<PostWritePage />} />
<Route
path={routes.mypage}
element={
Expand All @@ -36,13 +41,9 @@ function App() {
}
/>
<Route path={routes.uploadStudentCard} element={<UploadStudentCardPage />} />
<Route path={routes.post} element={<PostListPage />} />
<Route path={routes.detailPost} element={<PostDetailPage />} />
<Route path={routes.postWriteIntro} element={<PostWriteIntroPage />} />
<Route path={routes.postWrite} element={<PostWritePage />} />
<Route path={routes.error} element={<ErrorPage />} />
<Route path={routes.admin} element={<AdminPage />} />
<Route path={routes.adminAuth} element={<AdminAuthPage />} />
<Route path={routes.error} element={<ErrorPage />} />
</Routes>
</BrowserRouter>
);
Expand Down
2 changes: 1 addition & 1 deletion src/apis/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const adminAuth = () => {
};

export const adminAuthDetail = (id = 1) => {
return instance.get(`/admin/list/${id}`);
return instance.get(`/admin/auth/list/${id}`);
};

export const adminAuthList = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Time from '../atoms/Time';
import time from '../../utils/time';

/* eslint-disable */
const Info = ({ response }) => {
Expand Down Expand Up @@ -36,7 +36,7 @@ const Info = ({ response }) => {
{/* 마감기한 */}
<div className="my-12">
<div className="text-xl font-bold text-blue py-2">마감기한</div>
<div>{<Time date={finishTime} />}</div>
<div>{time(finishTime)}</div>
</div>
</div>
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../../styles/thumb.css';
import '../../../styles/thumb.css';

const RangeInput = ({ name, register }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cafe from '../../constant/cafe';
import cafe from '../../../constant/cafe';

const SelectInput = ({
register,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { BsArrowLeft } from 'react-icons/bs';
import { MdHome } from 'react-icons/md';
import { Link, useNavigate } from 'react-router-dom';
import routes from '../../constant/routes';
import routes from '../../../constant/routes';

const LoginNav = () => {
const navigate = useNavigate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { BiSolidUser } from 'react-icons/bi';
import logo from '../../assets/images/logo.png';
import routes from '../../constant/routes';
import logo from '../../../assets/images/logo.png';
import routes from '../../../constant/routes';

const Nav = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BsArrowLeft } from 'react-icons/bs';
import { BiSolidUser } from 'react-icons/bi';
import { MdHome } from 'react-icons/md';
import { Link, useNavigate } from 'react-router-dom';
import routes from '../../constant/routes';
import routes from '../../../constant/routes';

const OtherNav = ({ iconColor = '#000', bgColor = 'bg-[#FFF]' }) => {
const navigate = useNavigate();
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/molecules/BankForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import Swal from 'sweetalert2';
import { useMutation } from '@tanstack/react-query';
import Button from '../atoms/Button';
import Button from '../atoms/button/Button';
import banks from '../../constant/bank';
import routes from '../../constant/routes';
import registerBank from '../../apis/register';
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/BtnNavigate.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IoIosArrowBack, IoIosArrowForward } from 'react-icons/io';
import Button from '../atoms/Button';
import Button from '../atoms/button/Button';

const BtnNavigate = ({ handlePrev, handleNext }) => {
const btnWidth = 'w-[8rem]';
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/CircleBtn.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Button from '../atoms/Button';
import Button from '../atoms/button/Button';

const CircleBtn = ({ num, children, active }) => {
const bgColor = active ? 'bg-blue' : 'bg-gray-400';
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/FilterForm.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import FilterBtn from '../atoms/FilterBtn';
import FilterBtn from '../atoms/button/FilterBtn';

const FilterForm = ({ getFilter }) => {
const [filter, setFilter] = useState('All');
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/Labels.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Label from '../atoms/Label';
import SubLabel from '../atoms/SubLabel';
import Label from '../atoms/label/Label';
import SubLabel from '../atoms/label/SubLabel';

const Labels = ({ htmlFor, label, subLabel }) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/AuthRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PiCaretRightLight } from 'react-icons/pi';
const AuthRequest = ({ user }) => {
return (
<div className="h-10 rounded-lg border-gray-300 border-2 my-5">
<Link to={`/admin/auth/${user.userId}`}>
<Link to={`/mypage/admin/auth/${user.userId}`}>
<div className="p-[0.4rem] pl-4 flex items-center justify-between">
{user.nickname}
<PiCaretRightLight size={20} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/PickerTime.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from 'react';
import { useMutation } from '@tanstack/react-query';
import { useParams } from 'react-router-dom';
import { postDetailPicker } from '../../apis/postDetail';
import Button from '../atoms/Button';
import Button from '../atoms/button/Button';

const PickerTime = ({ setPage, setIsMatch }) => {
const { id } = useParams();
Expand Down
8 changes: 4 additions & 4 deletions src/components/templates/MyPageTemplate.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
// import { useQuery } from '@tanstack/react-query';
import OtherNav from '../atoms/OtherNav';
import AdminMyPage from './AdminMyPage';
import GuestMyPage from './GuestMyPage';
import StudentMyPage from './StudentMyPage';
import OtherNav from '../atoms/nav/OtherNav';
import AdminMyPage from './mypage/AdminMyPageTemplate';
import GuestMyPage from './mypage/GuestMyPageTemplate';
import StudentMyPage from './mypage/StudentMyPageTemplate';
import Footer from '../atoms/Footer';
// import { getMyPage } from '../../apis/myPage';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { CiEdit } from 'react-icons/ci';
import { PiCaretRightLight, PiReadCvLogoThin, PiCheckSquareLight } from 'react-icons/pi';
import { RiAdminLine } from 'react-icons/ri';
import { useNavigate } from 'react-router-dom';
import routes from '../../constant/routes';
import routes from '../../../constant/routes';

const AdminMyPage = () => {
const AdminMyPageTemplate = () => {
const navigate = useNavigate();
const navigateAdmin = () => {
return navigate(routes.admin);
Expand Down Expand Up @@ -42,4 +42,4 @@ const AdminMyPage = () => {
);
};

export default AdminMyPage;
export default AdminMyPageTemplate;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CiEdit } from 'react-icons/ci';
import { PiGraduationCapLight, PiCaretRightLight } from 'react-icons/pi';
import { useNavigate } from 'react-router-dom';
import routes from '../../constant/routes';
import routes from '../../../constant/routes';

const GuestMyPage = () => {
const GuestMyPageTemplate = () => {
const navigate = useNavigate();
const uploadStudentIdCard = () => {
return navigate(routes.uploadStudentCard);
Expand Down Expand Up @@ -31,4 +31,4 @@ const GuestMyPage = () => {
);
};

export default GuestMyPage;
export default GuestMyPageTemplate;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CiEdit } from 'react-icons/ci';
import { PiCaretRightLight, PiReadCvLogoThin, PiCheckSquareLight } from 'react-icons/pi';

const StudentMyPage = () => {
const StudentMyPageTemplate = () => {
return (
<div>
<div className="w-full h-1 bg-zinc-200" />
Expand All @@ -26,4 +26,4 @@ const StudentMyPage = () => {
);
};

export default StudentMyPage;
export default StudentMyPageTemplate;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Button from '../atoms/Button';
import OtherNav from '../atoms/OtherNav';
import Info from '../organisms/Info';
import Location from '../organisms/Location';
import Button from '../../atoms/button/Button';
import OtherNav from '../../atoms/nav/OtherNav';
import Info from '../../atoms/Info';
import Location from '../../organisms/Location';

const PickerMatch = ({ response }) => {
const PickerMatchTemplate = ({ response }) => {
return (
<>
{/* 파란색 부분 */}
Expand All @@ -25,4 +25,4 @@ const PickerMatch = ({ response }) => {
);
};

export default PickerMatch;
export default PickerMatchTemplate;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect, useState } from 'react';
import Swal from 'sweetalert2';
import Button from '../atoms/Button';
import OtherNav from '../atoms/OtherNav';
import Info from '../organisms/Info';
import Location from '../organisms/Location';
import '../../styles/DeleteSpin.css';
import PickerTime from '../organisms/PickerTime';
import Button from '../../atoms/button/Button';
import OtherNav from '../../atoms/nav/OtherNav';
import Info from '../../atoms/Info';
import Location from '../../organisms/Location';
import '../../../styles/DeleteSpin.css';
import PickerTime from '../../organisms/PickerTime';

const PickerNoMatch = ({ response }) => {
const PickerNoMatchTemplate = ({ response }) => {
const [page, setPage] = useState(0);
const [isMatch, setIsMatch] = useState(false);

Expand Down Expand Up @@ -66,4 +66,4 @@ const PickerNoMatch = ({ response }) => {
);
};

export default PickerNoMatch;
export default PickerNoMatchTemplate;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import OtherNav from '../atoms/OtherNav';
import Info from '../organisms/Info';
import Location from '../organisms/Location';
import OtherNav from '../../atoms/nav/OtherNav';
import Info from '../../atoms/Info';
import Location from '../../organisms/Location';

const WriterMatch = ({ response }) => {
const WriterMatchTemplate = ({ response }) => {
return (
<>
{/* 파란색 부분 */}
Expand Down Expand Up @@ -36,4 +36,4 @@ const WriterMatch = ({ response }) => {
);
};

export default WriterMatch;
export default WriterMatchTemplate;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BsThreeDotsVertical } from 'react-icons/bs';
import Swal from 'sweetalert2';
import { useNavigate } from 'react-router-dom';
import OtherNav from '../atoms/OtherNav';
import Info from '../organisms/Info';
import Location from '../organisms/Location';
import OtherNav from '../../atoms/nav/OtherNav';
import Info from '../../atoms/Info';
import Location from '../../organisms/Location';

const WriterNoMatch = ({ response }) => {
const WriterNoMatchTemplate = ({ response }) => {
const navigate = useNavigate();

// 삭제 버튼 눌렀을 때
Expand Down Expand Up @@ -64,4 +64,4 @@ const WriterNoMatch = ({ response }) => {
);
};

export default WriterNoMatch;
export default WriterNoMatchTemplate;
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable */
import Labels from '../molecules/Labels';
import Input from '../atoms/Input';
import ErrorMsg from '../atoms/ErrorMsg';
import { ORDER_DEADLINE, HOUR, MINUTE } from '../../constant/postWrite/orderDeadLine';
import validateInputMsg from '../../constant/validateInputMsg';
import Labels from '../../molecules/Labels';
import Input from '../../atoms/input/Input';
import ErrorMsg from '../../atoms/ErrorMsg';
import { ORDER_DEADLINE, HOUR, MINUTE } from '../../../constant/postWrite/orderDeadLine';
import validateInputMsg from '../../../constant/validateInputMsg';
import { useFormContext } from 'react-hook-form';

const OrderDeadLine = () => {
const OrderDeadLineTemplate = () => {
const {
register,
handleSubmit,
Expand Down Expand Up @@ -45,4 +45,4 @@ const OrderDeadLine = () => {
);
};

export default OrderDeadLine;
export default OrderDeadLineTemplate;
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*eslint-disable*/
import { useFieldArray, useFormContext } from 'react-hook-form';
import Labels from '../molecules/Labels';
import SelectInput from '../atoms/SelectInput';
import Input from '../atoms/Input';
import ErrorMsg from '../atoms/ErrorMsg';
import PlusBtn from '../atoms/PlusBtn';
import MinusBtn from '../atoms/MinusBtn';
import { ORDER_INFO_STORE, ORDER_INFO_BEVERAGE, STORE, BEVERAGE } from '../../constant/postWrite/orderInfo';
import validateInputMsg from '../../constant/validateInputMsg';
import Labels from '../../molecules/Labels';
import SelectInput from '../../atoms/input/SelectInput';
import Input from '../../atoms/input/Input';
import ErrorMsg from '../../atoms/ErrorMsg';
import PlusBtn from '../../atoms/button/PlusBtn';
import MinusBtn from '../../atoms/button/MinusBtn';
import { ORDER_INFO_STORE, ORDER_INFO_BEVERAGE, STORE, BEVERAGE } from '../../../constant/postWrite/orderInfo';
import validateInputMsg from '../../../constant/validateInputMsg';

const OrderInfo = () => {
const OrderInfoTemplate = () => {
const {
register,
formState: { errors },
Expand Down Expand Up @@ -69,4 +69,4 @@ const OrderInfo = () => {
);
};

export default OrderInfo;
export default OrderInfoTemplate;
Loading

0 comments on commit f2129d9

Please sign in to comment.