-
Notifications
You must be signed in to change notification settings - Fork 9
[3주차] 안건희 미션 제출합니다 #14
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
GeonHeeAhn
wants to merge
35
commits into
CEOS-Developers:main
Choose a base branch
from
GeonHeeAhn:GeonHeeAhn
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
35 commits
Select commit
Hold shift + click to select a range
e441971
<feat> 하단 입력창 생성
GeonHeeAhn d4c2c5b
style : 파일명 변경
GeonHeeAhn 19e94f9
feat 상하단 고정, 스크롤 생성, 프로필 정보 입력
GeonHeeAhn b746733
feat : 프로필 클릭 시 변경
GeonHeeAhn 3434a4e
feat : 페이지 제목 변경, margin 값 제거
GeonHeeAhn 63ff16a
feat : input값 전송, 프로필 맞춰서 창에 띄우기(사진안뜸)
GeonHeeAhn 9f99612
feat: 새로운 메세지 프로필 오류 해결
GeonHeeAhn f0ed9ad
feat: 새로운 메세지 프로필 오류 해결, 공백 입력 불가(alert는 아직 안됨)
GeonHeeAhn e12e220
Merge branch 'main' of https://github.com/GeonHeeAhn/react-messenger-…
GeonHeeAhn b3abbfc
feat: 공백 입력시 alert
GeonHeeAhn 415635d
style : 상단 밑 공백 css 수정
GeonHeeAhn 3868e6a
style : 페이지 인덱스 icon 수정, 메세지 전송 창 css 수정
GeonHeeAhn 7fd72e7
feat : 공백 alert 에러 수정
GeonHeeAhn 60c7b4b
style: input창 css 수정
GeonHeeAhn ee89e9c
feat : 메세지가 보내진 시간 출력
GeonHeeAhn 6d88e74
style : css 수정 (input창, 채팅배경 설정, 프로필에 이미지 추가)
GeonHeeAhn 72c6824
feat: 시간 출력 코드 수정( 10분 이하일 때 두자리수로 나타내도록)
GeonHeeAhn 6466624
feat: 상단바 생성, 현재 시간 추가
GeonHeeAhn 596319a
fix : 불필요한 코드 및 주석 제거
GeonHeeAhn aa53dd9
vercel 오류 나서 올리는 커밋
GeonHeeAhn 259d0f5
vercel 오류 나서 올리는 커밋
GeonHeeAhn 0e95196
오류 나서 올리는 커밋...ㅠㅠ
GeonHeeAhn fa907e1
fix : vercel 오류 위한 커밋2...ㅠㅠ
GeonHeeAhn 06fa9d2
feat : 리액트 라우터 설치
GeonHeeAhn e223644
style : 프리티어 적용
GeonHeeAhn 3fc4f63
refactor : 폴더 생성 후 삽입
GeonHeeAhn e0faa9b
feat: 기본 구조 세팅
GeonHeeAhn e17d656
fix : 네비게이션 바 + 화면 구성
GeonHeeAhn 4410919
feat : search용 버튼, input 박스 구현
GeonHeeAhn 4a6b30e
style : 메인화면 css 수정 (네비게이션바와 친구목록 창 중첩되는 문제)
GeonHeeAhn 9681450
feat: setting 페이지 레이아웃
GeonHeeAhn 17be1c8
feat: 스크롤 코드 생성
GeonHeeAhn 1df408d
feat: 검색 기능 생성
GeonHeeAhn e1ff5bd
feat: 채팅목록 레이아웃 + 데이터 props로 받아 출력 성공
GeonHeeAhn 8fe7a87
feat:채팅목록에서 각각의 채팅방으로 이동하는 기능 구현
GeonHeeAhn 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,6 @@ | ||
| { | ||
| "trailingComma": "es5", | ||
| "tabWidth": 2, | ||
| "semi":true, | ||
| "singleQuote": true | ||
| } |
Large diffs are not rendered by default.
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
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 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.
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 |
|---|---|---|
| @@ -1,10 +1,45 @@ | ||
| import React from 'react'; | ||
| import { React, useState } from 'react'; | ||
| import styled from 'styled-components'; | ||
| import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom'; | ||
| import { chatData } from './Data'; | ||
| import Chat from './chat/Index'; | ||
| import Main from './main/Index'; | ||
| import ChatList from './chatList/Index'; | ||
| import Setting from './setting/Index'; | ||
| import MenuBar from './MenuBar'; | ||
|
|
||
| function App() { | ||
| const Container = styled.div` | ||
| display: flex; | ||
| flex-direction: row; | ||
| `; | ||
|
|
||
| function ChatOutput(){ | ||
| let {user} = useParams(); | ||
| return <div> {user} </div>; | ||
| } | ||
| export default function App(props) { | ||
| const [list, setList] = useState(chatData); | ||
| return ( | ||
| <div > 12기 프론트엔드 개발팀장 투표 ^.^ | ||
| </div> | ||
| <Router> | ||
| <Container> | ||
| <Link to="/"></Link> | ||
| <Link to="/chat"></Link> | ||
| <Link to="/chatlist"></Link> | ||
| <Link to="/setting"></Link> | ||
| <Route path={['/', '/chatlist', '/setting']} component={MenuBar} /> | ||
|
|
||
| <Switch> | ||
| <Route exact path="/" component={Main} /> | ||
| <Route path="/chatlist/:id" component={Chat} /> | ||
| {/* <Route path="/chat/:user" component={Chat} /> | ||
| <ChatOutput/> */} | ||
| <Route | ||
| path="/chatlist" | ||
| render={(props) => <ChatList {...props} list={list} />} | ||
| /> | ||
| <Route path="/setting" component={Setting} /> | ||
| </Switch> | ||
| </Container> | ||
| </Router> | ||
| ); | ||
| } | ||
|
|
||
| export default App; | ||
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,69 @@ | ||
| //이름 채팅데이터 아이디 프로필사진 | ||
|
|
||
| //아이디 내용 | ||
|
|
||
| export const userData = [ | ||
| { | ||
| name: '안건희', | ||
| id: 0, | ||
| profileImg: `${process.env.PUBLIC_URL}/profile1.jpg`, | ||
| }, | ||
| { | ||
| name: '고양이', | ||
| id: 1, | ||
| profileImg: `${process.env.PUBLIC_URL}/profile1.jpg`, | ||
| }, | ||
| { | ||
| name: '야옹이', | ||
| id: 2, | ||
| profileImg: `${process.env.PUBLIC_URL}/profile1.jpg`, | ||
| }, | ||
| { | ||
| name: '겸댕', | ||
| id: 3, | ||
| profileImg: `${process.env.PUBLIC_URL}/profile1.jpg`, | ||
| }, | ||
| ]; | ||
|
|
||
| export const chatData = [ | ||
|
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. 여기도 채팅...대박....저는 귀찮..아서 채팅을 다 안저장햇는데..해야겠어요ㅠㅠ |
||
| { | ||
| user:userData[0], | ||
| id:0, | ||
| chatText:[{ | ||
| user: userData[0], | ||
| text:'이렇게 하면 되나' | ||
| },{ | ||
| user: userData[1], | ||
| text:'웅야' | ||
| },{ | ||
| user: userData[1], | ||
| text:'그렇게 하면 돼' | ||
| }] | ||
| },{ | ||
| user:userData[1], | ||
| id:1, | ||
| chatText:[{ | ||
| user: userData[0], | ||
| text:'이렇게 하면 되나' | ||
| },{ | ||
| user: userData[1], | ||
| text:'웅야' | ||
| },{ | ||
| user: userData[1], | ||
| text:'그렇게 하면 돼' | ||
| }] | ||
| },{ | ||
| user:userData[2], | ||
| id:2, | ||
| chatText:[{ | ||
| user: userData[2], | ||
| text:'이렇게 하면 되나' | ||
| },{ | ||
| user: userData[1], | ||
| text:'웅야' | ||
| },{ | ||
| user: userData[2], | ||
| text:'그렇게 하면 돼' | ||
| }] | ||
| }, | ||
| ]; | ||
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,53 @@ | ||
| import styled from 'styled-components'; | ||
| import { Link } from 'react-router-dom'; | ||
|
|
||
| const Container = styled.div` | ||
| position: fixed; | ||
| width: 70px; | ||
| height: calc(100% - 50px); | ||
| background-color: rgb(66, 54, 48); | ||
| padding-top: 25px; | ||
| display:flex; | ||
| flex-direction:column; | ||
| align-content: center; | ||
| justify-content: space-between; | ||
| padding-bottom: 25px; | ||
| `; | ||
|
|
||
| const Contents = styled.img` | ||
| margin-left: 22px; | ||
| margin-top: 10px; | ||
| margin-bottom: 15px; | ||
| width: 26px; | ||
| height: 26px; | ||
| `; | ||
|
|
||
| const MiniContents = styled.img` | ||
| width: 18px; | ||
| height:18px; | ||
| margin-left: 26px; | ||
| margin-top:8px; | ||
| margin-bottom:8px; | ||
| `; | ||
| export default function MenuBar() { | ||
| return ( | ||
| <Container> | ||
| <div> | ||
| <Link to="/"> | ||
| <Contents src={process.env.PUBLIC_URL + 'person.png'} /> | ||
| </Link> | ||
| <Link to="/chatlist"> | ||
| <Contents src={process.env.PUBLIC_URL + 'chat.png'} /> | ||
| </Link> | ||
| <Link to="/setting"> | ||
| <Contents src={process.env.PUBLIC_URL + 'setting.png'} /> | ||
| </Link> | ||
| </div> | ||
| <div> | ||
| <MiniContents src={process.env.PUBLIC_URL + `calendar.png`}/> | ||
| <MiniContents src={process.env.PUBLIC_URL + `bell.png`}/> | ||
| <MiniContents src={process.env.PUBLIC_URL + `settingImg.png`}/> | ||
| </div> | ||
| </Container> | ||
| ); | ||
| } |
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,53 @@ | ||
| import styled from 'styled-components'; | ||
| import React from 'react'; | ||
|
|
||
| const Box = styled.form` | ||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: center; | ||
| height: 70px; | ||
| width: 100%; | ||
| bottom: 0px; | ||
| position: fixed; | ||
| background-color: rgb(237, 232, 234); | ||
| `; | ||
| const Input = styled.input` | ||
| height: 50px; | ||
| border-radius: 30px; | ||
| margin-left: 5%; | ||
| flex-grow: 5; | ||
| border: 1px solid rgb(204, 194, 180); | ||
| :focus{ | ||
| border: 1px solid rgb(204, 194, 180);; | ||
| outline: none; | ||
| } | ||
| `; | ||
|
|
||
| const Button = styled.button` | ||
| height: 50px; | ||
| flex-grow: 1; | ||
| margin-left: 10px; | ||
| margin-right: 5%; | ||
| border-radius: 30px; | ||
| background-color: rgb(222, 189, 164); | ||
| border: none; | ||
| :focus{ | ||
| border: none; | ||
| outline: none; | ||
| } | ||
| `; | ||
|
|
||
| export default function ChatInput(props){ | ||
| const {message,handleSubmit,handleChangeInput} = props; | ||
| return( | ||
| <Box onSubmit = {handleSubmit}> | ||
| <Input | ||
| type="text" | ||
| value={message} | ||
| placeholder = ' Please enter a message' | ||
| onChange = {handleChangeInput} | ||
| /> | ||
| <Button type="submit">전송</Button> | ||
| </Box> | ||
| ) | ||
| } |
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,44 @@ | ||
| import styled from 'styled-components'; | ||
| import MessageItem from './MessageItem'; | ||
| import { useEffect, useRef } from 'react'; | ||
| import {chatData} from '../Data'; | ||
|
|
||
| const Container = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| overflow-y: auto; | ||
| overflow-x: hidden; | ||
| position: fixed; | ||
| width: 100%; | ||
| top: 120px; | ||
| bottom: 70px; | ||
| background-image: url('./heart_bg.png'); | ||
| `; | ||
|
|
||
| export default function ChatList(props) { | ||
|
|
||
| const containerRef = useRef(null); | ||
| const list = props.chatData.chatText.map((item) => { | ||
| return <MessageItem chatItem={item} />; | ||
| }); | ||
|
|
||
| useEffect(() => { | ||
| containerRef.current.scrollTo(0, containerRef.current.scrollHeight); | ||
| }, [list]); | ||
|
|
||
| return <Container ref={containerRef}>{list}</Container>; | ||
| } | ||
| // export default function ChatList(props) { | ||
| // const { chatData } = props; | ||
| // const containerRef = useRef(null); | ||
| // const list = chatData.map((item) => { | ||
| // return <MessageItem chatItem={item} />; | ||
| // }); | ||
|
|
||
| // useEffect(() => { | ||
| // containerRef.current.scrollTo(0, containerRef.current.scrollHeight); | ||
| // }, [list]); | ||
|
|
||
| // return <Container ref={containerRef}>{list}</Container>; | ||
| // } | ||
|
|
||
|
Comment on lines
+31
to
+44
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. 주석은 지우는게 가독성에 더 좋을 것 같아요! |
||
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.
나중에 다른 홈페이지/랜딩페이지 추가를 대비해서 기본 path (/)는 랜딩페이지로, 친구목록은 다른 route를 써서 사용했으면 좋았을 것 같아요!