Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

농가거래 서비스 배포 #294

Merged
merged 41 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1ccd5ef
feat: 주소 찾기 모달 닫는 기능 추가
sangminlee98 Apr 22, 2024
b6d69d0
rename: 문서 이미지 이름 변경 ( 피그마 문서 이미지 순서 고려 )
JunJongHun May 20, 2024
e54869a
feat: 문서 이미지에 캡션 적용
JunJongHun May 20, 2024
e22197c
rename: 중개 프로세스 문서 이미지 크기 통일화 된 사이즈로 업데이트
JunJongHun May 20, 2024
305b67a
design: 캡션 css 적용
JunJongHun May 20, 2024
e847776
fix: swiper 버전 업데이트 및 커스텀훅 분리
sangminlee98 Jul 15, 2024
e3fd571
fix: refresh 토큰 만료 시 사용자에게 Alert를 보여주지 않도록 catch문 수정
sangminlee98 Jul 15, 2024
d466f33
design: 키워드 변경 (빈집거래 -> 농가거래)
JunJongHun Aug 18, 2024
2fef03f
feat: 농가 거래 페이지 검색 필터에서 새로운 유형 타입 추가 & 기존 유형 타입을 거래 타입으로 변경
sangminlee98 Aug 18, 2024
0f33cf9
Merge pull request #282 from ODOICHON/design/#280
JunJongHun Aug 18, 2024
bc1def8
Merge pull request #283 from ODOICHON/feat/#281
JunJongHun Aug 18, 2024
9abe015
refact: 키워드 변경
JunJongHun Aug 18, 2024
7c9d060
feat: 일반회원 등록 페이지 수정
JunJongHun Aug 18, 2024
381b86b
feat: 농가 거래 상세 페이지 유형 정보 추가
sangminlee98 Aug 18, 2024
b97e007
feat: 농가 거래 게시글 제목 유형 말머리 추가
sangminlee98 Aug 18, 2024
fb41927
feat: 공인중개사 필수 항목 체크 표시
JunJongHun Aug 18, 2024
d8a5873
refact: 필수 사항/선택 사항 체크 함수 수정
JunJongHun Aug 18, 2024
af53966
refact: 사용하지 않는 변수 삭제
JunJongHun Aug 18, 2024
0c3cefc
Merge pull request #287 from ODOICHON/feat/#284
JunJongHun Aug 18, 2024
f927416
feat: 매물 말머리 대괄호 추가
sangminlee98 Aug 18, 2024
0f46d9c
Merge branch 'develop' of https://github.com/ODOICHON/frontend into f…
sangminlee98 Aug 18, 2024
011d6e4
Merge pull request #286 from ODOICHON/feat/#285
JunJongHun Aug 18, 2024
c82b4f7
feat: 공인중개사 상세 설명 타입 추가
sangminlee98 Aug 18, 2024
c2a1894
Merge pull request #289 from ODOICHON/feat/#288
JunJongHun Aug 18, 2024
11885a7
feat: 공인중개사 일 때, 상세 설명 목록 추가
JunJongHun Aug 18, 2024
d6e81eb
feat: 게시글 유효성 검사 함수에 상세 설명 필수 여부 확인 로직 추가
JunJongHun Aug 18, 2024
6e70130
feat: 농가 거래 상세 페이지 UI 수정
sangminlee98 Aug 18, 2024
ce5f366
Merge pull request #292 from ODOICHON/feat/#291
sangminlee98 Aug 18, 2024
6ee9081
Merge pull request #293 from ODOICHON/feat/#290
sangminlee98 Aug 18, 2024
ec7915d
Merge branch 'develop' of https://github.com/ODOICHON/frontend into f…
sangminlee98 Aug 18, 2024
8362cdc
Merge branch 'develop' of https://github.com/ODOICHON/frontend into d…
JunJongHun Aug 18, 2024
8271039
Merge branch 'develop' of https://github.com/ODOICHON/frontend into f…
sangminlee98 Aug 18, 2024
9a33361
Merge branch 'develop' of https://github.com/ODOICHON/frontend into f…
sangminlee98 Aug 18, 2024
2e3df7a
Merge pull request #279 from ODOICHON/fix/#278
sangminlee98 Aug 18, 2024
fa6635e
Merge pull request #272 from ODOICHON/design/#271
JunJongHun Aug 18, 2024
a232eff
Merge pull request #277 from ODOICHON/fix/#254
JunJongHun Aug 18, 2024
dbb7deb
Merge pull request #258 from ODOICHON/feat/#257
JunJongHun Aug 18, 2024
b1b1dfb
fix: houseType props 추가
sangminlee98 Aug 19, 2024
b92b2a7
Merge pull request #296 from ODOICHON/fix/#295
JunJongHun Aug 20, 2024
1654969
fix: deploy.yml 수정
sangminlee98 Aug 20, 2024
86dcefd
Merge pull request #298 from ODOICHON/fix/#297
JunJongHun Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
if: contains(github.ref, 'develop')
run: |
aws deploy create-deployment \
--application-name duaily-dev-deploy \
--application-name ${{ secrets.DEPLOY_APPLICATION_NAME_DEV }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ secrets.DEPLOY_GROUP_DEV }} \
--s3-location bucket=${{ secrets.S3_BUCKET_NAME_DEV }},bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip
Expand All @@ -96,7 +96,7 @@ jobs:
if: contains(github.ref, 'main')
run: |
aws deploy create-deployment \
--application-name duaily-deploy \
--application-name ${{ secrets.DEPLOY_APPLICATION_NAME }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ secrets.DEPLOY_GROUP }} \
--s3-location bucket=${{ secrets.S3_BUCKET_NAME }},bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"react-quill": "^2.0.0",
"react-router-dom": "^6.8.1",
"sass": "^1.58.1",
"swiper": "^9.0.5",
"swiper": "^11.1.4",
"uuid": "^9.0.0",
"vite": "^4.1.0",
"vite-tsconfig-paths": "^4.0.5",
Expand Down
9 changes: 3 additions & 6 deletions src/apis/reissue.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import axios, { AxiosError } from 'axios';
import {
ApiResponseType,
ApiResponseWithDataType,
} from '@/types/apiResponseType';
import axios from 'axios';
import { ApiResponseWithDataType } from '@/types/apiResponseType';

