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

[공지사항] 코인 공지사항 구현 #56

Merged
merged 28 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7a47d81
feat: 공지사항 진입점 생성
MinGu-Jeong Sep 27, 2024
7015153
feat: 공지사항 라우팅 수정
MinGu-Jeong Sep 27, 2024
1c4f2de
Merge branch 'feat/#53/admin-notice-writing' into feat/admin-notice
MinGu-Jeong Sep 27, 2024
ec9d5f0
feat: 리스트 뷰 ui 구현
junghaesung79 Oct 1, 2024
2d04018
feat: trash 토글 버튼 생성
junghaesung79 Oct 5, 2024
46cdf3b
feat: 테이블 ellipsis 적용
junghaesung79 Oct 5, 2024
7c9c5dc
feat: api 기본 틀 + get 요청 쿼리 작성
junghaesung79 Oct 5, 2024
816bd0b
feat: api 연결
junghaesung79 Oct 5, 2024
0887658
feat: 공지사항 단건 조회 api
junghaesung79 Oct 5, 2024
ca21377
feat: 공지사항 조회 페이지
junghaesung79 Oct 6, 2024
30be8d8
feat: 공지사항 수정 api
junghaesung79 Oct 6, 2024
1de3a02
feat: 공지사항 수정 기능
junghaesung79 Oct 6, 2024
dc64057
feat: 공지사항 삭제 api
junghaesung79 Oct 6, 2024
e4b80a6
feat: 공지사항 삭제 모달
junghaesung79 Oct 6, 2024
2ba9006
feat: 공지사항 생성 api
junghaesung79 Oct 6, 2024
0d09b40
chore: toast-ui 라이브러리 추가
MinGu-Jeong Sep 29, 2024
e2f095d
feat: 공지사항 글쓰기 UI
MinGu-Jeong Oct 5, 2024
977798a
feat: 공지사항 글쓰기 기능
junghaesung79 Oct 6, 2024
9c8a845
refactor: 공지사항 글쓰기 경로 변경
junghaesung79 Oct 6, 2024
e0d28ee
refactor: 스타일드 컴포넌트 위치 이동
junghaesung79 Oct 6, 2024
0744735
feat: 이미지 업로드 구현
junghaesung79 Oct 6, 2024
397c8a5
feat: 공지사항 글쓰기 뒤로가기
junghaesung79 Oct 6, 2024
08a83a0
feat: 공지사항 글쓰기
junghaesung79 Oct 6, 2024
589d36d
feat: 공지사항 수정 toast editor 적용
junghaesung79 Oct 6, 2024
5568fa1
feat: 공지사항 수정 기능
junghaesung79 Oct 7, 2024
978fc30
Merge branch 'develop' into feat/admin-notice
junghaesung79 Oct 7, 2024
c234f39
feat: 공지사항 수정시 리스트로 이동
MinGu-Jeong Oct 7, 2024
b6f8e53
refactor: 필요 없는 debounce 삭제
junghaesung79 Oct 7, 2024
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
173 changes: 173 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 9 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
yarnPath: .yarn/releases/yarn-3.8.0.cjs
nodeLinker: "pnp"
nodeLinker: "pnp"

packageExtensions:
'@toast-ui/editor@*':
dependencies:
prosemirror-transform: '*'
'@toast-ui/react-editor@*':
dependencies:
MinGu-Jeong marked this conversation as resolved.
Show resolved Hide resolved
prosemirror-transform: '*'
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@toast-ui/editor": "^3.2.2",
"@toast-ui/react-editor": "^3.2.3",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
MinGu-Jeong marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import ABTest from 'pages/ABTest';
import ABTestDetail from 'pages/ABTest/components/ABTestDetail';
import ReviewList from 'pages/Services/Review/ReviewList';
import BenefitPage from 'pages/Services/Benefit';
import NoticeList from 'pages/Services/Notice/NoticeList';
import NoticeDetail from 'pages/Services/Notice/NoticeDetail';
import NoticeWrite from 'pages/Services/Notice/NoticeWrite';

