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주차] 이희원 미션 제출합니다. #18

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
96c2ad7
docs : add emoji
hiwon-lee Sep 26, 2024
2e16a27
build : tailwind
hiwon-lee Sep 26, 2024
df164af
docs(chat) : 문서 생성
hiwon-lee Sep 26, 2024
adebfd0
docs : 이미지접근가능설정파일일
hiwon-lee Sep 26, 2024
b5cec87
feat : initial chat main
hiwon-lee Sep 26, 2024
97c1401
feat : component
hiwon-lee Sep 26, 2024
3463c6e
docs : redux 모듈 추가
hiwon-lee Sep 26, 2024
822b687
feat : initial redux 모듈 추가
hiwon-lee Sep 26, 2024
5ff3f4d
chore : redux 반영
hiwon-lee Sep 26, 2024
196b332
feat : add 상단 바
hiwon-lee Sep 26, 2024
d81dff1
feat : 컴퍼넌트 초기화
hiwon-lee Sep 26, 2024
8d7307b
feat : chat 페이지 초기화
hiwon-lee Sep 26, 2024
cb61405
feat(chat) : form
hiwon-lee Sep 26, 2024
1f8af7e
style : 전역 디자인 추가
hiwon-lee Sep 26, 2024
d76e700
docs : ChattingBox삭제 후, MessageItem 만듦
hiwon-lee Sep 26, 2024
d988ce2
docs : 대화 임시 파일
hiwon-lee Sep 26, 2024
dd8915d
feat : 채팅 submit후 ChatMain에 요소 반영
hiwon-lee Sep 26, 2024
dab9d07
docs : 주석 삭제
hiwon-lee Sep 26, 2024
d70c136
style(Form) : 디자인 수정
hiwon-lee Sep 26, 2024
79b81c5
docs : reset 스타일 링크 추가
hiwon-lee Sep 26, 2024
4dd1752
style(chatheader) : chore단위 수정
hiwon-lee Sep 26, 2024
813e044
style(chatmain) : 채팅 내역 영역 확장+ statusbar import 위치 변경
hiwon-lee Sep 26, 2024
ae0fbf3
style(chatmain) : 채팅 scroll, scroll-top 적용
hiwon-lee Sep 26, 2024
a2f97f1
chore(style) : 세부 디자인
hiwon-lee Sep 26, 2024
54f5a9d
feat(profile) : 프로필 클릭시 사용자 토글
hiwon-lee Sep 27, 2024
93ef66e
chore(style) : 수정
hiwon-lee Sep 27, 2024
880a426
refactor : user interface변경에 따른 수정
hiwon-lee Sep 27, 2024
0e9e3cb
feat : 채팅 날짜 추가
hiwon-lee Sep 27, 2024
36cda7a
style : 세부 디자인 수정
hiwon-lee Sep 27, 2024
84649d3
docs : 이모지 파일 위치 변경
hiwon-lee Sep 27, 2024
5f57e06
feat : 채팅 박스에 이모지 선택
hiwon-lee Sep 27, 2024
92e4d6c
style(MessageItem) : 최대 길이 수정
hiwon-lee Sep 29, 2024
68f730c
build : add styled-components
hiwon-lee Oct 7, 2024
06f9fcc
docs : 메뉴 이모지 파일 추가
hiwon-lee Oct 7, 2024
2337000
feat : add page route
hiwon-lee Oct 7, 2024
7e6a0b4
refact : craco-절대경로 적용
hiwon-lee Oct 7, 2024
65d2301
refact : 경로명, 스타일지정 라우팅수정
hiwon-lee Oct 15, 2024
5c21bc7
docs : bottom menu관련 설정 추가
hiwon-lee Oct 17, 2024
657b970
fix(BottomMenu) : .
hiwon-lee Oct 18, 2024
d010f87
docs : interface craco 모듈화
hiwon-lee Oct 18, 2024
de930b2
feat(member item) : 멤버 요소 아이템 프레임
hiwon-lee Oct 18, 2024
414c27b
docs : interface path추가
hiwon-lee Oct 18, 2024
f600528
style : fix
hiwon-lee Oct 22, 2024
3cb6209
chore : add placeholder attr
hiwon-lee Oct 22, 2024
2c0e24d
style : add search ui
hiwon-lee Oct 22, 2024
5d39249
docs : 사용자, 메시지 데이터
hiwon-lee Oct 30, 2024
30c080b
docs : 이모지 추가
hiwon-lee Oct 30, 2024
44e157a
docs : add user, messsage json data
hiwon-lee Oct 30, 2024
cfa7039
feat : 친구 리스트 불러오기...
hiwon-lee Oct 31, 2024
8ed9bd1
docs : fix 메시지, 사용자 데이터
hiwon-lee Oct 31, 2024
0468bf6
docs(.gitignore) : .vscode왜생겨 열받게
hiwon-lee Oct 31, 2024
0c0d2f7
style : fix global style
hiwon-lee Nov 1, 2024
1889e0d
docs : add users
hiwon-lee Nov 1, 2024
88f7cb7
style : ui frame
hiwon-lee Nov 1, 2024
de1b9df
docs : 사용자 id별 대화 데이터 생성
hiwon-lee Nov 2, 2024
dccc6bf
feat : uesrID기반 대화데이터 로컬스토리지에 저장
hiwon-lee Nov 2, 2024
381d93e
style : text-overflow : ellipsis
hiwon-lee Nov 2, 2024
2abdb07
docs : 주석 및 import정리
hiwon-lee Nov 2, 2024
69c7642
feat : 사용자별 채팅방 라우팅
hiwon-lee Nov 2, 2024
d86117d
feat : userID기반 채팅데이터 chatRoom에 넘김
hiwon-lee Nov 2, 2024
51a7f63
docs : redux 필요없는부분뺌
hiwon-lee Nov 2, 2024
0f295e6
fix : 프로필 클릭시 토글되는거
hiwon-lee Nov 2, 2024
b02ef8d
chore : 세부수정
hiwon-lee Nov 2, 2024
8e6cd76
docs : fix 시간데이터
hiwon-lee Nov 2, 2024
729d004
docs : add icon img
hiwon-lee Nov 2, 2024
07854eb
feat : 멤버별 프로필 라우팅
hiwon-lee Nov 2, 2024
1e68b77
chore : fix style
hiwon-lee Nov 2, 2024
82d36f4
refact : clean docs comment etc..
hiwon-lee Nov 2, 2024
32874be
refactor : add messageID
hiwon-lee Nov 2, 2024
813c92e
fix : message emoji 정상 반영, 리렌더링
hiwon-lee Nov 2, 2024
5cf5ef0
fix : data docs
hiwon-lee Nov 2, 2024
c25e0e0
chore : fix docs items
hiwon-lee Nov 2, 2024
0b0479a
chore : 오타수정
hiwon-lee Nov 2, 2024
9842c8b
chore : 주석,콘설 등 안쓰는거 삭제
hiwon-lee Nov 2, 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
Prev Previous commit
Next Next commit
docs : 주석 및 import정리
hiwon-lee committed Nov 2, 2024

