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
18 changes: 14 additions & 4 deletions src/components/ui/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function useEscClose(open: boolean, onClose: () => void) {
/** Header */
function ModalHeader({ variant, title }: { variant: Variant; title: string }) {
return (
<div className='flex flex-col items-center gap-3 px-6 pt-6 text-center'>
<div className='flex flex-col items-center gap-8 px-6 pt-6 text-center'>
<span className='relative inline-flex items-center justify-center'>
<Icon
iconName={ICON_MAP[variant].circle}
Expand Down Expand Up @@ -81,13 +81,23 @@ function ModalFooter({
onSecondary?: () => void;
}) {
return (
<div className='flex items-center justify-center gap-3 px-6 pb-6 pt-6'>
<div className={cn('flex items-center justify-center gap-3 px-6 pb-6 pt-10')}>
{secondaryText && onSecondary && (
<Button size='md' variant='secondary' onClick={onSecondary}>
<Button
size='md'
variant='secondary'
className='flex-1 mobile:w-[calc(40%-6px)] mobile:flex-none'
onClick={onSecondary}
>
{secondaryText}
</Button>
)}
<Button size='md' variant='primary' onClick={onPrimary}>
<Button
size='md'
variant='primary'
className='flex-1 mobile:w-[calc(40%-6px)] mobile:flex-none'
onClick={onPrimary}
>
{primaryText}
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/context/authProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const AuthContext = createContext<AuthContextValue | null>(null);
const TOKEN_KEY = 'thejulge_token';
const USER_ID_KEY = 'thejulge_user_id';
const EXPIRES_KEY = 'thejulge_expires_at';
const EXPIRES_DURATION_MS = 10 * 60 * 1000; // 10λΆ„
const EXPIRES_DURATION_MS = 1000 * 60 * 1000; // 10λΆ„

/** storage helpers */
const isBrowser = () => typeof window !== 'undefined';
Expand Down
10 changes: 8 additions & 2 deletions src/pages/notices/[shopId]/[noticeId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useRouter } from 'next/router';
import { useCallback, useEffect, useMemo, useState } from 'react';

interface ModalItems {
variant?: 'success' | 'warning';
title?: string;
primaryText?: string;
secondaryText?: string;
Expand All @@ -29,28 +30,33 @@ interface ApplyItems extends ModalItems {
// κΆŒν•œλ³„ λͺ¨λ‹¬ ν…œν”Œλ¦Ώ
const APPLY_ITEMS: Record<UserRole, ApplyItems> = {
guest: {
variant: 'warning',
title: '둜그인이 ν•„μš”ν•©λ‹ˆλ‹€',
primaryText: 'λ‘œκ·ΈμΈν•˜κΈ°',
secondaryText: 'λ‹«κΈ°',
},
employee: {
profile: {
variant: 'success',
title: 'μ•„λ₯΄λ°”μ΄νŠΈ 신청을 ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?',
primaryText: 'μ‹ μ²­ν•˜κΈ°',
secondaryText: 'μ•„λ‹ˆμ˜€',
},
noProfile: {
variant: 'warning',
title: 'λ‚΄ ν”„λ‘œν•„μ„ λ¨Όμ € λ“±λ‘ν•΄μ£Όμ„Έμš”',
primaryText: 'ν”„λ‘œν•„ 등둝',
secondaryText: 'λ‹«κΈ°',
},
cancel: {
variant: 'success',
title: 'μ•„λ₯΄λ°”μ΄νŠΈ 신청을 μ·¨μ†Œν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?',
primaryText: 'μ·¨μ†Œν•˜κΈ°',
secondaryText: 'μ•„λ‹ˆμ˜€',
},
},
employer: {
variant: 'warning',
title: '사μž₯λ‹˜μ€ μ‹ μ²­ν•  수 μ—†μŠ΅λ‹ˆλ‹€',
primaryText: '확인',
},
Expand All @@ -59,7 +65,7 @@ const APPLY_ITEMS: Record<UserRole, ApplyItems> = {
// ν”„λ‘œν•„ 정보 쑴재 μ—¬λΆ€ 확인
function hasProfileFields(user: UserProfile | null) {
if (!user) return false;
return Boolean(user.name && user.phone && user.address && user.bio);
return Boolean(user.name && user.phone && user.address);
}

// 곡고 상세 초기 λ Œλ”λ§ SSR
Expand Down Expand Up @@ -194,7 +200,7 @@ const NoticeDetail = ({ notice }: { notice: NoticeCard }) => {
<Modal
open={modalOpen}
onClose={() => setModalOpen(false)}
variant='warning'
variant={modal?.variant ?? 'warning'}
title={modal?.title ?? 'μœ μ € 정보λ₯Ό ν™•μΈν•΄μ£Όμ„Έμš”'}
primaryText={modal?.primaryText ?? '확인'}
onPrimary={modal?.onPrimary ?? (() => setModalOpen(false))}
Expand Down
Loading