Skip to content

Commit

Permalink
Merge pull request #200 from Team-Lecue/Hotfix-Dori
Browse files Browse the repository at this point in the history
[ Hotfix ] Dev 머지
  • Loading branch information
doyn511 authored Jan 19, 2024
2 parents fe4bef9 + 261bf42 commit 8291842
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Detail/components/BigLecueNote/BigLecueNote.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from '@emotion/styled';

export const BigLecueNoteWrapper = styled.div<{
noteBackground: string;
noteTextColor: number;
noteTextColor: string;
}>`
width: 100%;
height: 34.2rem;
Expand Down
2 changes: 1 addition & 1 deletion src/Detail/components/BigLecueNote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface BigLecueNoteProps {
content: string;
noteDate: string;
noteNickname: string;
noteTextColor: number;
noteTextColor: string;
noteBackground: string;
}

Expand Down
11 changes: 3 additions & 8 deletions src/Detail/components/LecueNoteModal/LecueNoteModal.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const BlurryContainer = styled.div`

export const LecueNoteModalWrapper = styled.div<{
noteBackground?: string;
noteTextColor: number;
noteTextColor: string;
}>`
position: relative;
Expand All @@ -33,13 +33,8 @@ export const LecueNoteModalWrapper = styled.div<{
}
}};
background-size: cover;
color: ${({ theme, noteTextColor }) => {
switch (noteTextColor) {
case 0:
return theme.colors.white;
case 1:
return theme.colors.BG;
}
color: ${({ noteTextColor }) => {
return noteTextColor;
}};
`;

Expand Down
12 changes: 6 additions & 6 deletions src/Detail/components/LecueNoteModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const modalContainer = document.getElementById(
) as HTMLElement;

interface LecueNoteModalProps {
selectedNote: NoteType | undefined;
selectedNote: NoteType;
closeModal: () => void;
}

Expand All @@ -22,21 +22,21 @@ function LecueNoteModal({ selectedNote, closeModal }: LecueNoteModalProps) {
return createPortal(
<S.BlurryContainer>
<S.LecueNoteModalWrapper
noteBackground={selectedNote?.noteBackground}
noteTextColor={selectedNote?.noteTextColor || 0}
noteBackground={selectedNote.noteBackground}
noteTextColor={selectedNote.noteTextColor}
>
<S.CloseButton type="button" onClick={handleCloseButtonClick}>
<IcX />
</S.CloseButton>
<S.LecueNoteModalNickname>
{selectedNote?.noteNickname}
{selectedNote.noteNickname}
</S.LecueNoteModalNickname>
<S.LecueNoteModalContentWrapper>
<S.LecueNoteModalContent>
{selectedNote?.content}
{selectedNote.content}
</S.LecueNoteModalContent>
</S.LecueNoteModalContentWrapper>
<S.LecueNoteModalDate>{selectedNote?.noteDate}</S.LecueNoteModalDate>
<S.LecueNoteModalDate>{selectedNote.noteDate}</S.LecueNoteModalDate>
</S.LecueNoteModalWrapper>
</S.BlurryContainer>,
modalContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from '@emotion/styled';

export const SmallLecueNoteWrapper = styled.div<{
renderType: number;
noteTextColor: number;
noteTextColor: string;
noteBackground: string;
}>`
width: 15.2rem;
Expand Down
7 changes: 4 additions & 3 deletions src/Detail/components/SmallLecueNote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface SmallLecueNoteProps {
content: string;
noteDate: string;
noteNickname: string;
noteTextColor: number;
noteTextColor: string;
noteBackground: string;
noteId: number;
noteList: NoteType[];
Expand All @@ -27,7 +27,8 @@ function SmallLecueNote({
}: SmallLecueNoteProps) {
const [modalShow, setModalShow] = useState(false);

const getClickedNote = () => noteList.find((note) => note.noteId === noteId);
const getClickedNote = () =>
noteList.filter((note) => note.noteId === noteId);

const handleClickSmallLecueNote = () => {
const clickedNote = getClickedNote();
Expand All @@ -50,7 +51,7 @@ function SmallLecueNote({
<S.SmallLecueNoteDate>{noteDate}</S.SmallLecueNoteDate>
{modalShow && (
<LecueNoteModal
selectedNote={getClickedNote()}
selectedNote={getClickedNote()[0]}
closeModal={() => setModalShow(false)}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/Detail/type/lecueBookType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export interface NoteType {
content: string;
noteDate: string;
noteNickname: string;
noteTextColor: number;
noteTextColor: string;
noteBackground: string;
}

0 comments on commit 8291842

Please sign in to comment.