Skip to content
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

수정/삭제, 신고 드롭다운 위치 수정 #298

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/asset/sass/etc/header/userInfoHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// margin-top:-0.3rem;
margin-top: -0.5rem;
font-size: 1.5rem;
font-family: 'pretendard-Bold';
font-family: 'Pretendard-Bold';
border: 0.1px solid #fefefe;
background-color: #ff8d1d;
color: #fff;
Expand Down Expand Up @@ -70,14 +70,16 @@ img.loginuser {

border-radius: 10px;
border-color: #d9d9d9;
margin-left: 92%;
margin-top: -12%;
}
}

.dropdown-question-detail-menu {
position: relative;
z-index: 500;
right: 6rem;
top: 6rem;
// right: 6rem;
// top: 6rem;

ul {
position: absolute;
Expand All @@ -96,6 +98,8 @@ img.loginuser {

border-radius: 10px;
border-color: #d9d9d9;
margin-left: 82%;
margin-top: -3%;
}

.dropdown-item {
Expand Down
57 changes: 26 additions & 31 deletions src/components/pages/postPage/questionDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ function QuestionDetailPage() {
};
try {
await fetchAPI(`/api/question/${questionId}`, 'DELETE', deleteBody);
if (confirm('삭제하시겠습니까?'))
showSuccessToast('질문이 삭제되었습니다.');
} catch (error) {
if (error instanceof Error) showErrorToast(error.message);
}
Expand Down Expand Up @@ -310,38 +312,31 @@ function QuestionDetailPage() {
<QuestionTitle>
<span>{questionTitle}</span>
<img onClick={handleEdit} src={Dot} alt="dot" />
{isShowEdit && (
<div className="dropdown-question-detail-menu">
<ul>
<li onClick={handleClickEdit} className="dropdown-item-edit">
수정
</li>

<li
onClick={handleClickDelete}
className="dropdown-item-delete"
>
삭제
</li>
{/*
*/}
</ul>
</div>
)}
{isShowReport ? (
<div className="dropdown-question-detail-report-menu">
<ul>
<li
onClick={toggleReportPopup}
className="dropdown-item-report"
>
신고
</li>
</ul>
</div>
) : null}
</QuestionTitle>

{isShowEdit && (
<div className="dropdown-question-detail-menu">
<ul>
<li onClick={handleClickEdit} className="dropdown-item-edit">
수정
</li>

<li onClick={handleClickDelete} className="dropdown-item-delete">
삭제
</li>
{/*
*/}
</ul>
</div>
)}
{isShowReport ? (
<div className="dropdown-question-detail-report-menu">
<ul>
<li onClick={toggleReportPopup} className="dropdown-item-report">
신고
</li>
</ul>
</div>
) : null}
<div className="questioner-info">
<Questioner>
<span>{questionerNickname || 'Anonymous'}</span>
Expand Down
Loading