Skip to content

Commit 34ea376

Browse files
authored
Merge pull request #89 from billilge/fix/#77-mobile-main-error-fix
[Fix/#77] 모바일 메인 검색창 클릭시 확대되는 현상 / 알림 디자인 및 로직 수정
2 parents cfcec63 + 5fbc8e5 commit 34ea376

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/app/layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ export const metadata: Metadata = {
2828
export default function RootLayout({ children }: React.PropsWithChildren) {
2929
return (
3030
<html lang="en" suppressHydrationWarning>
31+
<head>
32+
{/* viewport metadata에 추가 했을 시, 경고가 떠서 이쪽에 적었고 head태그를 사용하려면 title도 필요하여 title도 추가하게 되었습니다. */}
33+
<meta
34+
name="viewport"
35+
content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width"
36+
/>
37+
<title>빌릴게</title>
38+
</head>
3139
<body
3240
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
3341
suppressHydrationWarning

src/app/mobile/main/_components/MainHeader/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import { getNotificationCount } from '@/apis/notification';
1010
export default function MainHeader() {
1111
const router = useRouter();
1212
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
13-
const [notificationCount, setNotificationCount] = useState<number | null>(
14-
null,
15-
);
13+
const [notificationCount, setNotificationCount] = useState(0);
1614
const [user, setUser] = useState<{
1715
name: string;
1816
id: string;
@@ -52,9 +50,9 @@ export default function MainHeader() {
5250
onClick={() => router.push('/mobile/notification')}
5351
>
5452
<IconAlarm />
55-
{notificationCount && (
56-
<div className="absolute -right-0.5 -top-0.5 flex h-[13px] w-[13px] items-center justify-center rounded-full bg-warning text-caption-2_midi text-white-primary">
57-
{notificationCount}
53+
{notificationCount > 0 && (
54+
<div className="absolute -top-0.5 left-2.5 flex h-[13px] w-fit min-w-[13px] items-center justify-center rounded-full bg-warning px-0.5 text-caption-2_midi text-white-primary">
55+
{notificationCount > 99 ? '99+' : notificationCount}
5856
</div>
5957
)}
6058
</button>

0 commit comments

Comments
 (0)