export const reissue = async () => {
try {
Expand All @@ -16,6 +13,6 @@ export const reissue = async () => {
);
return data;
} catch (err) {
alert((err as AxiosError<ApiResponseType>).response?.data.message);
console.error(err);
}
};
Binary file added src/assets/trade/example1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/trade/example1.png
Binary file not shown.
Binary file added src/assets/trade/example2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/trade/example2.png
Binary file not shown.
Binary file added src/assets/trade/example3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/trade/example3.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/Common/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function Footer() {
);
}}
>
빈집거래 서비스 관련
농가거래 서비스 관련
</button>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function DesktopNavbar({
오도이촌 소개
</Link>
<Link className={isFocus('trade')} ref={tradeRef} to="/trade">
빈집거래
농가거래
</Link>
<Link
className={isFocus('community')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/ToggleMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function ToggleMenu() {
alt="close"
/>
<Link to="/introduce">오도이촌 소개</Link>
<Link to="/trade">빈집거래</Link>
<Link to="/trade">농가거래</Link>
<Link to="/community/free_board">커뮤니티</Link>
{token ? <AfterLogin /> : <BeforeLogin />}
</div>
Expand Down
15 changes: 13 additions & 2 deletions src/components/Trade/AddressModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useRef } from 'react';
import DaumPostcodeEmbed, { Address } from 'react-daum-postcode';
import styles from './styles.module.scss';

Expand All @@ -8,6 +8,7 @@ type AddressModalProps = {
};

function AddressModal({ callback, setIsPostcodeOpen }: AddressModalProps) {
const modalRef = useRef<HTMLDivElement>(null);
const handleComplete = (data: Address) => {
let fullAddress = data.address;
let extraAddress = '';
Expand All @@ -25,9 +26,19 @@ function AddressModal({ callback, setIsPostcodeOpen }: AddressModalProps) {
callback(fullAddress, data.zonecode);
setIsPostcodeOpen((pre) => !pre);
};
useEffect(() => {
const handleCloseModal = (e: Event | React.MouseEvent) => {
if (!modalRef.current || !modalRef.current!.contains(e.target as Node))
setIsPostcodeOpen(false);
};
window.addEventListener('mousedown', handleCloseModal);
return () => {
window.removeEventListener('mousedown', handleCloseModal);
};
}, [modalRef]);
return (
<div className={styles.background}>
<section className={styles.container}>
<section ref={modalRef} className={styles.container}>
<DaumPostcodeEmbed onComplete={handleComplete} autoClose={false} />
</section>
</div>
Expand Down
7 changes: 5 additions & 2 deletions src/components/Trade/Board/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import dayjs from 'dayjs';
import { RentalType, TradeBoardType } from '@/types/Board/tradeType';
import { convertRentalTypeName, priceCount } from '@/utils/utils';
import { convertRentalTypeName, getHouseName, priceCount } from '@/utils/utils';
import styles from './styles.module.scss';

type TradeBoardProps = Omit<TradeBoardType, 'recommendedTag'>;

export default function TradeBoard({
houseId,
houseType,
rentalType,
city,
price,
Expand Down Expand Up @@ -97,7 +98,9 @@ export default function TradeBoard({
)}
</div>
<div className={styles.contentsWrapper}>
<h1>{title}</h1>
<h1>
[{getHouseName(houseType)}] {title}
</h1>
<p>
<strong>위치</strong> : {city}
</p>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Trade/Dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { motion } from 'framer-motion';
import { MenuType } from '@/types/Board/tradeType';
import { TradeCategoryType, TradeCityType } from '@/constants/trade';
import {
TradeCategoryType,
TradeCityType,
TradeHouseType,
} from '@/constants/trade';
import { tradeDropdownVariants } from '@/constants/variants';
import styles from './styles.module.scss';

type DropdownProps = {
menu: TradeCategoryType[] | TradeCityType[];
menu: TradeHouseType[] | TradeCategoryType[] | TradeCityType[];
setMenu: React.Dispatch<React.SetStateAction<string>>;
setSelectedMenu: React.Dispatch<React.SetStateAction<MenuType>>;
};
Expand Down
38 changes: 15 additions & 23 deletions src/components/Trade/Info/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import { TradeBoardDetailType } from '@/types/Board/tradeType';
import { getRentalName } from '@/utils/utils';
import { getHouseName, getRentalName, priceCount } from '@/utils/utils';
import styles from './styles.module.scss';

// TODO: undefined 처리하기
Expand All @@ -12,43 +12,35 @@ function TradeBoardInfo({ info }: TradeBoardInfoProps) {
return (
<section className={styles.infoContainer}>
<article>
<span>기본정보</span>
<span>임대정보 및 판매자 정보</span>
<div>
유형 <p>{info?.houseType && getHouseName(info?.houseType)}</p>
</div>
<div>
위치 <p>{info?.city}</p>
</div>
<div>
면적{' '}
가격{' '}
<p>
{info?.size}m<sup>2</sup>
{info?.rentalType && getRentalName(info?.rentalType)}{' '}
{info?.price && priceCount(info?.price)}
</p>
</div>
<div>
용도 <p>{info?.purpose}</p>
</div>
<div>
준공연도 <p>{dayjs(info?.createdDate).format('YYYY')}년</p>
</div>
<div>
층수 <p>{info?.floorNum === 0 ? '-' : `${info?.floorNum}층`}</p>
전화번호 <p>{info?.contact}</p>
</div>
</article>
<article>
<span>임대정보 및 판매자 정보</span>
<span>기본정보</span>
<div>
가격{' '}
<p>
{info?.rentalType && getRentalName(info?.rentalType)} {info?.price}
만원
</p>
면적 <p>{info?.size}㎡</p>
</div>
<div>
전화번호 <p>{info?.contact}</p>
준공연도 <p>{dayjs(info?.createdDate).format('YYYY')}년</p>
</div>
<div>
용도 <p>{info?.purpose}</p>
</div>
{info?.userType === 'AGENT' && (
<div>
공인중개사명 <p>{info?.agentName !== '' ? info?.agentName : 'X'}</p>
</div>
)}
</article>
</section>
);
Expand Down
46 changes: 40 additions & 6 deletions src/components/Trade/SearchBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { useEffect, useRef, useState } from 'react';
import { GoTriangleDown } from 'react-icons/go';
import { AnimatePresence } from 'framer-motion';
import { MenuType, RentalType } from '@/types/Board/tradeType';
import { convertRentalTypeName } from '@/utils/utils';
import { tradeCategory, tradeCity } from '@/constants/trade';
import { HouseType, MenuType, RentalType } from '@/types/Board/tradeType';
import { convertHouseTypeName, convertRentalTypeName } from '@/utils/utils';
import { houseCategory, tradeCategory, tradeCity } from '@/constants/trade';
import styles from './styles.module.scss';
import Dropdown from '../Dropdown';

type SearchBarProps = {
houseType: string;
rentalType: string;
city: string;
search: string;
setHouseType: React.Dispatch<React.SetStateAction<string>>;
setRentalType: React.Dispatch<React.SetStateAction<string>>;
setCity: React.Dispatch<React.SetStateAction<string>>;
setSearch: React.Dispatch<React.SetStateAction<string>>;
Expand All @@ -19,9 +21,11 @@ type SearchBarProps = {
};

export default function SearchBar({
houseType,
rentalType,
city,
search,
setHouseType,
setRentalType,
setCity,
setSearch,
Expand Down Expand Up @@ -60,8 +64,38 @@ export default function SearchBar({
<section
ref={dropdownRef}
className={styles.selectItem}
style={{ flexGrow: '2' }}
style={{ flexGrow: '1' }}
>
<span
role="presentation"
className={
selectedMenu === 'houseType'
? styles.selectedSearchItem
: styles.searchItem
}
onClick={() => setSelectedMenu('houseType')}
>
<div>
<p style={{ color: houseType !== '' ? 'black' : '' }}>
{houseType === ''
? '유형'
: convertHouseTypeName(houseType as HouseType)}
</p>
<GoTriangleDown color="#d9d9d9" size="1.25rem" />
</div>
<AnimatePresence>
{selectedMenu === 'houseType' && (
<Dropdown
menu={houseCategory}
setMenu={setHouseType}
setSelectedMenu={setSelectedMenu}
/>
)}
</AnimatePresence>
</span>

<div className={styles.divider} />

<span
role="presentation"
className={
Expand All @@ -74,7 +108,7 @@ export default function SearchBar({
<div>
<p style={{ color: rentalType !== '' ? 'black' : '' }}>
{rentalType === ''
? '유형'
? '거래'
: convertRentalTypeName(rentalType as RentalType)}
</p>
<GoTriangleDown color="#d9d9d9" size="1.25rem" />
Expand Down Expand Up @@ -126,7 +160,7 @@ export default function SearchBar({
? styles.selectedSearchItem
: styles.searchItem
}
style={{ flexGrow: '3' }}
style={{ flexGrow: '1' }}
onClick={() => setSelectedMenu('search')}
>
<form onSubmit={handleSubmit}>
Expand Down
18 changes: 17 additions & 1 deletion src/constants/trade.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import { RecommendedTagType, RentalType } from '@/types/Board/tradeType';
import {
HouseType,
RecommendedTagType,
RentalType,
} from '@/types/Board/tradeType';

export type TradeCategoryType = {
content: string;
type: RentalType | '';
};

export type TradeHouseType = {
content: string;
type: HouseType | '';
};

export const houseCategory: TradeHouseType[] = [
{ content: '전체', type: '' },
{ content: '토지', type: 'LAND' },
{ content: '주택', type: 'HOUSE' },
{ content: '농가', type: 'FARM_HOUSE' },
];

export const tradeCategory: TradeCategoryType[] = [
{ content: '전체', type: '' },
{ content: '매매', type: 'SALE' },
Expand Down
14 changes: 14 additions & 0 deletions src/hooks/useSwiperRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useState, useRef, useEffect } from 'react';

const useSwiperRef = <T extends HTMLElement>() => {
const [wrapper, setWrapper] = useState<T | null>(null);
const ref = useRef<T>(null);

useEffect(() => {
setWrapper(ref.current);
}, []);

return [wrapper, ref] as const;
};

export default useSwiperRef;
2 changes: 1 addition & 1 deletion src/pages/Introduce/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { motion } from 'framer-motion';
import { Scrollbar } from 'swiper';
import { Scrollbar } from 'swiper/modules';
import { Swiper, SwiperSlide } from 'swiper/react';
import ReviewBoard from '@/components/Introduce/ReviewBoard';
import TrendBoard from '@/components/Introduce/TrendBoard';
Expand Down
Loading
Loading