Skip to content

Commit

Permalink
[ fix ] 메인화면 QA
Browse files Browse the repository at this point in the history
  • Loading branch information
myeongheonhong committed Dec 23, 2023
1 parent 1bdb09c commit 5038595
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 8 deletions.
27 changes: 26 additions & 1 deletion components/Common/VerticalProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { FireIcImg } from '@/public/assets/icons';
import theme from '@/styles/theme';
import Image from 'next/image';
import styled, { css } from 'styled-components';

interface ProgressBarProps {
Expand All @@ -15,7 +17,21 @@ export default function VerticalProgressBar(props: ProgressBarProps) {
<Styled.PercentWrapper percent={Number(percent)}></Styled.PercentWrapper>
</Styled.ProgressBox>

{/* 리팩토링 1순위 ㅋㅋㅋ */}
<Styled.BarContainer>
{percent && percent >= 100 && (
<Image
src={FireIcImg}
alt="불꽃 아이콘"
width={59}
style={{
position: 'absolute',
top: '26rem',
right: '-2.5rem',
transform: 'rotate(180deg)',
}}
/>
)}
<Styled.Progress percent={Number(percent)} />
</Styled.BarContainer>
</>
Expand Down Expand Up @@ -68,11 +84,20 @@ const Styled = {
max-height: 100%;
width: 100%;
background-color: ${theme.colors.main_blue};
${(props) =>
props.percent > 100
? css`
background: linear-gradient(#3ea2ff, #e63323);
`
: css`
background-color: ${theme.colors.main_blue};
`}
border-bottom-right-radius: 5rem;
border-bottom-left-radius: 5rem;
border-top-right-radius: 5rem;
border-top-left-radius: 5rem;
`,

FireIconWrapper: styled.div``,
};
19 changes: 16 additions & 3 deletions components/Main/MainCenterContent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import Image from 'next/image';
import styled from 'styled-components';
import VerticalProgressBar from '../Common/VerticalProgressBar';
import { MainCakeImg, MainChatImg, MainEndChatImg, MainWishChatImg } from '@/public/assets/images';
import {
MainCakeImg,
MainChatImg,
MainEndCakeImg,
MainEndChatImg,
MainWishChatImg,
} from '@/public/assets/images';
import theme from '@/styles/theme';
import { useGetMainProgressData } from '@/hooks/queries/wishes';
import { convertMoneyText } from '@/utils/common/convertMoneyText';

export default function MainCenterContent() {
const { progressData } = useGetMainProgressData();

console.log(progressData);

const ChatImg = () => {
if (!progressData) {
return MainChatImg;
Expand All @@ -29,11 +37,16 @@ export default function MainCenterContent() {
<Styled.ImageWrapper>
<Image src={ChatImg()} alt="말풍선" />
<Styled.CakeImageWrapper>
<Image src={MainCakeImg} alt="메인 케이크 이미지" width={219} />
<Image
src={progressData?.status === 'END' ? MainEndCakeImg : MainCakeImg}
alt="메인 케이크 이미지"
width={219}
/>
</Styled.CakeImageWrapper>
</Styled.ImageWrapper>
<Styled.ProgressBarWrapper>
<VerticalProgressBar percent={progressData?.percent || 0} />
{/* <VerticalProgressBar percent={progressData?.percent || 0} /> */}
<VerticalProgressBar percent={125} />
</Styled.ProgressBarWrapper>
</Styled.CenterContentWrapper>
<Styled.CakeTextWrapper>
Expand Down
4 changes: 3 additions & 1 deletion components/Main/MainTopContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default function MainTopContent() {
if (progressData?.dayCount === 0) {
return 'D-Day';
} else {
return `D-${progressData?.dayCount}`;
return progressData.dayCount < 0
? `D${progressData?.dayCount}`
: `D+${progressData?.dayCount}`;
}
};

Expand Down
Binary file added public/assets/icons/fireIcImg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export { default as ArrowRightIc } from '@/public/assets/icons/arrowRightIc.svg'
export { default as ArrowLargeDownIc } from '@/public/assets/icons/arrowLargeDownIc.svg';
export { default as CheckedBoxIc } from '@/public/assets/icons/checkedBoxIc.svg';
export { default as UnCheckedBoxIc } from '@/public/assets/icons/unCheckedBoxIc.svg';
export { default as FireIcImg } from '@/public/assets/icons/fireIcImg.png';
10 changes: 7 additions & 3 deletions public/assets/images/chat/mainEndChatImg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/images/mainEndCakeImg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5038595

Please sign in to comment.