From 723e79e8d4b4e65e770f5abefcd50bea51fa831d Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 14:00:27 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20post=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/board/postDetail/styled.ts | 7 +++---- .../users/components/InactiveUserTab/InactiveUserRow.tsx | 4 +++- src/stores/models/UserModel.ts | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/board/postDetail/styled.ts b/src/pages/board/postDetail/styled.ts index 3aa9ce34..e8ea9f19 100644 --- a/src/pages/board/postDetail/styled.ts +++ b/src/pages/board/postDetail/styled.ts @@ -1,15 +1,14 @@ import styled from '@emotion/styled'; export const PostContent = styled.p` - background-color: red; width: 100%; padding: 0; height: auto; font-size: 14px; line-height: 1.5; - > p { - width: 100%; - height: 100%; + img { + max-width: 100%; + height: auto; } `; diff --git a/src/pages/setting/users/components/InactiveUserTab/InactiveUserRow.tsx b/src/pages/setting/users/components/InactiveUserTab/InactiveUserRow.tsx index 956dbbea..2a03064f 100644 --- a/src/pages/setting/users/components/InactiveUserTab/InactiveUserRow.tsx +++ b/src/pages/setting/users/components/InactiveUserTab/InactiveUserRow.tsx @@ -14,7 +14,9 @@ export const InactiveUserRow: React.FC<{ model: Model.User }> = memo(({ model }) return ( - {model.nameWithAdmission} + + {model.nameWithAdmission} {model.state === 'DROP' ? '(추방)' : '(탈퇴)'} + diff --git a/src/stores/models/UserModel.ts b/src/stores/models/UserModel.ts index bdfab0e4..76f29ba1 100644 --- a/src/stores/models/UserModel.ts +++ b/src/stores/models/UserModel.ts @@ -30,6 +30,7 @@ export class UserModel { studentId?: string; circleIds?: string[]; circleNames?: string[]; + state: User.UserDto['state']; constructor(props: User.UserDto) { this.id = props.id; @@ -41,6 +42,7 @@ export class UserModel { this.studentId = props.studentId; this.circleIds = props.circleIdIfLeader ?? []; this.circleNames = props.circleNameIfLeader ?? []; + this.state = props.state; } get roleTxt(): string { From a175b24d8cfec2d6b66f5f2bd2eb9c9e1c2ab8d6 Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 15:01:50 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=EA=B8=B0=EB=B3=B8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EA=B5=AC=ED=98=84=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/SettingProfilePageUiStore.ts | 5 ++++ .../components/ProfileImage/ProfileImage.tsx | 28 +++++++++++++++---- .../profile/components/ProfileImage/styled.ts | 20 ++++++++++++- src/stores/models/AuthorModel.ts | 3 +- src/stores/models/UserModel.ts | 9 ++++-- 5 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/pages/setting/profile/SettingProfilePageUiStore.ts b/src/pages/setting/profile/SettingProfilePageUiStore.ts index 08a96e8a..0f7231c1 100644 --- a/src/pages/setting/profile/SettingProfilePageUiStore.ts +++ b/src/pages/setting/profile/SettingProfilePageUiStore.ts @@ -34,6 +34,9 @@ export class SettingProfilePageUiStore { this.file = file; this.blobUrl = URL.createObjectURL(file); + } else { + this.file = null; + this.blobUrl = undefined; } } @@ -53,6 +56,8 @@ export class SettingProfilePageUiStore { IMAGE_TYPE.USER_PROFILE, this.file, )) as string; + } else { + body.profileImage = ''; } yield Repo.update(body); diff --git a/src/pages/setting/profile/components/ProfileImage/ProfileImage.tsx b/src/pages/setting/profile/components/ProfileImage/ProfileImage.tsx index cffbfce9..a7f5e5cc 100644 --- a/src/pages/setting/profile/components/ProfileImage/ProfileImage.tsx +++ b/src/pages/setting/profile/components/ProfileImage/ProfileImage.tsx @@ -1,7 +1,7 @@ import { observer } from 'mobx-react-lite'; -import React, { useEffect, useRef } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; -import { Button, TempImage } from './styled'; +import { Button, TempImage, BasicProfileButton } from './styled'; import { usePageUiStore } from '@/hooks'; import { useRootStore } from '@/stores/RootStore'; @@ -12,7 +12,11 @@ export const ProfileImage: React.FC = observer(() => { } = useRootStore(); const { blobUrl, setFile } = usePageUiStore(); const ref = useRef(null); - const handleClick = () => ref.current?.click(); + const [basicProfile, setBaisicProfile] = useState(false); + const handleClick = () => { + setBaisicProfile(false); + ref.current?.click(); + }; useEffect(() => { const input = document.createElement('input'); @@ -23,8 +27,20 @@ export const ProfileImage: React.FC = observer(() => { }, []); return ( - + <> + + { + setBaisicProfile(true); + setFile(null); + }} + > + 기본 이미지 변경 + + ); }); diff --git a/src/pages/setting/profile/components/ProfileImage/styled.ts b/src/pages/setting/profile/components/ProfileImage/styled.ts index e23ef938..30b5645c 100644 --- a/src/pages/setting/profile/components/ProfileImage/styled.ts +++ b/src/pages/setting/profile/components/ProfileImage/styled.ts @@ -6,7 +6,7 @@ import { ClearButton, ProfileImageBox } from '@/components'; export const Button = styled(ClearButton)` position: relative; display: block; - margin: 10px auto 20px; + margin: 10px auto -6px; `; export const TempImage = styled(ProfileImageBox)` @@ -24,6 +24,24 @@ export const TempImage = styled(ProfileImageBox)` } `; +export const BasicProfileButton = styled(ClearButton)` + position: relative; + margin: 10px auto 20px; + display: block; + + font-size: 12px; + color: white; + + bottom: 0; + width: 120px; + height: 20px; + + border-radius: 10px; + background-color: #312ed7; + border: 1px solid #312ed7; + overflow: hidden; +`; + export const ProfileIcon = styled(FaceRetouchingNaturalIcon)` position: absolute; right: -25px; diff --git a/src/stores/models/AuthorModel.ts b/src/stores/models/AuthorModel.ts index b4357505..9319a89f 100644 --- a/src/stores/models/AuthorModel.ts +++ b/src/stores/models/AuthorModel.ts @@ -6,7 +6,8 @@ export class AuthorModel { constructor(admissionYear: number, name: string, profileImage: string | null) { this.admissionYear = admissionYear; this.name = name; - this.profileImage = profileImage ?? '/images/default_profile.png'; + this.profileImage = + !profileImage || profileImage === '' ? '/images/default_profile.png' : profileImage; } get nameWithAdmission(): string { diff --git a/src/stores/models/UserModel.ts b/src/stores/models/UserModel.ts index 76f29ba1..e25816f3 100644 --- a/src/stores/models/UserModel.ts +++ b/src/stores/models/UserModel.ts @@ -38,7 +38,10 @@ export class UserModel { this.name = props.name; this.admissionYear = props.admissionYear; this.role = props.role; - this.profileImage = props.profileImage ?? '/images/default_profile.png'; + this.profileImage = + !props.profileImage || props.profileImage === '' + ? '/images/default_profile.png' + : props.profileImage; this.studentId = props.studentId; this.circleIds = props.circleIdIfLeader ?? []; this.circleNames = props.circleNameIfLeader ?? []; @@ -54,7 +57,9 @@ export class UserModel { } get profileImageSrc(): string { - return this.profileImage ?? '/images/default_profile.png'; + return !this.profileImage || this.profileImage === '' + ? '/images/default_profile.png' + : this.profileImage; } get isStudent(): boolean { From 4ab3385872fa31890c5a61530b7840f75009dd71 Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 16:13:13 +0900 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=EB=8F=99=EC=95=84=EB=A6=AC=20?= =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EC=83=9D=EC=84=B1=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auth/useTerms/UseTermsPage.tsx | 11 ++- .../board/boardCreate/BoardCreatePage.tsx | 82 +++++++++---------- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/pages/auth/useTerms/UseTermsPage.tsx b/src/pages/auth/useTerms/UseTermsPage.tsx index 9e4f146c..fb073ae6 100644 --- a/src/pages/auth/useTerms/UseTermsPage.tsx +++ b/src/pages/auth/useTerms/UseTermsPage.tsx @@ -1,3 +1,4 @@ +import styled from '@emotion/styled'; import { observer } from 'mobx-react-lite'; import React from 'react'; import { useHistory, generatePath } from 'react-router-dom'; @@ -15,6 +16,11 @@ import { import { PAGE_URL } from '@/configs/path'; import { useRootStore } from '@/stores/RootStore'; +const Title = styled.div` + font-size: 18px; + font-weight: bold; +`; + const UseTermsPage: React.FC = observer(() => { const { replace, push } = useHistory(); const { @@ -31,7 +37,7 @@ const UseTermsPage: React.FC = observer(() => {
- 서비스 이용약관 + 서비스 이용약관
제1조(목적)
@@ -427,9 +433,10 @@ const UseTermsPage: React.FC = observer(() => { 서비스와 관련하여 분쟁이 발생한 경우 관할법원은 위원회 소재지 관할법원으로 정하며, 준거법은 대한민국의 법령을 적용합니다.
-
부 칙

+ 부 칙 +
제1조(시행일)
본 약관은 2024.03.07부터 시행됩니다.  

diff --git a/src/pages/board/boardCreate/BoardCreatePage.tsx b/src/pages/board/boardCreate/BoardCreatePage.tsx index 8f9c0042..82a0e28d 100644 --- a/src/pages/board/boardCreate/BoardCreatePage.tsx +++ b/src/pages/board/boardCreate/BoardCreatePage.tsx @@ -37,7 +37,7 @@ const BoardCreatePage: React.FC = observer(() => { name: undefined, description: undefined, category: '공지 게시판', - circleName: '전체', + circleName: '', }, }); @@ -54,47 +54,43 @@ const BoardCreatePage: React.FC = observer(() => { createRoleList: [], circleId: null, }; - if (me?.isCircleLeader && data.circleName !== '전체') { - //동아리장이 동아리 게시판을 생성하는 경우 - if (data.category === '동아리 공지 게시판') { - body.createRoleList = ['ADMIN', 'VICE_PRESIDENT', 'PRESIDENT', 'LEADER_CIRCLE']; - body.circleId = - me.circleIds![me.circleNames!.findIndex(circleName => circleName === data.circleName)]; - } else if (data.category === '동아리 자유 게시판') { - body.createRoleList = [ - 'ADMIN', - 'VICE_PRESIDENT', - 'PRESIDENT', - 'LEADER_CIRCLE', - 'LEADER_1', - 'LEADER_2', - 'LEADER_3', - 'LEADER_4', - 'COUNCIL', - 'COMMON', - ]; - body.circleId = - me.circleIds![me.circleNames!.findIndex(circleName => circleName === data.circleName)]; - } - } else { - //학생회장 혹은 관리자가 동아리 게시판을 생성하는 경우 - if (data.category === '공지 게시판') { - body.createRoleList = ['ADMIN', 'VICE_PRESIDENT', 'PRESIDENT', 'COUNCIL']; - } else if (data.category === '자유 게시판') { - body.createRoleList = [ - 'ADMIN', - 'VICE_PRESIDENT', - 'PRESIDENT', - 'LEADER_CIRCLE', - 'LEADER_1', - 'LEADER_2', - 'LEADER_3', - 'LEADER_4', - 'COUNCIL', - 'COMMON', - ]; - } + + if (me && data.category === '동아리 공지 게시판') { + body.createRoleList = ['ADMIN', 'VICE_PRESIDENT', 'PRESIDENT', 'LEADER_CIRCLE']; + body.circleId = + me.circleIds![me.circleNames!.findIndex(circleName => circleName === data.circleName)]; + } else if (me && data.category === '동아리 자유 게시판') { + body.createRoleList = [ + 'ADMIN', + 'VICE_PRESIDENT', + 'PRESIDENT', + 'LEADER_CIRCLE', + 'LEADER_1', + 'LEADER_2', + 'LEADER_3', + 'LEADER_4', + 'COUNCIL', + 'COMMON', + ]; + body.circleId = + me.circleIds![me.circleNames!.findIndex(circleName => circleName === data.circleName)]; + } else if (me && data.category === '공지 게시판') { + body.createRoleList = ['ADMIN', 'VICE_PRESIDENT', 'PRESIDENT', 'COUNCIL']; + } else if (me && data.category === '자유 게시판') { + body.createRoleList = [ + 'ADMIN', + 'VICE_PRESIDENT', + 'PRESIDENT', + 'LEADER_CIRCLE', + 'LEADER_1', + 'LEADER_2', + 'LEADER_3', + 'LEADER_4', + 'COUNCIL', + 'COMMON', + ]; } + const { success } = (await create(body)) as unknown as StoreAPI; if (success) { replace(PAGE_URL.Board); @@ -104,8 +100,10 @@ const BoardCreatePage: React.FC = observer(() => { useEffect(() => { fetch(); - if (me?.isCircleLeader && !(me.isAdmin || me.isPresidents)) + if (me?.isCircleLeader) { setValue('circleName', me.circleNames![0]); + setValue('category', '동아리 공지 게시판'); + } }, []); return ( From 5b6e627eae7e7cef5f1f15e6fee8e984bcef56a5 Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 16:15:40 +0900 Subject: [PATCH 4/7] =?UTF-8?q?chore:=20=EC=82=AC=EB=AC=BC=ED=95=A8=20?= =?UTF-8?q?=EC=97=B0=EC=9E=A5=ED=95=98=EA=B8=B0=20=EB=B9=84=ED=99=9C?= =?UTF-8?q?=EC=84=B1=ED=99=94=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locker/locations/components/SubmitButton/SubmitButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/locker/locations/components/SubmitButton/SubmitButton.tsx b/src/pages/locker/locations/components/SubmitButton/SubmitButton.tsx index 4624ab26..f8b70b0a 100644 --- a/src/pages/locker/locations/components/SubmitButton/SubmitButton.tsx +++ b/src/pages/locker/locations/components/SubmitButton/SubmitButton.tsx @@ -30,7 +30,7 @@ export const SubmitButton = observer(() => { return ( - {isSelectedMine ? ( + {/* {isSelectedMine ? ( // TODO : 반복 버튼 컴포넌트 만들기 { > 연장하기 - ) : null} + ) : null} */} {isSelectedMine ? '반환하기' : '신청하기'} From c3f7db6a115289821b3565298748b575f5117cf4 Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 16:53:39 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=EB=8C=80=EB=8C=93=EA=B8=80=20UI=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CommentInput/CommentInputView.tsx | 8 +++++++- .../components/ReplyComment/PostReplyComments.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/board/postDetail/components/CommentInput/CommentInputView.tsx b/src/pages/board/postDetail/components/CommentInput/CommentInputView.tsx index 9b76c3b5..4ddc9fc4 100644 --- a/src/pages/board/postDetail/components/CommentInput/CommentInputView.tsx +++ b/src/pages/board/postDetail/components/CommentInput/CommentInputView.tsx @@ -2,6 +2,7 @@ import SendIcon from '@mui/icons-material/Send'; import { observer } from 'mobx-react-lite'; import { useEffect, useRef, useState } from 'react'; import { useFormContext } from 'react-hook-form'; +import { useHistory } from 'react-router-dom'; import { Form, InputBox, SendButton, Textarea } from './styled'; @@ -16,6 +17,9 @@ export const CommentInputView: React.FC = observer(({ onSubmit }) => { const { register, setFocus, setValue } = useFormContext(); const { ref, ...rest } = register('content'); const [isFocus, setIsFocus] = useState(false); + const { + location: { pathname }, + } = useHistory(); useEffect(() => { const { isEdit, isReply, target } = commentInput; @@ -25,6 +29,8 @@ export const CommentInputView: React.FC = observer(({ onSubmit }) => { setValue('content', content); }, [commentInput, setFocus, setValue]); + console.log(pathname.indexOf('comment')); + return (
@@ -35,7 +41,7 @@ export const CommentInputView: React.FC = observer(({ onSubmit }) => { }} minRows={1} maxRows={3} - placeholder="댓글 내용 입력" + placeholder={pathname.indexOf('comment') === -1 ? '댓글 내용 입력' : '답글 내용 입력'} onFocus={() => setIsFocus(true)} {...rest} /> diff --git a/src/pages/board/postDetail/components/ReplyComment/PostReplyComments.tsx b/src/pages/board/postDetail/components/ReplyComment/PostReplyComments.tsx index c5b1d558..e6548ab8 100644 --- a/src/pages/board/postDetail/components/ReplyComment/PostReplyComments.tsx +++ b/src/pages/board/postDetail/components/ReplyComment/PostReplyComments.tsx @@ -50,7 +50,7 @@ export const PostReplyComments: React.FC = observer(() => { return parent ? ( - 전체 댓글 + 전체 댓글로 이동하기 Date: Thu, 7 Mar 2024 17:02:23 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=EA=B6=8C=ED=95=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20API=20=EC=88=98=EC=A0=95=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/user.d.ts | 6 +++--- src/stores/repositories/UserRepo.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/@types/user.d.ts b/src/@types/user.d.ts index ae0703ad..6f9c18eb 100644 --- a/src/@types/user.d.ts +++ b/src/@types/user.d.ts @@ -127,12 +127,12 @@ declare namespace User { // findPrivilegedUsers export interface FindPrivilegedUsersResponseDto { - presidentUsers: Model.User[]; - vicePresidentUsers: Model.User[]; + presidentUsers: UserDto[]; + vicePresidentUsers: UserDto[]; councilUsers: UserDto[]; leaderGradeUsers: UserDto[]; leaderCircleUsers: UserDto[]; - leaderAlumni: Model.User[]; + leaderAlumni: UserDto[]; } export interface FindPrivilegedUsersResponse { diff --git a/src/stores/repositories/UserRepo.ts b/src/stores/repositories/UserRepo.ts index a943490a..96d70ba5 100644 --- a/src/stores/repositories/UserRepo.ts +++ b/src/stores/repositories/UserRepo.ts @@ -94,12 +94,12 @@ class UserRepo { } = await axios.get(`${this.URI}/privileged`); */ return { - presidentUsers: presidentUsers ? new UserModel(presidentUsers) : null, - vicePresidentUsers: vicePresidentUsers ? new UserModel(vicePresidentUsers) : null, + presidentUsers: presidentUsers.map(user => new UserModel(user)), + vicePresidentUsers: vicePresidentUsers.map(user => new UserModel(user)), councilUsers: councilUsers.map(user => new UserModel(user)), leaderGradeUsers: leaderGradeUsers.map(user => new UserModel(user)), leaderCircleUsers: leaderCircleUsers.map(user => new UserModel(user)), - leaderAlumni: leaderAlumni ? new UserModel(leaderAlumni) : null, + leaderAlumni: leaderAlumni.map(user => new UserModel(user)), }; }; From b5d0ab55274bceb3b320783ce3ae888da0527b5a Mon Sep 17 00:00:00 2001 From: selfishAltruism Date: Thu, 7 Mar 2024 17:09:47 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=EB=8F=99=EC=95=84=EB=A6=AC=20?= =?UTF-8?q?=EC=B6=94=EB=B0=A9=20=ED=9A=8C=EC=9B=90=20=EB=B3=B5=EA=B5=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/users/components/RestoreModal/RestoreModalUi.tsx | 4 ++-- src/stores/repositories/CircleRepo.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/circle/users/components/RestoreModal/RestoreModalUi.tsx b/src/pages/circle/users/components/RestoreModal/RestoreModalUi.tsx index 7f79e90d..a70a1367 100644 --- a/src/pages/circle/users/components/RestoreModal/RestoreModalUi.tsx +++ b/src/pages/circle/users/components/RestoreModal/RestoreModalUi.tsx @@ -1,7 +1,7 @@ import { flow, makeObservable } from 'mobx'; import { ModalUi } from '@/stores'; -import { UserRepoImpl as Repo } from '@/stores/repositories/UserRepo'; +import { CircleRepoImpl as Repo } from '@/stores/repositories/CircleRepo'; export class RestoreModalUi extends ModalUi { constructor() { @@ -14,7 +14,7 @@ export class RestoreModalUi extends ModalUi { *restore(target: Model.CircleUser): Generator { try { - yield Repo.restore(target.user.id); + yield Repo.restoreUser(target.circle.id, target.user.id); return { success: true } as StoreAPI; } catch (error) { return error; diff --git a/src/stores/repositories/CircleRepo.ts b/src/stores/repositories/CircleRepo.ts index 3bd072fc..7cef2909 100644 --- a/src/stores/repositories/CircleRepo.ts +++ b/src/stores/repositories/CircleRepo.ts @@ -82,7 +82,7 @@ class CircleRepo { }; restoreUser = async (circleId: string, userId: string) => { - await API.put(`${this.URI}/${circleId}/restore/${userId}`); + await API.put(`${this.URI}/${circleId}/users/${userId}/restore`); }; }