Skip to content

Commit d4b4828

Browse files
committed
added logo component and make logo spin
1 parent a2d1683 commit d4b4828

5 files changed

Lines changed: 29 additions & 4 deletions

File tree

public/img/logo.png

6.57 KB
Loading

src/components/Logo/Logo.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import Image from 'next/image';
3+
import logo from '../../../public/img/logo.png';
4+
5+
type logoType = {
6+
logoSize: number;
7+
}
8+
9+
export default function Logo({logoSize}:logoType ) {
10+
11+
return (
12+
<div className='animate-spin'>
13+
<Image src={logo} alt="logo" width ={logoSize} />
14+
</div>
15+
);
16+
}

src/components/Logo/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Logo';

src/components/Navbar/Navbar.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import Link from 'next/link';
3-
import Image from 'next/image';
4-
import logo from '../../../public/reactdevske.svg';
3+
// import Image from 'next/image';
4+
// import logo from '../../../public/reactdevske.svg';
5+
import Logo from '../Logo/Logo';
6+
57
import {
68
ABOUT,
79
CONTACT,
@@ -13,19 +15,22 @@ import {
1315
} from '../../util/routeConstants';
1416

1517
export default function Navbar() {
18+
1619
return (
1720
<>
1821
<header className="px-[181px] w-full shadow-md bg-white">
1922
<nav className="nav py-4 flex flex-col lg:flex-row justify-between items-center">
2023
<div>
2124
<Link href={HOME}>
2225
<a>
23-
<Image
26+
{/* <Image
2427
src={logo}
2528
alt="reactdevske logo"
2629
width={137}
2730
height={60}
28-
/>
31+
/> */}
32+
33+
<Logo logoSize= {60} />
2934
</a>
3035
</Link>
3136
</div>

tailwind.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ module.exports = {
33
content: ['./src/**/*.{js,ts,jsx,tsx}'],
44
theme: {
55
extend: {
6+
animation: {
7+
'spin': 'spin 10s linear infinite',
8+
},
69
fontFamily: {
710
montserrat: ['Montserrat', 'sans-serif'],
811
},

0 commit comments

Comments
 (0)