Skip to content

Commit

Permalink
feat: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DuDa369 committed Jul 8, 2024
1 parent 5e46132 commit e8c76c5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 160 deletions.
8 changes: 4 additions & 4 deletions backend/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"Version": "2.1.0"
},
"PaypalOptions": {
"Mode": "Sandbox",
"ClientId": "AeHWum6h8vCgUPqKYzPvZJ6LC5zhor3O4Lf63Rg3k8SLquVh09vYQRvdGOLcov6iZbZFyXmB9W21jz19",
"ClientSecret": "EJaYfuCeFWPtRNEfaNu1mRFjVp9ZTN16kJG0rrq41T3GRsFbDBEphQ-MTedSdiA0OSGshZi2f2DUkOiv"
},
"Mode": "Sandbox",
"ClientId": "AeHWum6h8vCgUPqKYzPvZJ6LC5zhor3O4Lf63Rg3k8SLquVh09vYQRvdGOLcov6iZbZFyXmB9W21jz19",
"ClientSecret": "EJaYfuCeFWPtRNEfaNu1mRFjVp9ZTN16kJG0rrq41T3GRsFbDBEphQ-MTedSdiA0OSGshZi2f2DUkOiv"
},
"Kestrel": {
"Endpoints": {
"Http": {
Expand Down
52 changes: 2 additions & 50 deletions frontend/src/components/nav/TopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,68 +175,20 @@ export default function TopNav() {
<Link
className="relative mulish-regular flex gap-1 items-center py-1 px-3 border-b-2 border-b-transparent text-base hover:border-b-blue-500 duration-200 transition-all"
to={"/product/accessory"}
onMouseEnter={() => {
setJewelryDrop(true);
}}
onMouseLeave={() => {
setJewelryDrop(false);
}}
onClick={() => {
setMenuDrop(false);
}}
>
Accessory <ChevronDown size={16} />
{jewelryDrop && (
<div className="md:hidden pb-8 absolute z-50 w-[100vw] mx-auto top-[36px] -left-[190px] right-0 bg-white">
<div className="mt-4"></div>
<div className="grid grid-cols-4 px-4 pb-4 gap-y-2">
{accessoryTypes?.data?.map((item: any, index: number) => {
return (
<JewelryItem
key={index}
shapes={shapes?.data}
accessoryType={item.name}
/>
);
})}
{/* <div
className="bg-contain bg-no-repeat h-[200px]"
style={{
backgroundImage: "url(/images/Reserve_1000x.webp)",
}}
></div> */}
</div>
</div>
)}
Accessory
</Link>
<Link
className="relative mulish-regular flex gap-1 items-center py-1 px-3 border-b-2 border-b-transparent text-base hover:border-b-blue-500 duration-200 transition-all"
to={"/product/diamond"}
onMouseEnter={() => {
setDiamondDrop(true);
}}
onMouseLeave={() => {
setDiamondDrop(false);
}}
onClick={() => {
setMenuDrop(false);
}}
>
Diamond <ChevronDown size={16} />
{diamondDrop && (
<div className="md:hidden z-50 w-[100vw] absolute mx-auto top-[36px] -left-[310px] right-0 bg-white">
<div className="mt-4"></div>
<div className="flex gap-4">
<DiamondItem shapes={shapes?.data} />
<div
className="aspect-[2/1] bg-contain bg-no-repeat h-[240px]"
style={{
backgroundImage: "url(/images/diamond_desktop.jpg)",
}}
></div>
</div>
</div>
)}
Diamond
</Link>
<TopNavItem setMenuDrop={setMenuDrop} href="/blogs">
Blogs
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/pages/account/components/InvoiceItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ export default function InvoiceItem({ order }: { order: any }) {
<td colSpan={6} className="font-bold px-6 py-3">
Discount:
</td>
<td className="text-center">{order.totalDiscountPercent}%</td>
<td className="text-center">
{order.totalDiscountPercent * 100}%
</td>
</tr>
<tr className="text-xl h-10 border-b bg-black text-white">
{/* <td colSpan={5}></td> */}
Expand All @@ -166,7 +168,8 @@ export default function InvoiceItem({ order }: { order: any }) {
</td>
<td className="text-center">
{(
(order.totalPrice * (100 - order.totalDiscountPercent)) /
(order.totalPrice *
(100 - order.totalDiscountPercent * 100)) /
100
).toLocaleString("en-US", {
style: "currency",
Expand Down
127 changes: 23 additions & 104 deletions frontend/src/pages/dashboard/components/DashboardHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { useNavigate } from "react-router-dom";
import {
// HiOutlineBell,
// HiOutlineChatAlt,
HiOutlineSearch,
} from "react-icons/hi";
// import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";

import {
Menu,
MenuButton,
Expand All @@ -14,107 +9,42 @@ import {
} from "@headlessui/react";
import { setCookie } from "../../../utils/cookie";
import { Button } from "antd";
import { useEffect, useState } from "react";
import { GET } from "../../../utils/request";

export default function DashboardHeader() {
const navigate = useNavigate();
const [accountData, setAccountData] = useState<{ name: string } | null>(null);

useEffect(() => {
const fetchAccountData = async () => {
const response = await GET("/api/Accounts/me");
setAccountData(response);
};

fetchAccountData();
}, []);

return (
<div className="bg-white h-16 px-4 flex items-center justify-between border-b border-gray-200">
<div className="relative">
<div className="bg-white h-16 px-4 flex items-center border-b border-gray-200 justify-end">
{/* <div className="relative">
<HiOutlineSearch
fontSize={20}
fontSize={20}s
className="text-grey-400 absolute top-1/2 -translate-y-1/2 left-3"
/>
<input
type="text"
placeholder="Search...."
className="text-sm focus:outline-none active:outline-none h-10 w-[24rem] border border-grey-300 rounded-lg px-4 pl-11 pr-4"
/>
</div> */}
<div className="flex items-center gap-5 text-center">
Hello, {accountData?.name}
</div>
<div className="flex items-center gap-3 mr-2">
{/* <Popover>
<PopoverButton className="text-sm/6 font-semibold text-neutral-950/50 focus:outline-none data-[active]:text-black data-[hover]:text-black data-[focus]:outline-1 data-[focus]:outline-black">
<HiOutlineBell fontSize={24} />
</PopoverButton>
<Transition
enter="transition ease-out duration-200"
enterFrom="opacity-100 translate-y-1"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in duration-150"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-100 translate-y-1"
>
<PopoverPanel
anchor="bottom"
className="divide-y divide-black/5 rounded-xl bg-black text-sm/6 [--anchor-gap:var(--spacing-5)]"
>
<div className="p-3">
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Insights</p>
</a>
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Automations</p>
</a>
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Reports</p>
</a>
</div>
</PopoverPanel>
</Transition>
</Popover>
<Popover>
<PopoverButton className="text-sm/6 font-semibold text-neutral-950/50 focus:outline-none data-[active]:text-black data-[hover]:text-black data-[focus]:outline-1 data-[focus]:outline-black">
<HiOutlineChatAlt fontSize={24} />
</PopoverButton>
<Transition
enter="transition ease-out duration-200"
enterFrom="opacity-100 translate-y-1"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in duration-150"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-100 translate-y-1"
>
<PopoverPanel
anchor="bottom"
className="divide-y divide-black/5 rounded-xl bg-black text-sm/6 [--anchor-gap:var(--spacing-5)]"
>
<div className="p-3">
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Insights</p>
</a>
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Automations</p>
</a>
<a
className="block rounded-lg py-2 px-3 transition hover:bg-slate-700"
href="#"
>
<p className="font-semibold text-white">Reports</p>
</a>
</div>
</PopoverPanel>
</Transition>
</Popover> */}

<div className="flex items-center gap-3 mr-2 ">
<Menu as="div">
<div>
<MenuButton className="ml-2 inline-flex rounded-full focus:outline-none focus:ring-2 focus:ring-neutral-400">
<MenuButton className="ml-2 inline-flex rounded-full focus:outline-none focus:ring-2 focus:ring-neutral-400 ">
<div
className="h-10 w-10 rounded-full bg-sky-500 bg-cover bg-no-repeat bg-center"
style={{
Expand Down Expand Up @@ -148,18 +78,7 @@ export default function DashboardHeader() {
</a>
)}
</MenuItem>
<MenuItem>
{({ active }) => (
<a
href="/profile"
className={`${
active ? "bg-gray-700 text-white" : "text-white"
} group flex rounded-md items-center w-full px-2 py-2 text-sm`}
>
Settings
</a>
)}
</MenuItem>

<MenuItem>
<Button
className="group flex rounded-md items-center w-full px-2 py-2 text-sm text-white bg-gray-700"
Expand Down

0 comments on commit e8c76c5

Please sign in to comment.