Skip to content

Commit

Permalink
Merge pull request #98 from urdego/feature/#92-apply-new-character
Browse files Browse the repository at this point in the history
Feat/#92: 파비콘, 로딩 스피너 적용
  • Loading branch information
aaahyesu authored Jan 31, 2025
2 parents 91bd41d + 83f7d00 commit 4e6de1f
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 51 deletions.
2 changes: 1 addition & 1 deletion app/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const metadata: Metadata = {
},
description: 'Where am I? Urdego!',
icons: {
icon: '/favicon-outline.svg',
icon: '/favicon.svg',
},
};

Expand Down
16 changes: 4 additions & 12 deletions components/Common/LoadingSpinner/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import React from 'react';
import Image from 'next/image';
import LoadingSpinnerGif from '@/styles/Icon/LoadingSpinner.gif';
import { LoadingOverlay, SpinnerWrapper } from './LoadingSpinner.style';
import { LoadingOverlay } from './LoadingSpinner.style';
import LottieComponent from '@/components/Common/Lottie/LottieComponent';
import animationData from '@styles/lottie/loading.json';

interface LoadingSpinnerComponentProps {
isLocationRegister?: boolean;
Expand All @@ -14,15 +14,7 @@ const LoadingSpinnerComponent: React.FC<LoadingSpinnerComponentProps> = ({
}) => {
return (
<LoadingOverlay $isLocationRegister={isLocationRegister}>
<SpinnerWrapper>
<Image
src={LoadingSpinnerGif}
alt="로딩 중..."
width={185}
height={185}
loading="lazy"
/>
</SpinnerWrapper>
<LottieComponent animationData={animationData} />
</LoadingOverlay>
);
};
Expand Down
31 changes: 31 additions & 0 deletions components/Common/Lottie/LottieComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use client';

import { useEffect, useRef } from 'react';
import Lottie from 'lottie-web';

interface LottiComponentProps {
animationData: unknown;
}
const LottieComponent = ({ animationData }: LottiComponentProps) => {
const animationContainer = useRef<HTMLDivElement | null>(null);

useEffect(() => {
if (!animationContainer.current) return;

const animation = Lottie.loadAnimation({
container: animationContainer.current as HTMLDivElement,
renderer: 'svg',
loop: true,
autoplay: true,
animationData: animationData,
});

return () => {
animation.destroy();
};
}, [animationData]);

return <div ref={animationContainer} />;
};

export default LottieComponent;
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dotenv": "^16.4.7",
"exifr": "^7.1.3",
"framer-motion": "^11.13.1",
"lottie-web": "^5.12.2",
"next": "14.2.18",
"next-auth": "^4.24.11",
"react": "^18",
Expand Down
14 changes: 0 additions & 14 deletions public/favicon-face(transparent).svg

This file was deleted.

9 changes: 0 additions & 9 deletions public/favicon-outline.svg

This file was deleted.

9 changes: 9 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 0 additions & 15 deletions stories/Layout/Mypage/ProfileInfo.stories.tsx

This file was deleted.

1 change: 1 addition & 0 deletions styles/lottie/loading.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions styles/lottie/tip.json

Large diffs are not rendered by default.

0 comments on commit 4e6de1f

Please sign in to comment.