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

Fix(게시글 클릭 가능 범위 확장) #104

Merged
merged 3 commits into from
Sep 23, 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
12 changes: 9 additions & 3 deletions src/pages/Notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,25 @@ function Notice() {
) : (
currentNotices.map((noticeItem, index) => (
<div className={noticeContainer} key={noticeItem.id}>
<div className={notice}>
<div onClick={() => toggleNotice(noticeItem.id)} className={notice}>
<div style={{ display: "flex", alignItems: "center" }}>
<p className={noticeNumber}>{index + 1 + (currentPage - 1) * itemsPerPage}</p>
{/* 공지사항의 renewal이 true일 경우 'New' 배지를 표시 */}
{noticeItem.renewal && <span className={newBadge}>중요</span>}
</div>

<div onClick={() => toggleNotice(noticeItem.id)} className={noticeContentWrapper}>
<div className={noticeContentWrapper}>
<p className={noticeTitle}>{noticeItem.title}</p>
</div>

{/* downbtn을 클릭하면 토글 */}
<button onClick={() => toggleNotice(noticeItem.id)} className={arrowButton}>
<button
onClick={(e) => {
e.stopPropagation(); // 이벤트 전파 방지
toggleNotice(noticeItem.id);
}}
className={arrowButton}
>
<span className="material-symbols-outlined">
{expandedNoticeId === noticeItem.id ? "arrow_drop_up" : "arrow_drop_down"}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Notice/notice.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const notice = style({
alignItems: "center",
flexDirection: "row",
position: "relative",
cursor: "pointer",
"@media": {
"(max-width: 375px)": {
//Iphone SE 같은 소형폰
Expand All @@ -115,7 +116,6 @@ export const noticeContentWrapper = style({
overflow: "hidden", // 넘치는 부분을 숨김
position: "relative",
marginLeft: 10,
cursor: "pointer",
});

export const noticeTitle = style({
Expand Down
12 changes: 8 additions & 4 deletions src/pages/QnA/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,23 @@ function QnA() {
) : (
currentNotices.map((QnaItem, index) => (
<div className={qnaContainer} key={QnaItem.id}>
<div className={qna}>
<div onClick={() => toggleQna(QnaItem.id)} className={qna}>
{/* 번호와 제목 표시 */}
<div style={{ display: "flex", alignItems: "center" }}>
<p className={qnaNumber}>{index + 1 + (currentPage - 1) * itemsPerPage}</p>
</div>

<div onClick={() => toggleQna(QnaItem.id)} className={qnaContentWrapper}>
<div className={qnaContentWrapper}>
<p className={qnaContent}>{QnaItem.title}</p>
</div>

{/* downbtn을 클릭하면 토글 */}
<button
onClick={() => toggleQna(QnaItem.id)}
className={arrowButton} // 스타일 추가
onClick={(e) => {
e.stopPropagation(); // 이벤트 버블링을 막음
toggleQna(QnaItem.id);
}}
className={arrowButton}
>
<span className="material-symbols-outlined">
{expandedQna.includes(QnaItem.id) ? "arrow_drop_up" : "arrow_drop_down"}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/QnA/qna.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const qna = style({
alignItems: "center",
flexDirection: "row",
position: "relative",
cursor: "pointer",
"@media": {
"(max-width: 375px)": {
//Iphone SE 같은 소형폰
Expand All @@ -83,7 +84,6 @@ export const qnaContentWrapper = style({
overflow: "hidden", // 넘치는 부분을 숨김
position: "relative",
marginLeft: 10,
cursor: "pointer",
});

export const qnaContent = style({
Expand Down