Skip to content

Commit 16d756e

Browse files
authored
Merge pull request #159 from ASAP-Lettering/feat/#155
[Feat] Image의 placeholder를 활용한 홈 화면 행성 이미지 렌더링 최적화
2 parents 3cb4460 + 0a0a209 commit 16d756e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/app/planet/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ const Layout = styled.div`
558558
gap: 10px;
559559
padding: 20px 0px 0px 0px;
560560
position: relative;
561+
background-color: ${theme.colors.bg};
561562
562563
::-webkit-scrollbar {
563564
display: none;
@@ -668,7 +669,6 @@ const BottomWrapper = styled.div`
668669
const LoaderContainer = styled.div`
669670
width: 100%;
670671
height: 100%;
671-
min-height: 600px;
672672
display: flex;
673673
align-items: center;
674674
justify-content: center;

src/components/common/Planet.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React, { useState } from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import Image from 'next/image';
33
import styled from 'styled-components';
44
import Tag from './Tag';
55
import Button from './Button';
66
import { useRouter } from 'next/navigation';
77
import ConfirmModal from './ConfirmModal';
88
import { useRecoilState, useSetRecoilState } from 'recoil';
9-
import { toastState } from '@/recoil/toastStore';
109
import { deletePlanetLetter } from '@/api/planet/letter/spaceLetter';
1110
import { droppedLetterState } from '@/recoil/letterStore';
1211
import BlinkTag from './BlinkingTag';
1312
import { useToast } from '@/hooks/useToast';
1413
import { getCookie } from '@/utils/storage';
14+
import { PLANET_BLUR_DATA } from '@/constants/planetBlur';
1515

1616
interface Orbit {
1717
letterId: string;
@@ -131,6 +131,8 @@ const Planet = (props: PlanetProps) => {
131131
width={400}
132132
height={400}
133133
alt="planet"
134+
placeholder="blur"
135+
blurDataURL={'data:/image/png;base64,' + PLANET_BLUR_DATA[planetType]}
134136
priority
135137
onContextMenu={handleContextMenu}
136138
/>

src/constants/planetBlur.ts

Lines changed: 8 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)