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
53 changes: 24 additions & 29 deletions src/feature/root/components/RendingBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export const RendingBody = () => {
alt: 'QR 코드 공유',
width: 260,
height: 530.31,
title: '이벤트마다 모인 자리에서 바로 공유',
title: '모인 자리에서 바로 공유',
description: '감튀 모임부터 앨범 만들고 초대까지 딱 10초',
},
{
src: '/assets/rending/new-swipe/3.png',
alt: '베스트컷',
width: 312.56,
height: 530.31,
title: '이벤트마다 한눈에 보는 베스트컷',
title: '한눈에 보는 베스트컷',
description: '사진 고르는 고민 이제 끝',
},
{
Expand Down Expand Up @@ -137,7 +137,7 @@ export const RendingBody = () => {
className='absolute bottom-0 z-10 flex h-[242px] w-full flex-col items-center bg-white px-4 pt-8'
style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 20px)' }}
>
{/* 텍스트 및 인디케이터 영역 - 스와이프 가능 */}
{/* 텍스트 영역 - 스와이프 가능 */}
<Carousel
setApi={setApi}
className='w-full'
Expand All @@ -149,38 +149,33 @@ export const RendingBody = () => {
<CarouselContent>
{slides.map((slide, index) => (
<CarouselItem key={index}>
<div className='flex flex-col items-center'>
{/* 텍스트 영역 */}
<div className='mb-6 flex flex-col items-center text-center'>
<h2 className='text-text-basic text-[24px] font-[600]'>
{slide.title}
</h2>
<p className='mt-1 text-[16px] font-[500] text-[#746181]'>
{slide.description}
</p>
</div>

{/* 인디케이터 점들 */}
<div className='flex gap-2'>
{slides.map((_, idx) => (
<button
key={idx}
onClick={() => api?.scrollTo(idx)}
className={`h-1.5 rounded-full transition-all ${
current === idx
? 'w-6 bg-gray-700'
: 'w-1.5 bg-gray-200'
}`}
aria-label={`슬라이드 ${idx + 1}로 이동`}
/>
))}
</div>
<div className='flex flex-col items-center text-center'>
<h2 className='text-text-basic text-[24px] font-[600]'>
{slide.title}
</h2>
<p className='mt-1 text-[16px] font-[500] text-[#746181]'>
{slide.description}
</p>
</div>
</CarouselItem>
))}
</CarouselContent>
</Carousel>

{/* 인디케이터 점들 - 고정 */}
<div className='mt-6 flex gap-2'>
{slides.map((_, idx) => (
<button
key={idx}
onClick={() => api?.scrollTo(idx)}
Comment on lines +168 to +170
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

button 요소에는 type='button' 속성을 명시하는 것이 좋습니다. 이는 폼(form) 내부에 버튼이 위치할 경우 의도치 않게 서브밋(submit)되는 것을 방지하며, 브라우저가 요소의 역할을 명확히 인지하도록 돕습니다.

            <button
              type='button'
              key={idx}
              onClick={() => api?.scrollTo(idx)}

className={`h-1.5 rounded-full transition-all ${
current === idx ? 'w-6 bg-gray-700' : 'w-1.5 bg-gray-200'
}`}
aria-label={`슬라이드 ${idx + 1}로 이동`}
/>
))}
</div>

{/* 카카오 로그인 버튼 - 고정 */}
<div
className='mt-auto flex h-[56px] w-full cursor-pointer items-center justify-center gap-2 rounded-[6px] bg-[#FEE500]'
Expand Down
2 changes: 1 addition & 1 deletion src/feature/root/components/ScreenNewRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ScreenNewRoot = () => {

// 로그인 상태이거나 비로그인에서 스플래시 시간이 지난 경우
return (
<div className='bg-background-brand flex h-screen flex-col items-center justify-center'>
<div className='bg-background-brand flex h-dvh flex-col items-center justify-center'>
<RendingBody />
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion src/global/hooks/useCheckAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useCheckAuth({
const status = err?.response?.status;
const code = err?.code;

// 401 에러 또는 refresh token 없음 에러 처리
// 401 에러 또는 refresh token 없음 에러 처리, 혹은 그 외 에러도 비로그인 처리
if (
status === 401 ||
code === 401 ||
Expand All @@ -62,6 +62,11 @@ export function useCheckAuth({
setIsAuthed(false);
setUserId(null);
onUnauthed?.();
} else {
// 그 외 에러 상황에서도(네트워크 에러 등) 일단 비로그인으로 간주하여 무한 로딩 방지
setIsAuthed(false);
setUserId(null);
onUnauthed?.();
}
}
};
Expand Down
Loading