Skip to content

Commit 598bfa5

Browse files
completed till fetching products from dummy api (from folder-static)
1 parent e70320e commit 598bfa5

File tree

8 files changed

+2270
-512
lines changed

8 files changed

+2270
-512
lines changed

src/features/navbar/Navbar.js

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import { Fragment } from 'react';
2-
import { Disclosure, Menu, Transition } from '@headlessui/react';
1+
import { Fragment } from "react";
2+
import { Disclosure, Menu, Transition } from "@headlessui/react";
33
import {
44
Bars3Icon,
55
ShoppingCartIcon,
66
XMarkIcon,
7-
} from '@heroicons/react/24/outline';
8-
import { Link } from 'react-router-dom';
7+
} from "@heroicons/react/24/outline";
8+
import { Link } from "react-router-dom";
99

1010
const user = {
11-
name: 'Tom Cook',
12-
email: 'tom@example.com',
11+
name: "Tom Cook",
12+
email: "tom@example.com",
1313
imageUrl:
14-
'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
14+
"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
1515
};
1616
const navigation = [
17-
{ name: 'Dashboard', href: '#', current: true },
18-
{ name: 'Team', href: '#', current: false },
17+
{ name: "Dashboard", href: "#", current: true },
18+
{ name: "Team", href: "#", current: false },
1919
];
2020
const userNavigation = [
21-
{ name: 'Your Profile', href: '#' },
22-
{ name: 'Settings', href: '#' },
23-
{ name: 'Sign out', href: '#' },
21+
{ name: "Your Profile", href: "#" },
22+
{ name: "Settings", href: "#" },
23+
{ name: "Sign out", href: "#" },
2424
];
2525

2626
function classNames(...classes) {
27-
return classes.filter(Boolean).join(' ');
27+
return classes.filter(Boolean).join(" ");
2828
}
2929

3030
function NavBar({ children }) {
@@ -38,11 +38,13 @@ function NavBar({ children }) {
3838
<div className="flex h-16 items-center justify-between">
3939
<div className="flex items-center">
4040
<div className="flex-shrink-0">
41-
<img
42-
className="h-8 w-8"
43-
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=500"
44-
alt="Your Company"
45-
/>
41+
<Link to="/">
42+
<img
43+
className="h-8 w-8"
44+
src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=500"
45+
alt="Your Company"
46+
/>
47+
</Link>
4648
</div>
4749
<div className="hidden md:block">
4850
<div className="ml-10 flex items-baseline space-x-4">
@@ -52,11 +54,11 @@ function NavBar({ children }) {
5254
href={item.href}
5355
className={classNames(
5456
item.current
55-
? 'bg-gray-900 text-white'
56-
: 'text-gray-300 hover:bg-gray-700 hover:text-white',
57-
'rounded-md px-3 py-2 text-sm font-medium'
57+
? "bg-gray-900 text-white"
58+
: "text-gray-300 hover:bg-gray-700 hover:text-white",
59+
"rounded-md px-3 py-2 text-sm font-medium"
5860
)}
59-
aria-current={item.current ? 'page' : undefined}
61+
aria-current={item.current ? "page" : undefined}
6062
>
6163
{item.name}
6264
</a>
@@ -110,8 +112,8 @@ function NavBar({ children }) {
110112
<a
111113
href={item.href}
112114
className={classNames(
113-
active ? 'bg-gray-100' : '',
114-
'block px-4 py-2 text-sm text-gray-700'
115+
active ? "bg-gray-100" : "",
116+
"block px-4 py-2 text-sm text-gray-700"
115117
)}
116118
>
117119
{item.name}
@@ -153,11 +155,11 @@ function NavBar({ children }) {
153155
href={item.href}
154156
className={classNames(
155157
item.current
156-
? 'bg-gray-900 text-white'
157-
: 'text-gray-300 hover:bg-gray-700 hover:text-white',
158-
'block rounded-md px-3 py-2 text-base font-medium'
158+
? "bg-gray-900 text-white"
159+
: "text-gray-300 hover:bg-gray-700 hover:text-white",
160+
"block rounded-md px-3 py-2 text-base font-medium"
159161
)}
160-
aria-current={item.current ? 'page' : undefined}
162+
aria-current={item.current ? "page" : undefined}
161163
>
162164
{item.name}
163165
</Disclosure.Button>

0 commit comments

Comments
 (0)