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

Hotfix/#74/minha #76

Merged
merged 24 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
af63553
fix: 상단 갈래 소개 라우팅 오류 수정
AAminha Nov 22, 2023
59ccc62
fix: 상단 바 드롭다운 메뉴명 수정
AAminha Nov 22, 2023
3d22d6e
fix: 공고 등록 및 임시저장 alert창 띄우기
AAminha Nov 22, 2023
4f6dedd
fix: 공고 등록 alertMessage 수정
AAminha Nov 22, 2023
0d55cc8
fix: 큰 svg 아이콘을 png로 변경
AAminha Nov 22, 2023
2ec444d
fix: CardItem에서 텍스트 오버랩 수정
AAminha Nov 22, 2023
964046d
design: 로그인 페이지 디자인 수정
AAminha Nov 22, 2023
aac0969
design: 꿀팁 페이지 간격 조절
AAminha Nov 22, 2023
7d6600e
feat: 꿀팁 페이지 내 아이콘 추가
AAminha Nov 22, 2023
81e6864
design: 배경색 설정
AAminha Nov 22, 2023
c40b3cf
fix: 대시보드 제목 넘침 수정
AAminha Nov 22, 2023
ec5cb9e
fix: 꿀팁 버튼 디자인 수정
AAminha Nov 22, 2023
b93e2a4
fix: 메인 메뉴 누르면 페이지 이동하도록 수정
AAminha Nov 22, 2023
8a9fc82
design: 입력창 배경 하얗게 설정
AAminha Nov 22, 2023
2693516
fix: 프로그램 상세 페이지 글자 넘침 수정
AAminha Nov 22, 2023
7d75277
fix: 좋아요 버튼 누른 후 하트 개수 변동
AAminha Nov 22, 2023
1a55dfc
fix: 검색바 필터 너비 조절
AAminha Nov 22, 2023
2518b5b
style: 불필요한 console.log 제거
AAminha Nov 22, 2023
9d00fa5
fix: vercel 에러 수정
AAminha Nov 22, 2023
9bdc124
Merge branch 'main' into hotfix/#74/minha
AAminha Nov 22, 2023
02cfcab
fix: 프로그램 이미지가 깨지면 대체 이미지가 보이도록 수정
AAminha Nov 22, 2023
eb2d465
fix: 숙소 추천 및 여행지 추천 로딩 바 적용
AAminha Nov 23, 2023
aaaa7ff
fix: 공고 등록 및 수정 api 관련 수정
AAminha Nov 23, 2023
6714d93
fix: 지역 필터에 전국 추가
AAminha Nov 23, 2023
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: 1 addition & 3 deletions src/apis/favorite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export const useGetMyFavorite = (filterData: FilterType | null) => {
() => FavoriteAPI.getMyFavorite(filterData),
{
enabled: false,
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand Down
6 changes: 5 additions & 1 deletion src/apis/like/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ export const postLike = async (
type: string,
id: number,
setIsLike: React.Dispatch<React.SetStateAction<boolean>>,
handleLikeCount?: () => void,
) => {
try {
const res = await Axios.post(`/favorite/${type}`, null, {
params: {
[`${type}Id`]: id,
},
});
if (res?.data?.code === 200) setIsLike(prev => !prev);
if (res?.data?.code === 200) {
setIsLike(prev => !prev);
handleLikeCount && handleLikeCount();
}
return;
} catch (e) {
console.error(e);
Expand Down
10 changes: 3 additions & 7 deletions src/apis/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const ManagerAPI = {
'Content-Type': 'multipart/form-data',
},
});
return response.data.result;
return response.data;
},

postEditProgram: async (formData: FormData) => {
Expand All @@ -72,7 +72,7 @@ export const ManagerAPI = {
'Content-Type': 'multipart/form-data',
},
});
return response.data.result;
return response.data;
},

