-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [FEAT] 채팅방 리스트 보여주기 * [FEAT] 채팅방 디테일 수정 * [FEAT] 채팅방 제목 CSS 수정 * [FEAT] css 변경 * [CHORE] 파일 위치 및 css 변경 * [CHORE] 머지 해결 * [REFACTOR] Ranking y축 간격 오류 수정 * [FEAT] 사업체 플로팅 버튼 추가 * [FEAT] 사업체 채팅 ui 변경 * [CHORE] 오타 수정 * [FEAT] 알람 추가 * [FEAT] 주석 추가 * 주석추가 * [FEAT] 채팅 방 생성 추가 * [CHORE] 채팅 방 생성 제목 수정 * [REFACTOR] 결제 방법 제거 --------- Co-authored-by: sangminee <lsmlee99@gmail.com>
- Loading branch information
Showing
17 changed files
with
149 additions
and
46 deletions.
There are no files selected for viewing
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
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,74 @@ | ||
import React, {useState} from 'react'; | ||
import Button from "../../common/Button/Button"; | ||
import ChatApi from "../../../api/chatApi"; | ||
|
||
/** | ||
* 채팅방 생성하기 컴포넌트 | ||
* | ||
* @since 2024.03.12 | ||
* @author 이상민 | ||
*/ | ||
const CreateRoomForm = ({ onClose }) => { | ||
|
||
const [roomName, setRoomName] = useState(''); | ||
|
||
const createChatRoom = async (roomName) => { | ||
try { | ||
console.log("채팅방 생성 요청:", roomName); | ||
const response = await ChatApi.createChatRoom(roomName); | ||
console.log(response.data.data) | ||
console.log("채팅방 생성 성공:", roomName); | ||
onClose(); | ||
} catch (error) { | ||
console.error("채팅방 생성 오류:", error); | ||
} | ||
}; | ||
|
||
const handleSubmit = (event) => { | ||
event.preventDefault(); | ||
createChatRoom(roomName); | ||
}; | ||
|
||
return ( | ||
<div className="rounded-rectangle"> | ||
<form className="max-w-sm mx-auto p-4" onSubmit={handleSubmit} | ||
style={{ | ||
marginLeft: '20px', | ||
marginRight: '20px', | ||
marginTop: '215px', | ||
textAlign: 'center', | ||
justifyContent: 'center' | ||
}}> | ||
<label htmlFor="roomName" className="block mb-2 font-medium text-gray-900">문의사항이 있으신가요? </label> | ||
<input | ||
type="text" | ||
id="roomName" | ||
aria-describedby="helper-text-explanation" | ||
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" | ||
placeholder="ex) 더현대 서울 팝업 문의 드립니다." | ||
value={roomName} | ||
onChange={(e) => setRoomName(e.target.value)} // onChange 이벤트 핸들러를 올바르게 바인딩했는지 확인합니다. | ||
/> | ||
<div style={{ | ||
marginTop: '10px', | ||
textAlign: 'center', | ||
justifyContent: 'center' | ||
}}> | ||
{/* Button 컴포넌트의 onClick prop을 전달합니다. */} | ||
<Button text={<span className="flex items-center justify-center">채팅방 생성하기</span>} | ||
onClick={handleSubmit} | ||
onKeyDown={(e) => { | ||
if (e.key === 'Enter') { | ||
handleSubmit(e); | ||
} | ||
}}/> | ||
</div> | ||
</form> | ||
<button className="close-button" onClick={onClose}> | ||
뒤로가기 | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CreateRoomForm; |
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
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
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