Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

feat : conflict resolver #22

Merged
merged 15 commits into from
Aug 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
12 changes: 12 additions & 0 deletions apps/wiki/components/(modal)/Merge/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import ResolverContainer from "@/components/Resolver";
import * as styles from "../style.css";

const Merge = ({ title, contents }: { title: string; contents: string }) => {
return (
<div className={styles.background}>
<ResolverContainer title={title} contents={contents} />
</div>
Comment on lines +6 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ResolverContainer에 styles.background를 주지 않고 이렇게 처리하신 이유가 있는지 궁금합니다!
  • 하나의 모듈만 사용할 때는 import * 대신 구조분해할당을 사용해 모듈을 들고오는 건 어떠신가요?
  • 간단한 �인터페이스 props를 받을 때에는 FC를 사용하는 컨벤션을 추천드립니다!!
const Merge = FC<{ title: string; contents: string; }>({ title, contents }) => {}

개인적인 생각으로는, 문서의 타입을 먼저 확인하면 ({ title, contents })를 보고나서 { title: string; contents: string; }를 한번
더 읽는 리소스가 발생하지 않을 거라고 생각합니다! 따라서 FC를 사용하시는 건 어떤지 여쭤보고 싶습니다 !!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 기존의 모달 구조를 재사용하다보니 미처 그부분을 생각치 못했네요.
  • 제가 FC사용에 익숙치 않아서 크게 고려해보질 못했네요. 찾아보겠습니다

);
};

export default Merge;
8 changes: 4 additions & 4 deletions apps/wiki/components/Container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ interface Props extends PropsWithChildren {
title: string;
docsType: string;
lastModifiedAt?: Date;
docsDetail?: boolean;
isDocsDetail?: boolean;
id?: number;
}

const Container = ({ docsType, title, lastModifiedAt, docsDetail, id, children }: Props) => {
const Container = ({ docsType, title, lastModifiedAt, isDocsDetail, id, children }: Props) => {
const { mutate } = useDeleteDocsMutation();
const { formatDate } = useDate();
const { isAdmin, user, isLoggedIn } = useUser();
Expand Down Expand Up @@ -59,11 +59,11 @@ const Container = ({ docsType, title, lastModifiedAt, docsDetail, id, children }
<hgroup className={styles.hgroup}>
<div className={styles.titleBox}>
<h1 className={styles.title}>부마위키:{title}</h1>
{docsDetail && lastModifiedAt && (
{isDocsDetail && (
<span className={styles.lastModifiedAt}>최근 편집 · {formatDate(lastModifiedAt)}</span>
)}
</div>
{docsDetail && (
{isDocsDetail && (
<div className={styles.utilityBox}>
<button onClick={handleDocsEditClick} className={styles.editButton}>
문서 편집
Expand Down
Loading