Skip to content

Commit

Permalink
[fix/#58]:랭킹 여백, 과목 편집 여백 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
doyi0107 committed Aug 25, 2024
1 parent 003d396 commit e084485
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 44 deletions.
1 change: 0 additions & 1 deletion app/mypage/subjectedit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function Page() {
};
const mypageSaveBtn = {
height: '60px',
fontWeight: '700',
};

return (
Expand Down
23 changes: 10 additions & 13 deletions app/ranking/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
height: 100%;
}

.tab_category{
margin-bottom: 20px;
}

.tab_category button {
position: relative;
display: block;
Expand Down Expand Up @@ -38,18 +42,15 @@
.tab_category button.active::after {
background-color: var(--main-color-3);
height: 3.5px;
/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
0 6px 14px rgba(0, 0, 0, 0.1); */
}

.btm {
/* width: 100%;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
0 8px 16px rgba(0, 0, 0, 0.1); */
/* margin-top: 30px;
padding-top: 50px; */
border-top-left-radius: 30px;
border-top-right-radius: 30px;
width: 100%;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-top: 30px;
padding-top: 30px;
border-top-left-radius: 40px;
border-top-right-radius: 40px;
background-color: #fff;
border: 1px solid #f1f1ff;
}
Expand All @@ -76,8 +77,4 @@
padding-top: 30px;
}

.btm {
padding: 15px;
padding-right: 7.5px;
}
}
48 changes: 23 additions & 25 deletions components/study/SubjectEditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export default function SubjectEditForm({
showCancelButton = true,
style,
subjectChoiceBoxStyle,
saveButtonStyle,
mypageSaveBtn,
}: {
onSaveEditing: () => void;
showCancelButton?: boolean;
style?: React.CSSProperties;
subjectChoiceBoxStyle?: React.CSSProperties;
saveButtonStyle?: React.CSSProperties;
mypageSaveBtn?: React.CSSProperties;
}) {
const [newSubjectName, setNewSubjectName] = useState<string>('');
Expand Down Expand Up @@ -85,31 +84,30 @@ export default function SubjectEditForm({
return;
}

const response = await subjectFormApi(payload);
if (response.success) {
resetAddedSubjects();
resetDeletedSubjects();
setEditing(false);
const response = await subjectFormApi(payload);
if (response.success) {
resetAddedSubjects();
resetDeletedSubjects();
setEditing(false);

// 알림만 id값 안쓰고 모두 과목명으로 알림
if (deletedSubjects.length > 0) {
alert(
`삭제한 과목은 ${deletedSubjects.map((subject) => subject.name).join(', ')} 입니다` +
(addedSubjects.length > 0
? `\n추가된 과목은 ${addedSubjects.map((subject) => subject.name).join(', ')} 입니다`
: ''),
);
} else {
if (addedSubjects.length > 0) {
alert(`추가된 과목은 ${addedSubjects.map((subject) => subject.name).join(', ')} 입니다`);
}}
onSaveEditing();
// 알림만:삭제,추가 name으로
if (deletedSubjects.length > 0) {
alert(
`삭제한 과목은 ${deletedSubjects.map((subject) => subject.name).join(', ')} 입니다` +
(addedSubjects.length > 0
? `\n추가된 과목은 ${addedSubjects.map((subject) => subject.name).join(', ')} 입니다`
: ''),
);
} else {
alert(`과목 편집 저장 실패: ${response.message}`);
};

if (addedSubjects.length > 0) {
alert(`추가된 과목은 ${addedSubjects.map((subject) => subject.name).join(', ')} 입니다`);
}
}
onSaveEditing();
} else {
alert(`과목 편집 저장 실패: ${response.message}`);
}

};

return (
<div className={styles.subject_edit_form_wrap_inner} style={style}>
Expand Down Expand Up @@ -151,7 +149,7 @@ export default function SubjectEditForm({
type="submit"
className={styles.subject_edit_form_btn_save}
onClick={handleSaveEditing}
style={saveButtonStyle}
style={mypageSaveBtn}
>
저장
</button>
Expand Down
7 changes: 4 additions & 3 deletions components/study/SubjectForm.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

.subject_choice_text_wrap {
width: 100%;
height: 60px;
height: 57px;
display: flex;
justify-content: flex-start;
align-items: center;
Expand Down Expand Up @@ -136,6 +136,7 @@
flex-wrap: wrap;
box-sizing: border-box;
padding-top: 5px;
padding-bottom: 15px;
gap: 15px;
row-gap: 15px;
overflow-y: auto;
Expand All @@ -146,7 +147,7 @@
.subject_item_wrapper {
position: relative;
display: inline-block;
max-width: 99%;
max-width: 100%;
}

.subject_item {
Expand Down Expand Up @@ -267,7 +268,7 @@
.subject_edit_form_btn_save,
.subject_edit_form_btn_modify {
font-size: 18px;
height: 56px;
height: 60px;
line-height: 30px;
border: none;
border-radius: 8px;
Expand Down
2 changes: 0 additions & 2 deletions store/subjectStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ interface Subject {
}


// selectedSubjects: 선택된 배열
// selectSubject: 선택 과목
interface SubjectStoreState {
subjects: Subject[];
initialSelectedSubjects: Subject[];
Expand Down

0 comments on commit e084485

Please sign in to comment.