Skip to content

Commit 606002a

Browse files
committed
feat: safe area 테스트2
1 parent a93094f commit 606002a

File tree

5 files changed

+63
-4
lines changed

5 files changed

+63
-4
lines changed

apps/tuk-web/src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const viewport = {
1616
initialScale: 1,
1717
maximumScale: 1,
1818
userScalable: 'no',
19+
viewportFit: 'cover',
1920
};
2021

2122
export default function RootLayout({

apps/tuk-web/src/app/proposal/[proposalId]/detail/components/GatheringProposalContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export const CardFrame = () => {
121121
height="421"
122122
viewBox="0 0 408 421"
123123
fill="none"
124+
style={{ overflow: 'hidden', display: 'block' }}
124125
>
125126
<foreignObject x="0" y="0" width="408" height="421">
126127
<div

apps/tuk-web/src/shared/components/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Header.tsx
12
import { ButtonHTMLAttributes, HTMLAttributes } from 'react';
23

34
import { cn } from '@/shared/lib';
@@ -6,7 +7,9 @@ export const Header = ({ children, className }: HTMLAttributes<HTMLHeadElement>)
67
return (
78
<header
89
className={cn(
9-
'sticky top-0 z-20 flex h-16 items-center justify-between bg-white-default px-5 py-4',
10+
// 🔹 h-16 고정 제거 → min-h-16로 기본 높이 보장 + pt-safe로 노치 패딩
11+
'sticky top-0 z-20 flex min-h-16 items-center justify-between ' +
12+
'pt-safe bg-white-default px-5 py-4',
1013
className
1114
)}
1215
>

apps/tuk-web/src/shared/components/provider/ClientProvider.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { UserAgentProvider } from '@/shared/components/provider/UserAgentProvide
88
export default function ClientProvider({ children }: { children: ReactNode }) {
99
return (
1010
<UserAgentProvider>
11-
<AppBridgeProvider>
12-
<div className="mx-auto max-w-[600px]">{children}</div>
13-
</AppBridgeProvider>
11+
<AppBridgeProvider>{children}</AppBridgeProvider>
1412
</UserAgentProvider>
1513
);
1614
}

apps/tuk-web/src/styles/globals.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,59 @@
9595
}
9696
}
9797

98+
:root {
99+
--safe-top: 0px;
100+
--safe-right: 0px;
101+
--safe-bottom: 0px;
102+
--safe-left: 0px;
103+
}
104+
105+
@supports (padding: max(0px)) {
106+
:root {
107+
--safe-top: env(safe-area-inset-top);
108+
--safe-right: env(safe-area-inset-right);
109+
--safe-bottom: env(safe-area-inset-bottom);
110+
}
111+
}
112+
113+
@layer utilities {
114+
/* 화면 전체 + 안전영역 패딩 흡수 */
115+
.screen-safe {
116+
min-height: 100dvh; /* 앱 웹뷰에 안전 */
117+
padding-top: var(--safe-top);
118+
padding-right: var(--safe-right);
119+
padding-bottom: var(--safe-bottom);
120+
padding-left: var(--safe-left);
121+
}
122+
123+
/* 고정 헤더/푸터 보정용 */
124+
.pt-safe {
125+
padding-top: var(--safe-top);
126+
}
127+
.pr-safe {
128+
padding-right: var(--safe-right);
129+
}
130+
.pb-safe {
131+
padding-bottom: var(--safe-bottom);
132+
}
133+
.pl-safe {
134+
padding-left: var(--safe-left);
135+
}
136+
137+
/* 하단 고정바(CTA) 자주 쓰는 패턴 */
138+
.cta-safe {
139+
padding-bottom: calc(var(--safe-bottom) + 1.5rem);
140+
}
141+
142+
/* iOS 필터/블러 오버플로우 방지(필요한 요소에 클래스 부여해서 사용) */
143+
.contain-paint {
144+
contain: paint;
145+
clip-path: inset(0);
146+
transform: translateZ(0);
147+
pointer-events: none; /* 배경 장식이라면 옵션 */
148+
}
149+
}
150+
98151
* {
99152
-ms-overflow-style: none;
100153
scrollbar-width: none;
@@ -106,7 +159,10 @@
106159

107160
html,
108161
body {
162+
max-width: 37.5rem;
163+
margin: 0 auto;
109164
overscroll-behavior: none;
110165
-webkit-overflow-scrolling: touch;
111166
touch-action: manipulation;
167+
overflow-x: hidden;
112168
}

0 commit comments

Comments
 (0)