Skip to content

Commit

Permalink
Merge pull request #324 from Team-Lecue/QA/#316-apply-custom
Browse files Browse the repository at this point in the history
[ Mypage ] 내기록보기 - 사용자가 지정한 배경 / 텍스트 색 반영
  • Loading branch information
jungwoo3490 authored Apr 28, 2024
2 parents a8649e3 + e2a8143 commit 978a1ef
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/History/components/MyLetter/MyLetter.style.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';

export const MyLetterWrapper = styled.article`
export const MyLetterWrapper = styled.article<{
noteTextColor: string;
noteBackground: string;
}>`
width: 100%;
height: 16.3rem;
padding: 1.3rem 1.2rem;
border-radius: 0.4rem;
background-color: ${({ theme }) => theme.colors.sub_purple};
${({ noteBackground }) =>
noteBackground.substring(0, 1) === '#'
? css`
background-color: ${noteBackground};
`
: css`
background: url(${noteBackground});
`};
background-size: 100% 16.3rem;
color: ${({ noteTextColor }) => noteTextColor};
`;

export const MyLetterFavorite = styled.h1`
Expand Down
8 changes: 7 additions & 1 deletion src/History/components/MyLetter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function MyLetter({
title,
content,
noteDate,
noteTextColor,
noteBackground,
}: MyLetterProps) {
const navigate = useNavigate();

Expand All @@ -17,7 +19,11 @@ function MyLetter({
};

return (
<S.MyLetterWrapper onClick={handleClickMyLetter}>
<S.MyLetterWrapper
onClick={handleClickMyLetter}
noteTextColor={noteTextColor}
noteBackground={noteBackground}
>
<S.MyLetterFavorite>{favoriteName}</S.MyLetterFavorite>
<S.MyLetterTitle>{title}</S.MyLetterTitle>
<S.MyLetterContent>{content}</S.MyLetterContent>
Expand Down
2 changes: 2 additions & 0 deletions src/History/types/historyType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface MyLetterProps {
title: string;
content: string;
noteDate: string;
noteTextColor: string;
noteBackground: string;
}

export interface HistoryEmptyViewProps {
Expand Down

0 comments on commit 978a1ef

Please sign in to comment.