-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] 초기 세팅 진행 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
88d0b50
#1 [FEAT] 필요 패키지 설치
sunhwaaRj 12dfa8e
#1 [FEAT] 테일윈드 설정
sunhwaaRj caa7a4f
#1 [FEAT] 초기 라우팅 설정
sunhwaaRj 99559dc
#1 [FEAT] 모바일뷰 css 설정
sunhwaaRj 82cd7e4
#1 [FEAT] 각 페이지 초기 설정
sunhwaaRj d86608f
#1 [FEAT] 폰트 설정
sunhwaaRj b9c96e8
#1 [FEAT] 시작 페이지 ui
sunhwaaRj 45d5e73
#1 [FIX] 빌드 오류 수정
sunhwaaRj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| const App = () => { | ||
| return <div>Snowgent</div>; | ||
| }; | ||
| import { Outlet } from 'react-router-dom'; | ||
|
|
||
| export default App; | ||
| export default function App() { | ||
| return ( | ||
| <div className="mobile-container"> | ||
| <div className="mobile-content"> | ||
| <Outlet /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| @import 'tailwindcss'; | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Thin.woff2') | ||
| format('woff2'); | ||
| font-weight: 100; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-ExtraLight.woff2') | ||
| format('woff2'); | ||
| font-weight: 200; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Light.woff2') | ||
| format('woff2'); | ||
| font-weight: 300; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Regular.woff2') | ||
| format('woff2'); | ||
| font-weight: 400; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Medium.woff2') | ||
| format('woff2'); | ||
| font-weight: 500; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-SemiBold.woff2') | ||
| format('woff2'); | ||
| font-weight: 600; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Bold.woff2') | ||
| format('woff2'); | ||
| font-weight: 700; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-ExtraBold.woff2') | ||
| format('woff2'); | ||
| font-weight: 800; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Pretendard'; | ||
| src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/Pretendard-Black.woff2') | ||
| format('woff2'); | ||
| font-weight: 900; | ||
| font-display: swap; | ||
| } | ||
|
|
||
| @layer base { | ||
| * { | ||
| @apply box-border; | ||
| } | ||
|
|
||
| html { | ||
| @apply h-full overflow-x-hidden; | ||
| height: 100dvh; | ||
| } | ||
|
|
||
| body { | ||
| @apply m-0 h-full p-0 antialiased; | ||
| font-family: | ||
| 'Pretendard', | ||
| -apple-system, | ||
| BlinkMacSystemFont, | ||
| system-ui, | ||
| sans-serif; | ||
| background-color: #f9f9f9; | ||
| overscroll-behavior: none; | ||
| touch-action: pan-y; | ||
| } | ||
|
|
||
| #root { | ||
| @apply h-full; | ||
| } | ||
| } | ||
|
|
||
| @layer components { | ||
| .mobile-container { | ||
| @apply mx-auto flex h-full w-full justify-center; | ||
| max-width: 480px; | ||
| } | ||
|
|
||
| .mobile-content { | ||
| @apply flex h-full w-full flex-col; | ||
| background-color: white; | ||
| } | ||
|
|
||
| .mobile-padding { | ||
| @apply px-4 py-4; | ||
| } | ||
|
|
||
| .safe-top { | ||
| padding-top: max(env(safe-area-inset-top), 1rem); | ||
| } | ||
|
|
||
| .safe-bottom { | ||
| padding-bottom: max(env(safe-area-inset-bottom), 1rem); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { createBrowserRouter, RouterProvider } from 'react-router-dom'; | ||
| import Onboarding from './pages/onboarding/Onboarding'; | ||
| import Chat from './pages/chat/Chat'; | ||
| import App from './App'; | ||
| import HomePage from './pages/HomePage'; | ||
|
|
||
| const router = createBrowserRouter([ | ||
| { | ||
| path: '/', | ||
| element: <App />, | ||
| children: [ | ||
| { | ||
| index: true, | ||
| element: <HomePage />, | ||
| }, | ||
| { | ||
| path: 'onboarding', | ||
| element: <Onboarding />, | ||
| }, | ||
| { | ||
| path: 'chat', | ||
| element: <Chat />, | ||
| }, | ||
| ], | ||
| }, | ||
| ]); | ||
|
|
||
| export default function Router() { | ||
| return <RouterProvider router={router} />; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| import { StrictMode } from 'react' | ||
| import { createRoot } from 'react-dom/client' | ||
| import './index.css' | ||
| import App from './App.tsx' | ||
| import { StrictMode } from 'react'; | ||
| import { createRoot } from 'react-dom/client'; | ||
| import './index.css'; | ||
| import Router from './index.tsx'; | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <StrictMode> | ||
| <App /> | ||
| <Router /> | ||
| </StrictMode>, | ||
| ) | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import logo from '/vite.svg'; | ||
|
|
||
| const HomePage = () => { | ||
| const navigate = useNavigate(); | ||
| return ( | ||
| <div className="flex h-full flex-col items-center justify-center gap-8"> | ||
| <img src={logo} alt="Vite logo" className="h-40" /> | ||
| <h1 className="text-6xl text-[#0D2D84]">Snowgent</h1> | ||
| <button | ||
| onClick={() => navigate('/onboarding')} | ||
| className="cursor-pointer rounded-lg bg-blue-50 px-10 py-5 text-xl font-semibold text-[#0D2D84] hover:bg-blue-100" | ||
| > | ||
| 시작하기 | ||
| </button> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default HomePage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| const Chat = () => { | ||
| return <div className="flex h-full flex-col">Chat</div>; | ||
| }; | ||
|
|
||
| export default Chat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| const Onboarding = () => { | ||
| return <div>Onboarding</div>; | ||
| }; | ||
|
|
||
| export default Onboarding; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| import { defineConfig } from 'vite' | ||
| import react from '@vitejs/plugin-react-swc' | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react-swc'; | ||
| import tailwindcss from '@tailwindcss/vite'; | ||
|
|
||
| // https://vite.dev/config/ | ||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| }) | ||
| plugins: [react(), tailwindcss()], | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
라우터 구조는 잘 설계되었으나 에러 바운더리가 누락되었습니다.
React Router v7의
createBrowserRouter를 올바르게 사용하고 있으며, 레이아웃 기반 중첩 라우팅 구조도 적절합니다. 하지만 프로덕션 준비를 위해 에러 처리를 추가하는 것을 권장합니다.에러 바운더리와 404 페이지를 추가하세요:
const router = createBrowserRouter([ { path: '/', element: <App />, + errorElement: <ErrorPage />, children: [ { index: true, element: <HomePage />, }, { path: 'onboarding', element: <Onboarding />, }, { path: 'chat', element: <Chat />, }, + { + path: '*', + element: <NotFoundPage />, + }, ], }, ]);ErrorPage컴포넌트 예시:🤖 Prompt for AI Agents