function RequireAuth() {
const location = useLocation();
Expand Down Expand Up @@ -64,6 +67,9 @@ function App() {
<Route path="/abtest/:id" element={<ABTestDetail />} />
<Route path="/review" element={<ReviewList />} />
<Route path="/benefit" element={<BenefitPage />} />
<Route path="/notice" element={<NoticeList />} />
<Route path="/notice/:id" element={<NoticeDetail />} />
<Route path="/notice/write" element={<NoticeWrite />} />
<Route path="*" element={<h1>404</h1>} />
</Route>
</Routes>
MinGu-Jeong marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
49 changes: 49 additions & 0 deletions src/components/common/CustomForm/CustomForm.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,50 @@ export const FormItem = styled(Form.Item)`
}
`;

export const FormTextItem = styled(Form.Item)`
margin-bottom: 0;
.ant-form-item-label > label {
width: 120px;
height: 500px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 600;
color: #2c3e50;
background-color: rgb(243, 243, 243);
border: rgb(217, 217, 217) solid;
border-width: 1px;
border-radius: 0;
&:after {
display: none;
flex-basis: auto;
}
}
// 기본 설정된 반응형에 의한 디자인 깨짐 방지용
${mobile}{
.ant-row .ant-form-item-label {
flex: 0 1 auto;
padding: 0;
}
.ant-row .ant-form-item-control {
flex: 1 1 auto;
padding: 0;
}
}

.ant-form-item-explain-error {
position: absolute;
right: 12px;
z-index: 10;
top: 5px;
}

.ant-input-number-input-wrap {
width: 100%;
}
`;

export const FormItemCheckbox = styled(Form.Item)`
margin-bottom: 0;

Expand Down Expand Up @@ -117,3 +161,8 @@ export const UploadWrap = styled(Form.Item)`
right: 10vw;
}
`;

export const TextWrap = styled.div`
display: flex;
height: 100%;
`;
MinGu-Jeong marked this conversation as resolved.
Show resolved Hide resolved
39 changes: 38 additions & 1 deletion src/components/common/CustomForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import {
Input, InputNumberProps, InputProps,
Modal, ModalProps, Select, Switch, SwitchProps,
} from 'antd';
import { ReactNode } from 'react';
import { ReactNode, forwardRef } from 'react';
import { Rule } from 'antd/lib/form';
import useValidate from 'utils/hooks/useValidate';
import { NamePath } from 'antd/lib/form/interface';
import { Editor, EditorProps, Viewer } from '@toast-ui/react-editor';
import * as S from './CustomForm.style';
import CustomMultipleUpload from './CustomMultipleUpload';
import CustomSingleUpload from './CustomSingleUpload';
Expand Down Expand Up @@ -186,6 +187,40 @@ function CustomModal({
);
}

export const CustomEditor = forwardRef<Editor, CustomFormItemProps & EditorProps>((
{
label, name, rules, ...props
},
ref,
) => {
return (
<S.TextWrap>
<S.FormTextItem label={label} name={name} rules={rules}>
<Editor {...props} ref={ref} />
</S.FormTextItem>
</S.TextWrap>

);
});

export const CustomViewer = forwardRef<Viewer, CustomFormItemProps & EditorProps>((
{
label, name, rules, ...props
},
ref,
) => {
return (
<S.TextWrap>
<S.FormTextItem label={label} name={name} rules={rules}>
<Viewer {...props} ref={ref} />
</S.FormTextItem>
</S.TextWrap>

);
});

CustomEditor.displayName = 'CustomEditor';

const CustomForm = Object.assign(Form, {
GridRow,
Button: CustomButton,
Expand All @@ -199,6 +234,8 @@ const CustomForm = Object.assign(Form, {
Switch: CustomSwitch,
Modal: CustomModal,
useValidate,
Editor: CustomEditor,
Viewer: CustomViewer,
});

export default CustomForm;
Loading
Loading