diff --git a/src/components/common/board/TableBoard.tsx b/src/components/common/board/TableBoard.tsx index d84823fb..6d77901b 100644 --- a/src/components/common/board/TableBoard.tsx +++ b/src/components/common/board/TableBoard.tsx @@ -46,7 +46,7 @@ const Table = styled.table` tbody { tr { td { - padding: 22px 10px; + padding: 19px 10px; text-align: center; vertical-align: middle; color: #9e9e9e; diff --git a/src/pages/mypage/adopt.tsx b/src/pages/mypage/adopt.tsx deleted file mode 100644 index 18ed8596..00000000 --- a/src/pages/mypage/adopt.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import MypageLayout from 'layout/MypageLayout'; - -export default function Adopt() { - return ADOPT; -} diff --git a/src/pages/mypage/adopt/Breeder.tsx b/src/pages/mypage/adopt/Breeder.tsx new file mode 100644 index 00000000..f9d2f7d6 --- /dev/null +++ b/src/pages/mypage/adopt/Breeder.tsx @@ -0,0 +1,99 @@ +import TableBoard from 'components/common/board/TableBoard'; +import { styled } from 'styled-components'; + +interface ListProps { + matchingId: number; + adopterNickname: string; + submitDate: string; + nameAndBreed: string; + isProcessed: boolean; +} + +const TableWrapper = styled.div` + min-height: 500px; + table { + .matching-id { + width: 95px; + } + .adopter-nickname, + .submit-date, + .is-processed { + width: 175px; + } + .name-and-breed { + width: 205px; + } + .application-detail { + width: 109px; + } + } +`; +const BreederBoard = () => { + const listCategory = [ + { uid: 'matching-id', name: 'No' }, + { uid: 'adopter-nickname', name: '분양희망자' }, + { uid: 'submit-date', name: '제출 날짜' }, + { uid: 'name-and-breed', name: '강아지 이름 (견종명)' }, + { uid: 'is-processed', name: '분양상태' }, + { uid: 'application-detail', name: '신청내역' }, + ]; + const list: ListProps[] = [ + { + matchingId: 1, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + { + matchingId: 2, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + { + matchingId: 3, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + { + matchingId: 4, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: false, + }, + { + matchingId: 5, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + ]; + return ( + + + {list?.map(({ matchingId, adopterNickname, submitDate, nameAndBreed, isProcessed }) => { + return ( + + {matchingId} + {adopterNickname} + {submitDate} + {nameAndBreed} + {isProcessed ? '분양승인' : '분양거절'} + + + + + ); + })} + + + ); +}; + +export default BreederBoard; diff --git a/src/pages/mypage/adopt/User.tsx b/src/pages/mypage/adopt/User.tsx new file mode 100644 index 00000000..126c40ab --- /dev/null +++ b/src/pages/mypage/adopt/User.tsx @@ -0,0 +1,99 @@ +import TableBoard from 'components/common/board/TableBoard'; +import { styled } from 'styled-components'; + +interface ListProps { + matchingId: number; + adopterNickname: string; + submitDate: string; + nameAndBreed: string; + isProcessed: boolean; +} + +const TableWrapper = styled.div` + min-height: 500px; + table { + .matching-id { + width: 95px; + } + .adopter-nickname, + .submit-date, + .is-processed { + width: 175px; + } + .name-and-breed { + width: 205px; + } + .application-detail { + width: 109px; + } + tbody tr { + height: 136px; + } + } +`; + +const UserBoard = () => { + const listCategory = [ + { uid: 'matching-id', name: 'No' }, + { uid: 'breeder-nickname', name: '브리더' }, + { uid: 'submit-date', name: '제출 날짜' }, + { uid: 'name-and-breed', name: '강아지 이름 (견종명)' }, + { uid: 'application-detail', name: '신청내역' }, + { uid: 'is-processed', name: '분양상태' }, + ]; + + const list: ListProps[] = [ + { + matchingId: 1, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + { + matchingId: 2, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: true, + }, + { + matchingId: 3, + adopterNickname: '수현', + submitDate: 'YYYY-MM-DD', + nameAndBreed: '초코(말티즈)', + isProcessed: false, + }, + ]; + return ( + + + {list?.map(({ matchingId, adopterNickname, submitDate, nameAndBreed, isProcessed }) => { + return ( + + {matchingId} + {adopterNickname} + {submitDate} + {nameAndBreed} + + + + + {isProcessed ? ( + <> + 분양 승인 + + + ) : ( + '분양거절' + )} + + + ); + })} + + + ); +}; + +export default UserBoard; diff --git a/src/pages/mypage/adopt/index.tsx b/src/pages/mypage/adopt/index.tsx new file mode 100644 index 00000000..ef2c91ad --- /dev/null +++ b/src/pages/mypage/adopt/index.tsx @@ -0,0 +1,79 @@ +import { useJwtInfo } from 'hooks/useJwtInfo'; +import SelectOption from 'components/common/select/SelectOption'; +import SearchInput from 'components/common/search/SearchInput'; +import MypageLayout from 'layout/MypageLayout'; +import MypageForm from 'layout/MypageForm'; +import { useState } from 'react'; +import Pagination from 'components/common/board/Pagination'; +import BreederBoard from './Breeder'; +import UserBoard from './User'; +import { styled } from 'styled-components'; +import { Page } from 'pageable-response'; + +const AdoptWrapper = styled.section` + .container { + min-height: 58rem; + } +`; + +export default function Adopt() { + const [page, setPage] = useState(0); + const [pageInfo, setPageInfo] = useState({ + totalPages: 0, + first: false, + last: false, + number: 0, + }); + const { role } = useJwtInfo(); + const [selectedOption, setSelectedOption] = useState(undefined); + const searchOptions = [ + { value: 'all', label: '전체' }, + { value: 'breed', label: '견종' }, + { value: 'name', label: '강아지 이름' }, + ]; + + const onSearch = async (keyword: string) => { + // keyword로 찾기 api 쓰겠쥬 + }; + // {role === 'BREEDER' ? : } + return ( + + + + {role === 'BREEDER' ? '분양신청내역' : '신청내역'} + + + { + onSearch(value); + }} + /> + + {role === 'BREEDER' ? : } + + setPage(page)} + /> + + + + + ); +}