Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added src/assets/png/DefaultImageSrc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lib/services/servicesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ErrorResponse } from '@/types/api/apiError';

export const services = axios.create({
timeout: 5000,
baseURL: 'https://bootcamp-api.codeit.kr/api/0-1/the-julge',
baseURL: 'https://bootcamp-api.codeit.kr/api/20-3/the-julge',
headers: {
'Content-Type': 'application/json',
},
Expand Down
13 changes: 11 additions & 2 deletions src/pages/store/[shopId]/[noticeId]/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Image from 'next/image';
import Image, { StaticImageData } from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/router';

import { useCallback, useEffect, useState } from 'react';

import DefaultImage from '@/assets/png/DefaultImageSrc.png';
import { RECENT_NOTICE_KEY } from '@/constants/recentNotice';
import {
applyNotice,
Expand Down Expand Up @@ -52,6 +53,7 @@
if (typeof shopId === 'string' && typeof noticeId === 'string') {
const data = await getNoticeDetail(shopId, noticeId);
setNotice(data);
setImage(data.shop.item.imageUrl);

if (user?.id) {
const userApplications = await GetUserApplications(
Expand Down Expand Up @@ -88,6 +90,10 @@
setCancelModalOpen(true);
};

const [image, setImage] = useState<string | StaticImageData | undefined>(
notice?.shop.item.imageUrl
);

useEffect(() => {
if (!notice) return;

Expand Down Expand Up @@ -171,10 +177,13 @@
<S.SummaryCardImage>
{closed && <S.ExpiredOverlay>마감 완료</S.ExpiredOverlay>}
<Image
src={notice.shop.item.imageUrl}
src={image || DefaultImage}
alt="식당 이미지"
fill
style={{ objectFit: 'cover' }}
onError={e => {

Check warning on line 184 in src/pages/store/[shopId]/[noticeId]/index.page.tsx

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
setImage(DefaultImage);
}}
/>
</S.SummaryCardImage>
<S.SummaryCardInfo>
Expand Down
16 changes: 14 additions & 2 deletions src/pages/store/_components/ListCard/ListCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Image from 'next/image';
import Image, { StaticImageData } from 'next/image';

import { useState } from 'react';

import DefaultImage from '@/assets/png/DefaultImageSrc.png';
import * as S from '@/pages/store/_components/ListCard/ListCard.styles';
import { NoticeItem } from '@/types/user/notice';
import { formatDateTimeRange } from '@/utils/date';
Expand All @@ -19,6 +22,8 @@
},
} = notice;

const [image, setImage] = useState<string | StaticImageData>(imageUrl);

const increaseRatePercent =
Math.floor((hourlyPay - originalHourlyPay) / originalHourlyPay) * 100;

Expand All @@ -30,7 +35,14 @@
<S.CardContent>
<S.JobImage>
<S.JobImageMedia>
<Image src={imageUrl} alt="가게 이미지" fill />
<Image
src={image || DefaultImage}
alt="가게 이미지"
fill
onError={e => {

Check warning on line 42 in src/pages/store/_components/ListCard/ListCard.tsx

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
setImage(DefaultImage);
}}
/>
</S.JobImageMedia>
{closed && <S.ExpiredOverlay>마감 완료</S.ExpiredOverlay>}
</S.JobImage>
Expand Down
Loading