Skip to content

Commit 56224b0

Browse files
committed
feat: 인앱 브라우저 스타일 컴포넌트 추가 및 적용
- InAppBrowser.styles.ts 파일 생성 및 스타일 컴포넌트 정의 - 인앱 브라우저 컴포넌트에서 기존 HTML 요소를 스타일 컴포넌트로 변경하여 가독성 및 유지보수성 향상
1 parent 42ede9f commit 56224b0

File tree

2 files changed

+56
-9
lines changed

2 files changed

+56
-9
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import styled from '@emotion/styled';
2+
3+
const Container = styled.div`
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
min-height: 100vh;
8+
background-color: ${({ theme }) => theme.palette.gray['gray-9']};
9+
`;
10+
11+
const Content = styled.div`
12+
display: flex;
13+
flex-direction: column;
14+
align-items: center;
15+
gap: 8px;
16+
padding: 24px;
17+
text-align: center;
18+
`;
19+
20+
const Title = styled.p`
21+
color: ${({ theme }) => theme.palette.common.white};
22+
${({ theme }) => theme.typography.title.display1};
23+
`;
24+
25+
const Description = styled.p`
26+
color: ${({ theme }) => theme.palette.gray['gray-2']};
27+
${({ theme }) => theme.typography.title['subhead2']};
28+
`;
29+
30+
const StoreButton = styled.button`
31+
margin-top: 16px;
32+
padding: 12px 24px;
33+
border-radius: 8px;
34+
background-color: ${({ theme }) => theme.palette.common.white};
35+
color: ${({ theme }) => theme.palette.gray['gray-9']};
36+
${({ theme }) => theme.typography.title.subhead1};
37+
border: none;
38+
cursor: pointer;
39+
transition: background-color 0.2s ease;
40+
41+
&:hover {
42+
background-color: ${({ theme }) => theme.palette.gray['gray-2']};
43+
}
44+
`;
45+
46+
export { Container, Content, Title, Description, StoreButton };

apps/web/src/components/InAppBrowser/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import useInAppBrowserDetect from '@/hooks/useInAppBrowserDetect';
22
import { ReactNode, useEffect } from 'react';
3+
import * as S from './InAppBrowser.styles';
34

45
interface InAppBrowserDetectProps {
56
children: ReactNode;
@@ -44,21 +45,21 @@ const InAppBrowserDetect = ({ children }: InAppBrowserDetectProps) => {
4445
})();
4546

4647
return (
47-
<div>
48-
<div>
49-
<p>{userBrowserName} 인앱브라우저에서는</p>
50-
<p>일부 기능 이용이 제한됩니다.</p>
51-
<p>외부 브라우저로 이동중입니다...</p>
52-
<button
48+
<S.Container>
49+
<S.Content>
50+
<S.Title>{userBrowserName} 인앱브라우저에서는</S.Title>
51+
<S.Description>일부 기능 이용이 제한됩니다.</S.Description>
52+
<S.Description>외부 브라우저로 이동중입니다...</S.Description>
53+
<S.StoreButton
5354
onClick={(e) => {
5455
e.preventDefault();
5556
moveToStore();
5657
}}
5758
>
5859
{storeName}에서 설치하기
59-
</button>
60-
</div>
61-
</div>
60+
</S.StoreButton>
61+
</S.Content>
62+
</S.Container>
6263
);
6364
}
6465

0 commit comments

Comments
 (0)