-
Notifications
You must be signed in to change notification settings - Fork 8
[5주차] 고윤정 미션 제출합니다. #17
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
Open
jejukyj
wants to merge
66
commits into
URECA-ReCoder:main
Choose a base branch
from
jejukyj:jejukyj
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
e2e0bb1
test commit
jejukyj 448c95e
Chore : css import 에러처리를 위해 rules 추가
jejukyj 3ab9cd4
Docs : normalize.css 링크 추가 및 파비콘 이미지 링크 추가
jejukyj 628691c
Chore : emotion 의존성 추가
jejukyj 3a1368d
Docs : 컴포넌트 구성
jejukyj d6c8982
Design : 배경 그라데이션 색 변경, wrapperStyle에 position: relative 추가
jejukyj 0b6d7c3
Design : Global Style 추가 및 Header, InputBox 컴포넌트 CSS 추가
jejukyj 452f172
Docs : JSON 더미 데이터 생성
jejukyj 744dff9
Design : Favicon 추가
jejukyj 68f4357
Design : icon, img 추가
jejukyj 5cbe1b9
Style : width, height, position 단위 변경
jejukyj 319d0d8
Design : 채팅 메시지 CSS 구현
jejukyj 05ae50d
Design : 'box-sizing: border-box' 추가
jejukyj 17a225a
Design : width 수정, position 값 추가
jejukyj dcbeaa0
Design : width 수정, position 값 추가
jejukyj cac1998
Refactor : 데이터 값 수정
jejukyj 59c456d
Chore : 유저 데이터 값 추가
jejukyj c90ef70
Feat : 메시지 추가 기능 구현
jejukyj 8565ea8
Feat : 메시지 입력 시 하단으로 자동스크롤 기능 구현, prop 유효성 검사 코드 추가
jejukyj 178fd0c
Feat : 메시지 입력(제출) 시 새로고침 방지, 입력 창 자동 포커싱 기능 추가, 엔터 시에도 메시지 추가가 되도록 엔터…
jejukyj b375df4
Refactor : favicon 경로 수정
jejukyj 5c8db53
Fix : GlobalStyle 변경, 에러 해결
jejukyj 7cb3959
Refactor : CSS 에러 사항 수정
jejukyj e3c5e24
Refactor : img 경로 수정 및 CSS 수정
jejukyj 1a39ab5
Refactor : img 경로 수정
jejukyj 9a6ce24
Refactor : profile key값 제거
jejukyj af3567b
Refactor : profile img 경로 수정
jejukyj 6dce93d
Refactor : CSS 수정
jejukyj 5de07aa
Refactor : 경로 수정
jejukyj 356bc6e
Refactor : 경로 수정
jejukyj 17fb207
Refactor : img 경로 수정
jejukyj b2ff6e9
Refactor : Content 경로 수정
jejukyj 4100b71
Refactor : 경로 수정
jejukyj 6fb55d6
Refactor : favicon 경로 수정
jejukyj aa6b32d
Design : overscroll 방지 코드 추가
jejukyj 2efc4c6
Refactor : img, file 경로 수정
jejukyj bacafdd
Feat : 타입 지정 및 리팩토링
jejukyj e45e778
Chore : TypeScript 설정 추가
jejukyj d037da4
Feat : TypeScript 컴파일 옵션 설정
jejukyj d50cc5d
Feat : img 경로 지정
jejukyj 99c9d54
Refactor : 폰트 재사용성을 높일 수 있도록 font-face 수정
jejukyj f8bbc7c
Refactor : jsx를 tsx로 변경
jejukyj d76ab79
Chore : yarn.lock update
jejukyj f3d23fe
Docs : 채팅방 목록 페이지 추가
jejukyj 67e6b5c
Design : 채팅방 목록 페이지 UI
jejukyj 16a3ac8
Feat : 라우터 연결
jejukyj 7e4fe42
Feat : Router, Recoil 추가
jejukyj af3a253
Feat : 채팅방 목록 페이지와 라우터 연결
jejukyj 1dc47c4
Feat : 라우터 추가
jejukyj 57bfa34
Design : 검색 아이콘 추가
jejukyj 030b9b3
Refactor : height 값 변경
jejukyj d2c21c9
Refactor : 공백 수정
jejukyj 65bf331
Design : 프로필 이미지 추가
jejukyj 35fd4dd
Feat : 상태관리를 위한 recoil atom 생성
jejukyj d43e0f7
Feat : 각 채팅방 아이디에 따른 라우터 수정
jejukyj 980fc72
Feat : atom 파일 연결
jejukyj 511b8eb
Design : 방해금지모드 아이콘 추가
jejukyj 351fa87
Refactor : 안쓰는 코드 삭제
jejukyj e5d381c
Fix : state들 타입 지정
jejukyj 31bb9cd
Feat : 방해금지모드 기능 추가 및 타입 지정
jejukyj 9b4390e
Comment : 주석 추가
jejukyj 052fefb
Feat : 마지막 채팅 메시지 표시 기능 추가
jejukyj 6ed0f94
Design : 메시지 박스 width 값 지정
jejukyj 420b7f8
Feat : vercel 라우트 경로 추가
jejukyj 201b6d7
Fix : Strict Mode 제거
jejukyj 43e819f
Feat : 자동 redirect 기능 추가
jejukyj 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
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,3 @@ | ||
| declare module '*.svg'; | ||
| declare module '*.png'; | ||
| declare module '*.jpg'; |
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 |
|---|---|---|
|
|
@@ -35,4 +35,9 @@ export default [ | |
| ], | ||
| }, | ||
| }, | ||
| { | ||
| rules: { | ||
| 'react/no-unknown-property': ['error', { ignore: ['css'] }], | ||
| }, | ||
| }, | ||
| ]; | ||
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
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /** @jsxImportSource @emotion/react */ | ||
| import { css } from '@emotion/react'; | ||
| import Header from './components/Header'; | ||
| import Content from './components/Content'; | ||
| import InputBox from './components/InputBox'; | ||
| import GlobalStyle from './components/GlobalStyle'; | ||
| import { useSetRecoilState } from 'recoil'; | ||
| import { messageState } from './recoil/atoms'; | ||
| import { useParams } from 'react-router-dom'; | ||
|
|
||
| // 메시지 타입 | ||
| interface messageType { | ||
| id: number; | ||
| userId: number; | ||
| text: string; | ||
| time: string; | ||
| } | ||
|
|
||
| function App() { | ||
| const { chatId } = useParams<{ chatId: string }>(); // URL에서 chatId를 가져옴 | ||
| const setMessages = useSetRecoilState(messageState); | ||
|
|
||
| function addMessage(text: string): void { | ||
| const newMessage: messageType = { | ||
| id: Date.now(), | ||
| userId: 0, // 항상 0으로 설정(메시지를 추가하면 '내'가 추가하도록 설정) | ||
| text: text, | ||
| time: new Date().toLocaleTimeString([], { | ||
| hour: '2-digit', | ||
| minute: '2-digit', | ||
| }), | ||
| }; // '오전 12:00' 포맷으로 출력 | ||
|
|
||
| setMessages((prevMessages) => { | ||
| const chatRoomId = parseInt(chatId || '1', 10); | ||
| return { | ||
| ...prevMessages, | ||
| [chatRoomId]: [...(prevMessages[chatRoomId] || []), newMessage], | ||
| }; | ||
| }); // 기존 메시지에 새로운 메시지 추가 | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| <GlobalStyle /> | ||
| <div css={wrapperStyle}> | ||
| <Header /> | ||
| <Content chatId={parseInt(chatId || '0', 10)} /> | ||
| <InputBox addMessage={addMessage} /> | ||
| </div> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default App; | ||
|
|
||
| // emotion/css | ||
|
|
||
| const wrapperStyle = css` | ||
| width: 100%; | ||
| max-width: 430px; | ||
| background: linear-gradient(#f8ff2e, #ffffff 40%); | ||
| border: 1px solid #1d1d1d; | ||
| overflow: hidden; | ||
| `; | ||
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,25 @@ | ||
| /** @jsxImportSource @emotion/react */ | ||
| import { css } from '@emotion/react'; | ||
| import GlobalStyle from './components/GlobalStyle'; | ||
| import ListHeader from './components/ListHeader'; | ||
| import ListContent from './components/ListContent'; | ||
|
|
||
| export default function List() { | ||
| return ( | ||
| <> | ||
| <GlobalStyle /> | ||
| <div css={wrapperStyle}> | ||
| <ListHeader /> | ||
| <ListContent /> | ||
| </div> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| const wrapperStyle = css` | ||
| width: 100%; | ||
| max-width: 430px; | ||
| height: 100%; | ||
| background: linear-gradient(#f8ff2e, #ffffff 40%); | ||
| border: 1px solid #1d1d1d; | ||
| `; |
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,18 @@ | ||
| import React from 'react'; | ||
| import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; | ||
|
|
||
| import List from './List'; | ||
| import App from './App'; | ||
|
|
||
| export default function RouterList() { | ||
| return ( | ||
| <div> | ||
| <Routes> | ||
| <Route path="/" element={<Navigate to="/list" />} /> | ||
| <Route path="/list" element={<List />} /> | ||
| <Route path="/chatroom/:chatId" element={<App />} /> | ||
| <Route path="*" element={<Navigate to="/list" />} /> | ||
|
Member
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. *로 path를 한번 더 설정한 이유가 있을까요? |
||
| </Routes> | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
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.
위 코드를 App에서 작성하신 이유가 있을까요 ? InputBox 안에서만 사용하는 코드인 것 같은데, InputBox 컴포넌트 내에서 선언 및 사용하시는게 좋을 것 같습니다. 불필요하게 props를 내려주고 있는 것 같아요 ~