Skip to content
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주차] 김류원 미션 제출합니다. #16

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
510f498
deploy: vercel배포
Sep 26, 2024
43ad7e6
refactor: 프로필보기 클릭시 채팅창 blur로 배경 보이게 수정, feat: 입력 input 클릭시 thumb_up …
Sep 27, 2024
3437596
feat: profil detail 이모티콘 img 수정
Sep 27, 2024
9e05103
feat: profil detail sns 연결
Sep 27, 2024
78369ec
feat: 반응형구현
Sep 27, 2024
8290467
chore: profileDetail에서 back blur 상단 하단 bar까지,time 텍스트 하단 정렬
Sep 27, 2024
8ebfd4b
feat: 메세지 애니메이션 수정(상대방으로 전환시에도 애니메이션 효과)
Sep 27, 2024
d12db29
feat: pretendard font 추가
Sep 27, 2024
bb058b0
chore:필요없는 주석 제거
Sep 27, 2024
3ecd1a1
fix: 상대방 프로필이 표시되도록 ProfileDetail 및 Header 컴포넌트 수정
Sep 27, 2024
f6553e1
feat : 친구목록 라우팅, bottomNav ui
ryu-won Oct 31, 2024
1dcbaf4
feat : 친구목록라우팅, bottomnav ui
ryu-won Oct 31, 2024
114b0f0
feat : home 친구목록 기능 구현
ryu-won Oct 31, 2024
a6b3deb
feat : chatlist 기능구현
ryu-won Oct 31, 2024
17f2cbc
feat : chat-list와 채팅방 연결
ryu-won Nov 2, 2024
efdd176
chore : 피그마에 맞게 UI 수정
ryu-won Nov 2, 2024
1ad0b63
chore : home 디자인 수정
ryu-won Nov 2, 2024
70e1ce4
fix : 로컬스토리지 불러오기 오류 수정
ryu-won Nov 2, 2024
55843a5
fix : 채팅방간 로컬스토리지 동일한 ID로 저장되어 초기화되는 문제
ryu-won Nov 2, 2024
9fbc1b5
fix : 최근 대화목록 순서대로 정렬, 로컬스토리지에 새로운 채팅방이 추가되어도 채팅리스트에 보이도록 수정
ryu-won Nov 4, 2024
416a823
refactor : a태그 div로 변경
ryu-won Nov 4, 2024
4c30bb6
refactor : a태그 div로 변경
ryu-won Nov 4, 2024
ce3d239
design : overflow코드로 수정
ryu-won Nov 4, 2024
167d3ac
refactor : || params.sender 제거
ryu-won Nov 4, 2024
75b347f
refactor : 불필요한 코드 제거
ryu-won Nov 4, 2024
d5bb6ec
refactor : chatRoomId = location.state?.chatRoomId || params.sender;
ryu-won Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
430 changes: 422 additions & 8 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@heroicons/react": "^2.1.5",
"@tanstack/react-query": "^5.59.16",
"@tanstack/react-query-devtools": "^5.59.16",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -12,7 +15,12 @@
"@types/react-dom": "^18.2.22",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.3.0",
"react-query": "^3.39.3",
"react-router-dom": "^6.26.2",
"react-scripts": "5.0.1",
"recoil": "^0.7.7",
"styled-components": "^6.1.13",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
Expand All @@ -39,5 +47,10 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-icons": "^2.2.7",
"@types/styled-components": "^5.1.34",
"tailwindcss": "^3.4.13"
}
}
7 changes: 7 additions & 0 deletions public/Profile_image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions public/fakedata/messagesData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"id": 1,
"text": "머하밍??",
"sender": "CEOS",
"receiver": "김류원",
"time": "2024-10-31T12:34:56.000Z",
"chatRoomId": "CEOS"
},
{
"id": 2,
"text": "과제중🤮🤮",
"sender": "김류원",
"receiver": "CEOS",
"time": "2024-10-31T12:35:56.000Z",
"chatRoomId": "CEOS"
},
{
"id": 3,
"text": "🤦‍♀️🤦‍♀️",
"sender": "CEOS",
"receiver": "김류원",
"time": "2024-10-31T12:36:56.000Z",
"chatRoomId": "CEOS"
},
{
"id": 4,
"text": "차은우가 보낸 메세지",
"sender": "차은우",
"receiver": "김류원",
"time": "2024-10-31T12:37:56.000Z",
"chatRoomId": "차은우"
},
{
"id": 5,
"text": "뷔가 보낸 메세지",
"sender": "뷔",
"receiver": "김류원",
"time": "2024-10-31T12:38:56.000Z",
"chatRoomId": "뷔"
}
]
50 changes: 50 additions & 0 deletions public/fakedata/users.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"id": 0,
"name": "김류원",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com/"
},
{
"id": 1,
"name": "CEOS",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/clubceos/",
"instagram": "https://www.instagram.com/ceos.sinchon/",
"description": "IT 연합 동아리"
},

{
"id": 2,
"name": "차은우",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com/",
"description": "차은우! 차은우! 차은우!"
},
{
"id": 3,
"name": "송강",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com/",
"description": "스위트홈에서 잘생김"
},
{
"id": 4,
"name": "뷔",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com/",
"description": "그냥 잘생김"
},
{
"id": 5,
"name": "서강준",
"profilePic": "/Profile_image.svg",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com/",
"description": "정글의법칙에서도 잘생김"
}
]
5 changes: 5 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
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`.
-->
<link
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css"
rel="stylesheet"
/>

<title>React App</title>
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions src/images.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.svg" {
const content: any;
export default content;
}
39 changes: 2 additions & 37 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
body {
font-family: "Pretendard";
}
33 changes: 30 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
import {
BrowserRouter as Router,
Routes,
Route,
useMatch,
} from "react-router-dom";
import ChatRoom from "./pages/ChatRoom";
import ProfileDetail from "./pages/ProfileDetail";
import { useState } from "react";
import BottomNav from "./components/BottomNav";
import { ReactQueryDevtools } from "react-query/devtools";

import Home from "./pages/Home";
import ChatList from "./pages/ChatList";

function App() {
const chatRoomMatch = useMatch("/chat-room/:sender");

return (
<div>
<h1>20기 프론트엔드 파이팅!!! 디자인과 사이좋게 지내요~~~</h1>
</div>
<>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/chat-room/:sender" element={<ChatRoom />} />
<Route path="/chat-list" element={<ChatList />} />
</Routes>
<div className=" md:max-w-[375px] mx-auto">
{" "}
{chatRoomMatch ? null : <BottomNav></BottomNav>}
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분에서 null을 반환하는 대신 && 연산자를 사용하면 더 좋을 것 같아요!

Suggested change
<div className=" md:max-w-[375px] mx-auto">
{" "}
{chatRoomMatch ? null : <BottomNav></BottomNav>}
</div>
<div className=" md:max-w-[375px] mx-auto">
{!chatRoomMatch && <BottomNav />}
</div>


<ReactQueryDevtools />
</>
);
}

Expand Down
9 changes: 9 additions & 0 deletions src/api.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function fetchUsers() {
return fetch("/fakedata/users.json").then((response) => response.json());
}

export function fetchMessages() {
return fetch("/fakedata/messagesData.json").then((response) =>
response.json()
);
}
5 changes: 5 additions & 0 deletions src/assets/Back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/Story.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/call.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/person_plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/assets/profile_facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading