-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Ravende/feat/FEBE
[FE] feat: review->write 컴포넌트 전환 추가
- Loading branch information
Showing
11 changed files
with
144 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
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
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 |
---|---|---|
@@ -1,16 +1,44 @@ | ||
import "./write.css" | ||
import React, { useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import './write.css'; | ||
import { Review } from '../review'; | ||
|
||
export function Write() { | ||
return ( | ||
const navigate = useNavigate(); | ||
const [activeComponent, setActiveComponent] = useState('review'); | ||
|
||
<div className= "write-box"> | ||
<div id = "review-name">평점</div> | ||
<div className = "write"> | ||
const [reviewText, setReviewText] = useState(''); | ||
|
||
<div id = "write-text">자리가 편해서 오래 공부하기 좋아요.</div> | ||
</div> | ||
const handleSave = () => { | ||
// Save the entered text (reviewText) as needed (e.g., to a database or state) | ||
// For now, let's log it to the console | ||
console.log('Saved review text:', reviewText); | ||
|
||
</div> | ||
// Transition to the Review component | ||
navigate('/review?text=' + encodeURIComponent(reviewText)); | ||
|
||
const goReview = () => { | ||
setActiveComponent('review'); | ||
}; | ||
}; | ||
|
||
); | ||
} | ||
return ( | ||
<div className="write-box"> | ||
<div id="review-name">평점</div> | ||
<div className="write"> | ||
<textarea | ||
id="write-text" | ||
placeholder="여기에 리뷰를 작성하세요." | ||
value={reviewText} | ||
onChange={(e) => setReviewText(e.target.value)} | ||
></textarea> | ||
</div> | ||
{/* {activeComponent === 'review' && <Review />} | ||
*/} | ||
<button className="save-button" onClick={handleSave}> | ||
{/* <button className = "save-button" onClick={goReview}>*/} | ||
저장하기 | ||
</button> | ||
</div> | ||
); | ||
} |
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