-
Notifications
You must be signed in to change notification settings - Fork 10
[4주차] 장자윤 과제 제춭합니다. #16
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
base: main
Are you sure you want to change the base?
Conversation
lemoncurdyogurt
left a comment
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.
과제하느라 수고하셨습니다! 절대경로 설정이나, svgr사용면에서 프로젝트 세팅적으로 신경쓴게 보여서 재밌게 보았습니다. 페이지 개발 완성도라던가, 프로젝트 폴더 구조등 여러면에서 디테일하게 개발한 것 같아보인 과제였습니다 @>---
다만 절대경로를 이후에 설정하면서 그대로 상대경로로 남아있는 부분이라던가, svgr을 제대로 활용안된게 보여서 아쉬웠습니다ㅠ.... 수고하셨어요!~!
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": "^19.1.1", | ||
| "react-dom": "^19.1.1", | ||
| "react-router-dom": "^7.9.4", | ||
| "styled-components": "^6.1.19", |
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.
tailwind.css랑 styled-components 패키지 둘 다 설치 되어있는데, 사용하는 패키지만 선택해서 삭제하면 좋을 것 같습니다!
| "typescript": "~5.8.3", | ||
| "typescript-eslint": "^8.44.0", | ||
| "vite": "^7.1.7", | ||
| "vite-plugin-svgr": "^4.5.0" |
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.
svgr로 사용하기 위해서 설치한 것으로 보이는데, 현재 코드에서 봤을 때 img형식으로 에셋들을 import해온 것으로 보입니다😢
svgr로 사용했을 때 에셋의 색상 변화를 적용할 수 가 있어서 active, inactive에 따른 에셋 다운 필요없이 하나만 다운받으면 된다는 장점이 있으니, 다시 한 번 사용방법 공부해보시고, 재적용해보셨으면 합니다!
| <ChatProvider> | ||
| <Router> | ||
| <div className="flex min-h-screen items-center justify-center"> | ||
| <div className="border-[ #815840] flex h-[812px] w-[375px] flex-col rounded-[20px] border-[5px]"> |
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.
| import StatusBar from '../components/MenuBar/StatusBar'; | ||
| import ChattingListHeader from '../components/MenuBar/ChattingListHeader'; | ||
| import BookmarkChattingList from '../components/ChattingList/BookmarkChattingList'; | ||
| import GeneralChattingList from '../components/ChattingList/GeneralChattingList'; |
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.
절대경로가 적용되지 않은 import문도 있어서 이런 부분들 수정해줘야할 것 같아요
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.
클래스나 컴포넌트 외에는 파일명이 소문자인게 좋아요. types/ 내 파일명들을 소문자로 유지해주는게 좋습니다.
| return ( | ||
| <div | ||
| key={room.roomId} | ||
| className="flex cursor-pointer py-2.5" | ||
| onClick={() => navigate(`/chat/${room.roomId}`)} | ||
| > | ||
| <div className="mr-[12.44px] h-13.5"> | ||
| <img src={ProfileIMGDefault} alt="친구프로필" className="h-13.5 w-13.5" /> | ||
| </div> | ||
| <div className="flex w-67.5 flex-col justify-center gap-0.5"> | ||
| <div className="flex items-center"> | ||
| <div className="flex flex-1 items-center gap-1"> | ||
| <div className="title4-sm">{room.name}</div> | ||
| <img src={FavoriteChatting} alt="즐겨찾기" className="relative top-[-1px] h-4 w-4" /> | ||
| </div> | ||
| <div className="flex-end caption2-reg" style={{ color: 'var(--color-gray-6)' }}> | ||
| {lastMessage ? formatTimeAMPM(lastMessage.sentAt.toISOString()) : ''} | ||
| </div> | ||
| </div> | ||
| <div className="caption1-reg">{lastMessage?.content || ''}</div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| })} | ||
| </div> | ||
| )} | ||
| </div> |
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.
이부분이 FavoriteChatting icon의 여부 외에는 스타일이 동일한 것 같은데 이 영역을 컴포넌트화 하고 props로 isGeneral: boolean으로 받아와 즐겨찾기 아이콘을 배치하는 것이 재사용면에서 좋아보여요!
| <div | ||
| key={room.roomId} | ||
| className="flex cursor-pointer py-2.5" | ||
| onClick={() => navigate(`/chat/${room.roomId}`)} | ||
| > |
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.
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.
| <div className="w-full cursor-pointer pb-1.25"> | ||
| <div className="flex flex-row rounded-[4px] bg-[#815840] p-2.5"> | ||
| <img src={ProflieIMGDefault} alt="유저프사" className="h-13.5 w-13.5" /> | ||
| <span className="title4-sm ml-[15px] flex items-center text-white">사용자</span> |
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.
사용자명 천영현으로 따로 있는데 의도적으로 사용자라고 텍스트를 이용한 것인지 궁금합니다!
| @@ -0,0 +1,36 @@ | |||
| import type { Config } from 'tailwindcss'; | |||
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.
tailwindcss 4버전 부터는 이 파일을 사용하지 않는다고 들었어요. 아마 적용이 안됐던 게 이거 때문일 수도 있을 거 같아요.
| @@ -0,0 +1,114 @@ | |||
| @import 'tailwindcss'; | |||
| @import '@/styles/font.css'; | |||
|
|
|||
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.
| <div className="border-[ #815840] flex h-[812px] w-[375px] flex-col rounded-[20px] border-[5px]"> | ||
| <div className={`${hideLowerMenubar ? 'flex-1' : 'flex-1 overflow-y-auto'}`}> | ||
| <Routes> | ||
| <Route path="/" element={renderPage()} /> |
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.
오픈 채팅이나, 쇼핑페이지 같은 걸 경로 구분없이 이렇게 렌더링 하는게 신기했습니다. 각자 장단점이 있는 거 같아요.



결과화면
느낀점 및 배운점
Review Questions
React Router의 동적 라우팅
동적 라우팅(Dynamic Routing)
사용 시기
사용 예시
네트워크 속도가 느린 환경에서 사용자 경험을 개선하기 위해 사용할 수 있는 UI/UX 디자인 전략과 기술 최적화 방법
UI/UX 전략
기술적 최적화 방법
React에서 useState와 useReducer를 활용한 지역 상태 관리와 Context API 및 전역 상태 관리 라이브러리의 차이점
(Redux, Zustand, Recoil)
배포 링크 : react-messenger-22nd-pi.vercel.app