-
Notifications
You must be signed in to change notification settings - Fork 2
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
FE-feat/issue-100 #117
Merged
+465
−190
Merged
FE-feat/issue-100 #117
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0f63794
Chore: 공통 폴더 이동 및 파일 분리
KimKyuHoi 8e337f5
Fix: 파일 경로 설정
DingX2 6fd0855
Merge branch 'develop' of https://github.com/On-derDog/TadakTadak int…
DingX2 5dead82
Fix: sidebar 여백 수정
DingX2 c92e335
Refactor: 비슷한 파일이름변경
DingX2 779e0ce
Feat: Wrapper 설정 및 Modal 추가
DingX2 a8d0acf
Fix: 로그인성공 헤더로 구분
DingX2 2616ac6
Feat: 모달창 생성중
DingX2 8cf0236
Merge branch 'develop' of https://github.com/On-derDog/TadakTadak int…
DingX2 5628d40
Feat: 방생성 api 확인필요
DingX2 417596d
Design: CreateRoom CSS 작업완료
DingX2 8ea98bb
Fix: z-index로 모달창 위치 올리기
DingX2 830b9ba
Feat: Username 가져오기
DingX2 b91da31
Feat: 방 생성확인, 리스트생성 Store 생성
DingX2 e7d03bd
Fix: layout 복구
DingX2 c498940
Feat: 전체방 불러오기 zustand, api 작성
DingX2 3f12a42
Refactor: 10초간격으로 가져오기
DingX2 0e365fc
Feat: Reactquery로 방불러오기
DingX2 9e8a309
Feat: 홈- 채팅방 연결
DingX2 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
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 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,88 @@ | ||
import EmailSVG from "../../assets/Email.svg" | ||
import UserSVG from "../../assets/User.svg" | ||
import PasswordSVG from "../../assets/Password.svg" | ||
|
||
import styled from "@emotion/styled"; | ||
|
||
interface InputFormProps { | ||
type: string; | ||
name: string; | ||
value: string; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
placeholder: string; | ||
title: string; | ||
imgSVG: string; | ||
} | ||
|
||
function ChangeSVG(imgSVG: string){ | ||
switch(imgSVG){ | ||
case "Email": | ||
return EmailSVG; | ||
case "User": | ||
return UserSVG; | ||
case "Password": | ||
return PasswordSVG; | ||
} | ||
} | ||
|
||
export const InputForm = ({ type, name, value, onChange, title, imgSVG, ...rest }: InputFormProps) => { | ||
return ( | ||
<InputFormWrapper> | ||
<p>{title}</p> | ||
<InputFormContainer> | ||
{imgSVG && ( | ||
<picture> | ||
<img src={ChangeSVG(imgSVG)} alt="img" /> | ||
</picture> | ||
)} | ||
{type === 'number' ? ( | ||
<StyledSelect name={name} value={value} onChange={onChange}> | ||
{[1, 2, 3, 4, 5, 6].map((option) => ( | ||
<option key={option} value={option}> | ||
{option} 명 | ||
</option> | ||
))} | ||
</StyledSelect> | ||
) : ( | ||
<input type={type} name={name} value={value} onChange={onChange} {...rest} /> | ||
)} | ||
</InputFormContainer> | ||
</InputFormWrapper> | ||
); | ||
}; | ||
|
||
const InputFormWrapper = styled.section` | ||
p { | ||
font-size: var(--font-size-xs); | ||
margin: 0; | ||
padding: 1rem 0.5rem 0.3rem; | ||
} | ||
` | ||
|
||
const InputFormContainer = styled.div` | ||
height: 44px; | ||
display: flex; | ||
gap: 16px; | ||
align-items: center; | ||
border-radius: 10px; | ||
padding: 0 11px; | ||
|
||
picture { | ||
|
||
} | ||
|
||
input { | ||
font-size: var(--font-size-xs); | ||
border: none; | ||
outline: none; | ||
} | ||
|
||
border: solid 1px var(--color-crusta) | ||
` | ||
|
||
const StyledSelect = styled.select` | ||
width: 100%; | ||
border: none; | ||
padding: 8px; | ||
outline: none; | ||
`; |
Empty file.
29 changes: 0 additions & 29 deletions
29
frontend/src/components/chattingRoomList/ChattingRoomList.tsx
This file was deleted.
Oops, something went wrong.
This file contains 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
File renamed without changes.
This file contains 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,82 @@ | ||
import React from 'react'; | ||
import { InputForm } from '../../components/auth/InputForm'; | ||
import axios from 'axios'; | ||
import styled from "@emotion/styled" | ||
import Close from "../../assets/Close.svg" | ||
import { Button } from '../common/Button'; | ||
|
||
interface CreateRoomPreviewProps { | ||
onClose: () => void; | ||
onAddRoom: () => void; | ||
username: string; | ||
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
newRoom: { roomName: string; description:string; owner:string; hashtag: string; capacity: number; }; | ||
} | ||
|
||
const CreateRoomPreview: React.FC<CreateRoomPreviewProps> = ({ onClose, onAddRoom, newRoom, username, handleInputChange }) => { | ||
const handleAddRoomClick = async () => { | ||
try { | ||
const roomWithOwner = { ...newRoom, owner: username }; | ||
console.log(roomWithOwner); | ||
await axios.post('http://localhost:8001/user-service/create', roomWithOwner); | ||
|
||
onAddRoom(); | ||
onClose(); | ||
} catch (error) { | ||
console.error('Error creating room:', error); | ||
} | ||
}; | ||
|
||
return ( | ||
<CreateRoomPreviewWrapper> | ||
<StyledCloseButton onClick={onClose} > | ||
<img src={Close} alt='Close' width="16px"/> | ||
</StyledCloseButton> | ||
<h1>Create Room</h1> | ||
<InputForm type="text" name="roomName" value={newRoom.roomName} title="방 이름" onChange={handleInputChange} /> | ||
<InputForm type="text" name="description" value={newRoom.description} title="방 설명" onChange={handleInputChange} /> | ||
<InputForm type="text" name="hashtag" value={newRoom.hashtag} title="해시태그" onChange={handleInputChange} /> | ||
<InputForm | ||
type="number" | ||
name="capacity" | ||
value={newRoom.capacity.toString()} | ||
title="인원 수" | ||
onChange={handleInputChange} | ||
/> | ||
<br/> | ||
<Button onClick={handleAddRoomClick} label="Create Room" backgroundColor="primary"/> | ||
</CreateRoomPreviewWrapper> | ||
); | ||
}; | ||
|
||
export default CreateRoomPreview; | ||
|
||
const CreateRoomPreviewWrapper = styled.main` | ||
z-index:1000; | ||
position: fixed; | ||
top: 50%; | ||
left: 30%; | ||
transform: translate(-50%, -50%); | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
flex-shrink: 0; | ||
padding: 2rem; | ||
border: solid 1px var(--color-wildsand); | ||
border-radius: 0.3125rem; | ||
background: var(----white-color, #FFF); | ||
|
||
h1 { | ||
color: #000; | ||
text-align: center; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
} | ||
` | ||
|
||
const StyledCloseButton = styled.button` | ||
display: flex; | ||
margin-left: auto; | ||
border: none; | ||
background: none; | ||
`; |
This file contains 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 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,35 @@ | ||
import { RoomPreview } from "./RoomPreview"; | ||
import styled from '@emotion/styled'; | ||
|
||
const RoomPreviewList = () => { | ||
return ( | ||
<RoomPreviewListWrapper> | ||
<RoomPreviewListSection> | ||
|
||
{/* Grid */} | ||
<ChattingRoomListGridContainer> | ||
{Array.from({ length: 20 }).map((_, index) => ( | ||
<RoomPreview key={index} /> | ||
))} | ||
</ChattingRoomListGridContainer> | ||
|
||
</RoomPreviewListSection> | ||
</RoomPreviewListWrapper> | ||
) | ||
}; | ||
|
||
export default RoomPreviewList; | ||
|
||
|
||
const RoomPreviewListWrapper = styled.main` | ||
|
||
` | ||
|
||
const RoomPreviewListSection = styled.section` | ||
` | ||
|
||
export const ChattingRoomListGridContainer = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(5, 1fr); | ||
gap: 16px; | ||
`; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
frontend/src/components/Search.tsx → frontend/src/components/welcome/Search.tsx
This file contains 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 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 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 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
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.
전역변수 쓰세요. 새로 선언하지 마시고 있는거 가지고 와서 씁시다.
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.
확인했습니다!