|
1 | 1 | import styled from '@emotion/styled'; |
2 | 2 | import { Helmet } from 'react-helmet-async'; |
| 3 | +import { useState, useEffect } from 'react'; |
| 4 | +import { useParams } from 'react-router-dom'; |
| 5 | +import Layout from '~/components/Layout'; |
3 | 6 | import { EXTERNAL_DOMAIN } from '~/constants/external'; |
4 | 7 |
|
5 | 8 | const NotFound = () => { |
| 9 | + const { userCode } = useParams<{ userCode: string }>(); |
| 10 | + const [isDesktop, setIsDesktop] = useState(false); |
| 11 | + const [showModal, setShowModal] = useState(true); |
| 12 | + |
| 13 | + useEffect(() => { |
| 14 | + const mediaQuery = window.matchMedia('(min-width: 1024px)'); |
| 15 | + setIsDesktop(mediaQuery.matches); |
| 16 | + |
| 17 | + const handleMediaChange = (e: MediaQueryListEvent) => { |
| 18 | + setIsDesktop(e.matches); |
| 19 | + }; |
| 20 | + |
| 21 | + mediaQuery.addEventListener('change', handleMediaChange); |
| 22 | + return () => mediaQuery.removeEventListener('change', handleMediaChange); |
| 23 | + }, []); |
| 24 | + |
6 | 25 | return ( |
7 | 26 | <> |
8 | 27 | <Helmet> |
9 | 28 | <title>페이지를 찾을 수 없습니다 - 불티</title> |
10 | 29 | </Helmet> |
11 | 30 |
|
12 | | - <Container> |
13 | | - <Content> |
14 | | - <ErrorCode>404</ErrorCode> |
15 | | - <Title>페이지를 찾을 수 없습니다</Title> |
16 | | - <Description> |
17 | | - 요청하신 페이지가 존재하지 않거나 이동되었습니다. |
18 | | - <br /> |
19 | | - URL을 다시 확인해 주세요. |
20 | | - </Description> |
21 | | - <HomeLink href={EXTERNAL_DOMAIN.SHOW_MANAGER}>불티 홈으로 가기</HomeLink> |
22 | | - </Content> |
23 | | - </Container> |
| 31 | + <Layout> |
| 32 | + <CoverSection isCover={false} isDesktop={isDesktop}> |
| 33 | + <CoverImage |
| 34 | + src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgQChENDRAPDQ8QDQ0NEBANDQ8NDQ8PFBEWF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UPhi5/AjlO9Pq/wBY6p/nC+SuxmM5iX4eGvaPu64O5OOLegCogAoAAAAAAAIACgACooAAgPtl8tiXnhwjrM8mngZPCpx03p7z9nN1I7zm1mYWUxrcq6R3nhDt4ezP5W+GPu0Bnd1pMR1a7Py8dJnzmXOMnl/4R833HPa6/mfj4/8Ajy/8I+bhbIZeekx5TLsh2n8z8Z99mR+23xQ6uLk8evONY714todTdc3EeeG1j5TCvzjSe8cJ/LMzOVxKc+Ne8fdpNSs9YsdcB05AAAAAAABAAUAAVFAdvJZOb+lbhX52/Djkctv21nwxz9c9mxEQz3rnxHeM9+aViIjSOER0gBk2AAAAAAAACYjTSeIAy89kt306eHrHb8Oi9GyNoZXdner4Z+Utca+qy1n7jpgNGYAAAAAIACgADlSk2tFY5zOji0NlYWtpvPThHmlvIsna7+Dh1rSKx0+cuYPO9AAAAAAAAAAAACuOJStqzWeUxo5Ajz+PhTS81np84cGntbC9GLx04T5dGY3zexhqcoA6QAAAEABQABt5Gm7g19cb3vYkRxehrGkRHaIhn5Gnj9qAyagAAAAAAAAAAAKAI4Y9N7DtXvE+9596N5/MV0xLR2tP1aeNn5HABqzAAABAAUABywvHX2o+r0Dz+F46+1X6vQMvI18f2AM2gAAAAAAAAAAACgCDCzv69/a+zdYee/Xv5/Z34/bjfp8AGzIAAAB//9k=" |
| 35 | + alt="기본 프로필" |
| 36 | + /> |
| 37 | + <CoverOverlay> |
| 38 | + <ProfileInfo> |
| 39 | + <Nickname>닉네임</Nickname> |
| 40 | + <UserName>@{userCode || 'username'}</UserName> |
| 41 | + </ProfileInfo> |
| 42 | + </CoverOverlay> |
| 43 | + </CoverSection> |
| 44 | + |
| 45 | + {showModal && ( |
| 46 | + <ModalOverlay onClick={() => setShowModal(false)}> |
| 47 | + <ModalContent onClick={(e) => e.stopPropagation()}> |
| 48 | + <ModalText>존재하지 않는 프로필입니다.</ModalText> |
| 49 | + <ModalButton href={EXTERNAL_DOMAIN.SHOW_MANAGER}>불티 홈 바로 가기</ModalButton> |
| 50 | + </ModalContent> |
| 51 | + </ModalOverlay> |
| 52 | + )} |
| 53 | + </Layout> |
24 | 54 | </> |
25 | 55 | ); |
26 | 56 | }; |
27 | 57 |
|
28 | 58 | export default NotFound; |
29 | 59 |
|
30 | | -const Container = styled.div` |
| 60 | +const CoverSection = styled.div<{ isCover: boolean; isDesktop: boolean }>` |
| 61 | + position: relative; |
| 62 | + width: 100%; |
| 63 | + height: 0; |
| 64 | + padding-top: 100%; |
| 65 | + overflow: hidden; |
| 66 | + border-radius: ${({ isCover, isDesktop }) => (isCover && isDesktop ? '20px 20px 0 0' : '0')}; |
| 67 | + :after { |
| 68 | + content: ''; |
| 69 | + position: absolute; |
| 70 | + top: 0; |
| 71 | + left: 0; |
| 72 | + width: 100%; |
| 73 | + height: 100%; |
| 74 | + background: linear-gradient(to bottom, rgba(18, 19, 24, 0.2) 0%, rgba(18, 19, 24, 1) 100%); |
| 75 | + } |
| 76 | +`; |
| 77 | + |
| 78 | +const CoverImage = styled.img` |
| 79 | + width: 100%; |
| 80 | + height: 100%; |
| 81 | + object-fit: cover; |
| 82 | + position: absolute; |
| 83 | + top: 0; |
| 84 | + left: 0; |
| 85 | +`; |
| 86 | + |
| 87 | +const CoverOverlay = styled.div` |
| 88 | + position: absolute; |
| 89 | + bottom: 0; |
| 90 | + left: 0; |
| 91 | + right: 0; |
| 92 | + z-index: 1; |
| 93 | + padding: 0 20px; |
31 | 94 | display: flex; |
32 | | - align-items: center; |
33 | | - justify-content: center; |
34 | | - min-height: 100vh; |
35 | | - background-color: #f8f9fa; |
36 | | - padding: 20px; |
| 95 | + flex-direction: column; |
37 | 96 | `; |
38 | 97 |
|
39 | | -const Content = styled.div` |
40 | | - text-align: center; |
41 | | - max-width: 480px; |
| 98 | +const ProfileInfo = styled.div` |
| 99 | + display: flex; |
| 100 | + flex-direction: column; |
42 | 101 | `; |
43 | 102 |
|
44 | | -const ErrorCode = styled.div` |
45 | | - font-size: 72px; |
| 103 | +const Nickname = styled.h1` |
| 104 | + ${({ theme }) => theme.typo.point.p3}; |
46 | 105 | font-weight: bold; |
47 | | - color: #667eea; |
48 | | - margin-bottom: 16px; |
| 106 | + color: ${({ theme }) => theme.palette.grey.g10}; |
49 | 107 | `; |
50 | 108 |
|
51 | | -const Title = styled.h1` |
52 | | - font-size: 28px; |
53 | | - font-weight: bold; |
54 | | - color: #212529; |
55 | | - margin-bottom: 12px; |
| 109 | +const UserName = styled.h1` |
| 110 | + ${({ theme }) => theme.typo.b1}; |
| 111 | + color: ${({ theme }) => theme.palette.grey.g50}; |
| 112 | + margin: 0; |
| 113 | +`; |
| 114 | + |
| 115 | +const ModalOverlay = styled.div` |
| 116 | + position: fixed; |
| 117 | + top: 0; |
| 118 | + left: 0; |
| 119 | + right: 0; |
| 120 | + bottom: 0; |
| 121 | + background-color: rgba(0, 0, 0, 0.7); |
| 122 | + display: flex; |
| 123 | + align-items: center; |
| 124 | + justify-content: center; |
| 125 | + z-index: 1000; |
| 126 | + padding: 20px; |
56 | 127 | `; |
57 | 128 |
|
58 | | -const Description = styled.p` |
59 | | - font-size: 16px; |
60 | | - color: #495057; |
61 | | - line-height: 1.6; |
62 | | - margin-bottom: 32px; |
| 129 | +const ModalContent = styled.div` |
| 130 | + background-color: white; |
| 131 | + border-radius: 20px; |
| 132 | + padding: 40px 24px 24px; |
| 133 | + max-width: 382px; |
| 134 | + width: 100%; |
| 135 | + display: flex; |
| 136 | + flex-direction: column; |
| 137 | + gap: 16px; |
| 138 | +`; |
| 139 | + |
| 140 | +const ModalText = styled.p` |
| 141 | + ${({ theme }) => theme.typo.sh1}; |
| 142 | + color: #121318; |
| 143 | + text-align: center; |
| 144 | + margin: 0; |
63 | 145 | `; |
64 | 146 |
|
65 | | -const HomeLink = styled.a` |
66 | | - display: inline-block; |
67 | | - padding: 12px 24px; |
68 | | - background-color: #667eea; |
69 | | - color: #ffffff; |
| 147 | +const ModalButton = styled.a` |
| 148 | + width: 100%; |
| 149 | + height: 48px; |
| 150 | + display: flex; |
| 151 | + align-items: center; |
| 152 | + justify-content: center; |
| 153 | + background-color: #ff5623; |
| 154 | + color: white; |
70 | 155 | text-decoration: none; |
71 | 156 | border-radius: 8px; |
| 157 | + ${({ theme }) => theme.typo.sh1}; |
72 | 158 | font-weight: 600; |
| 159 | + cursor: pointer; |
73 | 160 | transition: background-color 0.2s; |
74 | 161 |
|
75 | 162 | &:hover { |
76 | | - background-color: #5568d3; |
| 163 | + background-color: #e64d1f; |
77 | 164 | } |
78 | 165 | `; |
0 commit comments