deleteTempProgram: async (id: number) => {
Expand All @@ -94,8 +94,6 @@ export const useFindTempProgram = (id: number | null) => {
() => ManagerAPI.getFindTempProgram(),
{
enabled: id === null,
cacheTime: 500000,
staleTime: 500005,
onSuccess: () => {},
onError: () => {},
},
Expand Down Expand Up @@ -147,9 +145,7 @@ export const useGetExistingProgram = (programId: number) => {
{
cacheTime: 500000,
staleTime: 500005,
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand Down
16 changes: 4 additions & 12 deletions src/apis/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export const useGetProgramDetailInfo = (programId: number) => {
['getProgramDetailInfo', programId],
() => ProgramAPI.getProgramDetailInfo(programId),
{
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand Down Expand Up @@ -87,9 +85,7 @@ export const useGetSimilarRecommend = ({
enabled: writerVersion === null ? false : !writerVersion,
cacheTime: 500000,
staleTime: 500005,
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand All @@ -109,9 +105,7 @@ export const useGetRegionTour = ({
enabled: writerVersion === null ? false : !writerVersion,
cacheTime: 500000,
staleTime: 500005,
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand All @@ -129,9 +123,7 @@ export const useGetRegionLodgment = ({
{
enabled: writerVersion === null ? false : !writerVersion,
staleTime: 500005,
onSuccess: data => {
console.log(data);
},
onSuccess: () => {},
onError: () => {},
},
);
Expand Down
Binary file added src/assets/board/archive-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/board/review-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-honey-tip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions src/components/Button/TranslucentLikeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ interface Props {
id: number;
isLike: boolean;
setIsLike: React.Dispatch<React.SetStateAction<boolean>>;
handleLikeCount: () => void;
}

const TranslucentLikeButton: React.FC<Props> = ({ id, isLike, setIsLike }) => {
const TranslucentLikeButton: React.FC<Props> = ({
id,
isLike,
setIsLike,
handleLikeCount,
}) => {
// Todo: 인자로 id 전달받아서 서버에 찜 목록에 등록하는 API 연결
const handleClick = useCallback(
(e: React.MouseEvent) => {
e.stopPropagation();
postLike('program', id, setIsLike);
postLike('program', id, setIsLike, handleLikeCount);
},
[isLike],
);
Expand Down
12 changes: 7 additions & 5 deletions src/components/Default/DefaultProgram.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import styled from 'styled-components';

const DefaultProgram = () => {
const DefaultProgram = ({ detail }: { detail?: boolean }) => {
return (
<Container>
<div className="text">
<span>이미지가 없어요!</span>
<span>클릭하여 상세내용을 확인해보세요!</span>
</div>
{detail && (
<div className="text">
<span>이미지가 없어요!</span>
<span>클릭하여 상세내용을 확인해보세요!</span>
</div>
)}
</Container>
);
};
Expand Down
11 changes: 9 additions & 2 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ const Header = () => {
>
<img src={Logo} alt="character" />
</LogoWrapper>
{HeaderData.map(({ main, dropDowns }) => (
{HeaderData.map(({ main, mainLink, dropDowns }) => (
<NavBar key={main}>
<H3 $fontColor="#15191D">{main}</H3>
<H3
$fontColor="#15191D"
onClick={() =>
navigate(mainLink, { state: { filter: '전체' } })
}
>
{main}
</H3>
<Dropdown>
{dropDowns.map(({ title, link }, index) => (
<li key={index}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Layout = () => {
return (
<>
<Header />
<Outlet />;
<Outlet />
</>
);
};
Expand Down
38 changes: 35 additions & 3 deletions src/components/ProgramCard/ProgramCardItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,51 @@ import { useEffect, useState } from 'react';
const ProgramCardItem = ({ program }: { program: ProgramMainInfoType }) => {
const navigate = useNavigate();
const [isLike, setIsLike] = useState(false);
const [likeCount, setLikeCount] = useState(program.like);
const [imageError, setImageError] = useState(false);

useEffect(() => {
setIsLike(program.userLikeCheck);
}, [program]);

const handleLikeCount = () => {
if (program.userLikeCheck && likeCount === program.like) {
setLikeCount(likeCount - 1);
} else if (program.userLikeCheck && likeCount < program.like) {
setLikeCount(likeCount + 1);
} else if (!program.userLikeCheck && likeCount === program.like) {
setLikeCount(likeCount + 1);
} else if (!program.userLikeCheck && likeCount > program.like) {
setLikeCount(likeCount - 1);
}
};

const handleImageError = () => {
setImageError(true);
};

return (
<Container
onClick={() =>
navigate(`/detailProgram/${program.programName}/${program.id}`)
}
>
{program.photoUrl === null || program.photoUrl === '' ? (
{program.photoUrl === null || program.photoUrl === '' || imageError ? (
<DefaultProgramPreview />
) : (
<img className="poster" alt="program-poster" src={program.photoUrl} />
<img
className="poster"
alt="program-poster"
src={program.photoUrl}
onError={handleImageError}
/>
)}
<LikeButtonWrapper>
<TranslucentLikeButton
id={program.id}
isLike={isLike}
setIsLike={setIsLike}
handleLikeCount={handleLikeCount}
/>
</LikeButtonWrapper>
<ProgramInfoContainer>
Expand All @@ -49,7 +73,7 @@ const ProgramCardItem = ({ program }: { program: ProgramMainInfoType }) => {
</div>
<div className="favorite-container">
<img alt="favorite-icon" src={FavoriteIcon} />
<B3Bold $fontColor="var(--color_gray600)">{program.like}</B3Bold>
<B3Bold $fontColor="var(--color_gray600)">{likeCount}</B3Bold>
</div>
</ProgramInfoContainer>
</Container>
Expand All @@ -71,12 +95,20 @@ const Container = styled.div`
`;

const ProgramInfoContainer = styled.div`
width: inherit;
display: flex;
flex-direction: column;
align-items: start;
padding-top: 16px;
gap: 4px;

${H3} {
width: inherit;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.hashTag-container {
display: flex;
flex-direction: row;
Expand Down
11 changes: 9 additions & 2 deletions src/components/RecommendCard/RecommendCardItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const RecommendCardItem = ({ result }: { result: RecommendDataType }) => {
return (
<Container>
<img className="image" alt="image" src={result.photoUrl} />

<CardInfoContainer>
<H3 $fontColor="var(--color_gray900)">{result.title}</H3>
</CardInfoContainer>
Expand All @@ -24,7 +23,7 @@ const Container = styled.div`
width: 323px;
height: 323px;
border-radius: 20px;
//object-fit: cover;
object-fit: cover;
}
`;

Expand All @@ -34,6 +33,14 @@ const CardInfoContainer = styled.div`
align-items: start;
padding-top: 16px;
gap: 4px;
width: inherit;

${H3} {
width: inherit;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
`;

export default RecommendCardItem;
3 changes: 2 additions & 1 deletion src/constants/Register/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const DEFAULT_REQUIRED_CONTENT: ProgramRegisterInfoType = {
};

export const LOCATION_LIST = [
'전국',
'서울',
'인천',
'대전',
Expand Down Expand Up @@ -80,7 +81,7 @@ export const INPUT_FIELD: ProgramRegisterFieldType = {
contact: {
title: '문의처',
placeholder: '문의처명을 입력해주세요.',
alertMessage: '문의처명을 입력해주세요.',
alertMessage: '문의처을 입력해주세요.',
},
contactPhone: {
title: '',
Expand Down
12 changes: 6 additions & 6 deletions src/constants/Search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@ export const FILTER_LIST: FilterListType[] = [
{
title: '정렬',
enTitle: 'orderCriteria',
buttonSize: 'small',
buttonSize: 'xs',
calendar: false,
items: ['최신순', '인기순', '빠른 마감 순', '늦은 마감 순'],
},
{
title: '지역',
enTitle: 'location',
buttonSize: 'small',
buttonSize: 's',
calendar: false,
items: LOCATION_LIST,
},
{
title: '여행 프로그램',
enTitle: 'programType',
buttonSize: 'large',
buttonSize: 'm',
calendar: false,
items: ['전체', '여행 지원사업', '여행 공모전', '여행 대외활동'],
},
{
title: '세부 카테고리',
enTitle: 'detailType',
buttonSize: 'medium',
buttonSize: 'm',
calendar: false,
items: [],
},
{
title: '모집 기간',
enTitle: 'recruitDate',
buttonSize: 'medium',
buttonSize: 'l',
calendar: true,
items: [],
},
{
title: '여행 기간',
enTitle: 'activeDate',
buttonSize: 'medium',
buttonSize: 'l',
calendar: true,
items: [],
},
Expand Down
4 changes: 4 additions & 0 deletions src/pages/DetailPosting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const Container = styled.div`

width: 1440px;
margin: 229px auto 0;

body:not(&) {
background-color: white;
}
`;

const Title = styled.pre`
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DetailProgram/HoneyTipButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import HoneyTipIcon from '@/assets/icons/honey_tip_icon.png';
import HoneyTipIcon from '@/assets/icons/icon-honey-tip.png';
import RoundedButton from '@/components/Button/RoundedButton';
import { HiOutlineChevronRight } from 'react-icons/hi';
import { B1Bold } from '@/style/fonts/StyledFonts';
Expand Down
Loading