-
Notifications
You must be signed in to change notification settings - Fork 10
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
[4주차] 김수현 미션 제출합니다. #19
base: main
Are you sure you want to change the base?
Changes from all commits
97b7ad0
72664bf
e6afb9d
f4a37d1
56cda24
75df157
b8f3cd0
5010109
133b491
f88406f
0241920
5751431
ecefc85
bcebf8b
1845a0f
5a2be3d
8752429
16c9841
2477466
bab1796
26c6149
c9c860a
a66dd9f
d9a095b
2664e08
8498caf
c764cb8
4b79a07
ec7c4be
4a82944
7688f11
438f6bd
6a36bc0
d6f6da9
9407851
c892014
d8e5289
54b348f
ee336a4
af0aba2
79c3f6b
9eea7d3
2ca5f03
253d9a2
e7979ae
f46f1d7
10df23b
03bf48c
4798dff
d14b728
a2131c4
076f1b3
454e515
f037738
c846ab8
4dab785
8ea575e
8e7b512
903c144
86b7fd6
97d5a27
577f021
e0fc443
8e71e9d
0ec9503
cb5504d
252c8d1
b57e56d
82344bc
81ddbaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
|
||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
|
||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
|
||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no"> | ||
<title>Messenger S&Y</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,49 @@ | ||
function App() { | ||
return ( | ||
<div> | ||
<h1>19기 프론트엔드 파이팅!!! 디자인과 사이좋게 지내요~~~</h1> | ||
</div> | ||
); | ||
} | ||
import React, { useState } from 'react'; | ||
import { AnimatePresence } from 'framer-motion'; | ||
import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; | ||
import { RecoilRoot } from 'recoil'; | ||
import ChatList from './components/list/ChatList'; | ||
import ChatApp from './components/main/ChatApp'; | ||
import FriendList from './components/list/FriendList'; | ||
import GlobalStyle from './components/style/GlobalStyle'; | ||
import MyPage from './components/list/MyPage' | ||
import PhoneCall from './components/list/PhoneCall'; | ||
import ActiveCall from './components/list/ActiveCall'; | ||
|
||
|
||
|
||
const AnimatedRoutes = () => { | ||
const location = useLocation(); // 현재 위치를 가져옴 | ||
const [phoneNumber, setPhoneNumber] = useState(""); | ||
|
||
|
||
|
||
return ( | ||
<AnimatePresence mode='wait'> | ||
<Routes location={location} key={location.pathname}> | ||
<Route path="/" element={<ChatList />} /> | ||
<Route path="/chat/:userId" element={<ChatApp />} /> | ||
<Route path="/friends" element={<FriendList />} /> | ||
<Route path="/mypage" element={<MyPage/>}/> | ||
<Route path="/phone" element={<PhoneCall/>}/> | ||
<Route path="/active-call" element={ <ActiveCall phoneNumber={phoneNumber} />} /> | ||
</Routes> | ||
</AnimatePresence> | ||
); | ||
}; | ||
|
||
|
||
|
||
const App: React.FC = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
return ( | ||
<RecoilRoot> | ||
<Router> | ||
<GlobalStyle /> | ||
<AnimatedRoutes /> | ||
</Router> | ||
</RecoilRoot> | ||
); | ||
}; | ||
|
||
export default App; |
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.
React Router와 Framer Motion을 결합하여 애니메이션 효과를 포함한 라우팅을 구현하신게 정말 사용자 경험면에 있어서 좋은 것 같아요.
AnimatePresence 컴포넌트로 페이지를 전환할 때마다 매끄러운 애니메이션 처리해주신게 인상깊습니다.
라우팅을 정말 잘 구현하신 것 같아요..!