Verified

This commit was signed with the committer’s verified signature.
ygrishajev Iaroslav Gryshaiev
commit 2abdb07e1daaff80a0ad721f52cc0c4eb560c84b
13 changes: 0 additions & 13 deletions src/hooks/useChatMessages.ts
Original file line number Diff line number Diff line change
@@ -43,19 +43,6 @@ function useChatMessages() {
});
localStorage.setItem('messageData', JSON.stringify(allUserMessages));
setChatData(allUserMessages);
// import('@data/messages_1.json').then((messages_1) => {
// import('@data/messages_2.json').then((messages_2) => {
// import('@data/messages_3.json').then((messages_3) => {
// const initialData: ChatData = {
// '1': messages_1.messages,
// '2': messages_2.messages,
// '3': messages_3.messages,
// };
// localStorage.setItem('chatData', JSON.stringify(initialData));
// setChatData(initialData);
// });
// });
// });
};

// 새로운 메시지 추가 함수
37 changes: 15 additions & 22 deletions src/pages/Chat/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { RootState } from '@redux/store';
import { useLocalStorage } from '@hooks/useLocalStorage';
import useChatMessages from '@hooks/useChatMessages';

import userList from '../../data/users.json';
import { MemberListItem } from '@components/MemberListItem';
import userList from '@data/users.json';
import Header from '@components/common/Header';
import { MainButton } from '@components/Button';
import BottomMenu from '@components/common/BottomMenu';
import Main from '@components/common/MainContent';
import { MainButton } from '@components/Button';
import StatusBar from '@components/common/StatusBar';
import { MemberListItem } from '@components/MemberListItem';
import Form from '@components/Form';
import { useEffect } from 'react';
import useChatMessages from '@hooks/useChatMessages';

export default function Chat() {
const userName = useSelector((state: RootState) => state.user.name);
@@ -27,12 +26,20 @@ export default function Chat() {
// TODO : 각 json파일을 배열에 담고
// TODO : map함수를 활용해서 채팅상대이름, 최근채팅미리보기, 채팅상대 프로필이미지 가 담긴 아이템을 나열해서 리스트로 완성
// TODO : ~를 통합한 custom hook 구현

useEffect(() => {
console.log('chat');
console.log(chatData);
});

// TODO :
// TODO : 아이디에 맞는 사용자 이름 가져와

const userNames: { [key: string]: string } = {};
userList.forEach((user) => {
userNames[user.id] = user.userName;
});
// TODO : 채팅 리스트 컴퍼넌트 구현

return (
<div className="h-full flex flex-col">
<StatusBar />
@@ -57,26 +64,12 @@ export default function Chat() {
<MemberListItem
key={userId}
_id={userId}
name={`${userId}`}
name={userNames[userId] || '(알 수 없음)'}
lastMessage={lastMessageInfo.message}
lastTimeStamp={lastMessageInfo.timeStamp}
/>
);
})}
{userList.map((user, idx) => (
<MemberListItem
key={user.id}
_id={user.id}
name={user.userName}
lastMessage="꺼져"
lastTimeStamp="오후 10:34"
/>
// <MemberListItem
// _id={user.id}
// name={user.userName}
// profileImg={user.profileImg}
// />
))}
</Main>

<BottomMenu />