Skip to content

Commit 9dc7a39

Browse files
committed
feat: add lottie file
1 parent 32ad1f1 commit 9dc7a39

12 files changed

Lines changed: 68 additions & 42 deletions

File tree

app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
12
@import 'tailwindcss';
23
@import 'tw-animate-css';
3-
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
44
@custom-variant dark (&:is(.dark *));
55

66
@theme {

app/not-found.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
import React from 'react';
2-
import Image from 'next/image';
32
import { ArrowLeft } from 'lucide-react';
43
import { Button } from '@/components/ui/button';
4+
import LottieAnimation from '@/components/LottieAnimation';
55

66
const NotFound = () => {
77
return (
88
<div className='flex min-h-[80vh] items-center justify-center bg-[#030303]'>
99
<div className='mx-auto max-w-md px-6 text-center'>
1010
<div className='mb-8 flex flex-col items-center justify-center'>
11-
<Image
12-
src='/empty-state.png'
13-
alt='Empty state illustration'
14-
width={240}
15-
height={260}
16-
className='rounded-lg'
17-
/>
11+
<LottieAnimation />
12+
1813
<h1 className='mb-4 text-4xl font-bold text-white md:text-6xl'>
1914
404
2015
</h1>

components/EmptyState.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useEffect, useRef } from 'react';
44
import { Plus } from 'lucide-react';
5-
import Image from 'next/image';
5+
import LottieAnimation from './LottieAnimation';
66

77
export interface EmptyStateProps {
88
title?: string;
@@ -63,13 +63,7 @@ const EmptyState: React.FC<EmptyStateProps> = ({
6363
>
6464
{/* Illustration */}
6565
<div className='relative mb-8'>
66-
<Image
67-
src='/empty-state.png'
68-
alt='Empty state illustration'
69-
width={240}
70-
height={260}
71-
className='rounded-lg'
72-
/>
66+
<LottieAnimation />
7367
</div>
7468

7569
{/* Title */}

components/LottieAnimation.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use client';
2+
3+
import React from 'react';
4+
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
5+
6+
interface LottieAnimationProps {
7+
src?: string;
8+
loop?: boolean;
9+
autoplay?: boolean;
10+
className?: string;
11+
width?: number | string;
12+
height?: number | string;
13+
}
14+
15+
const LottieAnimation: React.FC<LottieAnimationProps> = ({
16+
src = 'https://lottie.host/086e1916-d90c-4ef5-9ba8-93051fed0bd8/UjMFDTl4mh.lottie',
17+
loop = true,
18+
autoplay = true,
19+
className = '',
20+
width,
21+
height,
22+
}) => {
23+
return (
24+
<div className={className} style={{ width, height }}>
25+
<DotLottieReact src={src} loop={loop} autoplay={autoplay} />
26+
</div>
27+
);
28+
};
29+
30+
export default LottieAnimation;

components/project-details/comment-section/comments-empty-state.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

3-
import Image from 'next/image';
43
import { CommentInput } from './comment-input';
4+
import LottieAnimation from '@/components/LottieAnimation';
55

66
interface CommentsEmptyStateProps {
77
onAddComment: (content: string) => void;
@@ -12,13 +12,7 @@ export function CommentsEmptyState({ onAddComment }: CommentsEmptyStateProps) {
1212
<div className='flex w-full flex-col'>
1313
<div className='flex flex-col items-center justify-center px-4 py-16 md:py-20'>
1414
<div className='relative mb-8 h-48 w-48 md:h-56 md:w-56'>
15-
<Image
16-
src='/Humanoid.png'
17-
alt='No comments yet'
18-
fill
19-
className='object-contain'
20-
priority
21-
/>
15+
<LottieAnimation />
2216
</div>
2317
<h3 className='mb-8 text-center text-base font-medium text-white md:text-lg'>
2418
Be the first to Leave a Comment

components/project-details/project-backers/Empty.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
import React from 'react';
2-
import Image from 'next/image';
32
import { BoundlessButton } from '@/components/buttons/BoundlessButton';
43
import { HandHeart } from 'lucide-react';
4+
import LottieAnimation from '@/components/LottieAnimation';
55

66
const Empty = () => {
77
return (
88
<div className='mx-auto w-full max-w-[400px] space-y-5 py-5 text-center'>
9-
<Image
10-
src='/Humanoid.svg'
11-
alt='Empty state illustration'
12-
width={400}
13-
height={400}
14-
className='h-[400px] w-[400px] rounded-lg'
15-
/>
9+
<LottieAnimation />
10+
1611
<div className='space-y-1'>
1712
<h3 className='text-center text-base font-medium text-white md:text-lg'>
1813
Be the first to back this project!

components/project-details/project-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export function ProjectLayout({ project }: ProjectLayoutProps) {
344344
</div>
345345
</div>
346346
</div>
347-
<FundProject open={true} setOpen={() => {}} />
347+
<FundProject open={false} setOpen={() => {}} />
348348
</div>
349349
);
350350
}

components/project-details/project-voters/Empty.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
import React from 'react';
2-
import Image from 'next/image';
32
import { BoundlessButton } from '@/components/buttons/BoundlessButton';
43
import { ArrowUpIcon } from 'lucide-react';
4+
import LottieAnimation from '@/components/LottieAnimation';
55

66
const Empty = () => {
77
return (
88
<div className='mx-auto w-full max-w-[400px] space-y-5 py-5 text-center'>
9-
<Image
10-
src='/Humanoid.svg'
11-
alt='Empty state illustration'
12-
width={400}
13-
height={400}
14-
className='h-[400px] w-[400px] rounded-lg'
15-
/>
9+
<LottieAnimation />
1610
<div className='space-y-1'>
1711
<h3 className='text-center text-base font-medium text-white md:text-lg'>
1812
Cast the First Vote!

next.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const nextConfig: NextConfig = {
3030
protocol: 'https',
3131
hostname: 'res.cloudinary.com',
3232
},
33+
{
34+
protocol: 'https',
35+
hostname: 'lottie.host',
36+
},
3337
],
3438
},
3539
};

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)