Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added banner to inform project is for demo only #13

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions app/components/header/DemoHeadline.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Link from 'next/link';
import {FC} from 'react';

export const DemoHeadline: FC = () => {
return (
<div className="w-full py-2 bg-violet-900 text-violet-300 text-sm text-center">
<p className="text-center">
This project is for demonstration purposes only. For more information,
check{' '}
<Link
href="https://www.pkural.ca/projects/#plamatio-e-commerce"
className="underline hover:font-[500]">
here
</Link>
.
</p>
</div>
);
};

export default DemoHeadline;
2 changes: 1 addition & 1 deletion app/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const greatVibes = Great_Vibes({weight: '400', subsets: ['latin']});
export const Header = () => {
return (
<div className="flex flex-col align-middle justify-center w-full my-5">
<div className="w-full flex flex-col items-center justify-center mt-5 xs:mt-0">
<div className="w-full flex flex-col items-center justify-center mt-2 xs:mt-0">
<Link
href="/"
className={`${greatVibes.className} text-violet-900 text-[3.5rem]`}>
Expand Down
19 changes: 18 additions & 1 deletion app/components/header/cart/CartDropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
'use client';
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import {ShoppingBagIcon} from 'lucide-react';
import {CartDropdownItems} from './CartDropdownItems';
import {useAppSelector} from '@/app/lib/store/storeHooks';
import {selectCartItems} from '@/app/lib/store/reducers/cart/cartReducer';

const CartDropdownMenu = () => {
// const userId: string | undefined = undefined;
const cartItems = useAppSelector(selectCartItems);

return (
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<button
className="rounded-full w-[35px] h-[35px] inline-flex items-center justify-center text-violet-800 bg-white outline-none hover:bg-violet3"
aria-label="Cart Items">
<ShoppingBagIcon size={35} strokeWidth={1} />
<div className="relative">
<ShoppingBagIcon
size={35}
strokeWidth={1}
className="mt-1 relative"
/>
{cartItems.length > 0 && (
<span className="absolute -bottom-1 right-0 bg-violet-700 text-white text-xs font-bold rounded-full px-1">
{cartItems.length}
</span>
)}
</div>
</button>
</DropdownMenu.Trigger>

Expand Down
2 changes: 1 addition & 1 deletion app/components/header/nav/NavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const NavMenus = async () => {
return (
<>
<NavigationMenu.Root className="relative z-[1] flex w-screen justify-center">
<NavigationMenu.List className="center m-0 flex list-none rounded-[6px] p-1">
<NavigationMenu.List className="center m-0 flex list-none rounded-[6px]">
{menuItems &&
menuItems.map((item) => <NavMenuItem key={item.id} item={item} />)}

Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import LoadCartItems from './components/auxiliary/LoadCartItems';
import LoadProducts from './components/auxiliary/LoadProducts';
import {CreateUserBridge} from './components/landing/CreateUserBridge';
import {Analytics} from '@vercel/analytics/react';
import DemoHeadline from './components/header/DemoHeadline';

const workSans = Work_Sans({subsets: ['latin']});

Expand All @@ -34,6 +35,7 @@ export default function RootLayout({
<body
className={`${workSans.className} w-full h-full flex flex-row align-middle justify-center bg-fuchsia-50/15`}>
<div className="max-w-[1620px]">
<DemoHeadline />
<Header />
{children}
</div>
Expand Down