Skip to content

Commit

Permalink
Merge pull request #9 from Zenfulcode/webshop-rework
Browse files Browse the repository at this point in the history
Webshop rework and auth implementation
  • Loading branch information
gkhaavik authored Dec 1, 2024
2 parents a8ab615 + e740b07 commit 49217b1
Show file tree
Hide file tree
Showing 23 changed files with 1,234 additions and 245 deletions.
465 changes: 461 additions & 4 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.53.2",
"sharp": "^0.33.5",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
Expand Down
9 changes: 9 additions & 0 deletions src/app/(client)/auth/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { LoginForm } from "@/components/authentication/AuthForms";

export default function LoginPage() {
return (
<div className="container mx-auto py-8">
<LoginForm />
</div>
);
}
9 changes: 9 additions & 0 deletions src/app/(client)/auth/register/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { RegisterForm } from "@/components/authentication/AuthForms";

export default function RegisterPage() {
return (
<div className="container mx-auto py-8">
<RegisterForm />
</div>
);
}
27 changes: 15 additions & 12 deletions src/app/(client)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Metadata } from 'next'
import { CartProvider } from '@/context/CartContext'
import { CartSheet } from '@/components/webshop/CartSheet'
import { Toaster } from '@/components/ui/toaster'
import { AuthProvider } from '@/context/AuthContext'

export const metadata: Metadata = {
title: 'Commercify Demo Store',
Expand All @@ -17,18 +18,20 @@ export default function RootLayout({
return (
<html lang="en">
<body>
<CartProvider>
<div className="relative">
<header className="sticky top-0 z-50 bg-background border-b">
<div className="container mx-auto px-4 h-16 flex items-center justify-between">
<nav>{/* Your navigation items */}</nav>
<CartSheet />
</div>
</header>
<Toaster />
<main>{children}</main>
</div>
</CartProvider>
<AuthProvider>
<CartProvider>
<div className="relative">
<header className="sticky top-0 z-50 bg-background border-b">
<div className="container mx-auto px-4 h-16 flex items-center justify-between">
<nav>{/* Your navigation items */}</nav>
<CartSheet />
</div>
</header>
<Toaster />
<main>{children}</main>
</div>
</CartProvider>
</AuthProvider>
</body>
</html>
)
Expand Down
6 changes: 4 additions & 2 deletions src/app/(client)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ProductCard from '@/components/products/ProductCard';

const ProductsPage: React.FC = () => {
const [products, setProducts] = React.useState<Product[]>([]);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [pageInfo, setPageInfo] = React.useState<PageInfo | null>(null);
const [loading, setLoading] = React.useState(true);
const [error, setError] = React.useState<string | null>(null);
Expand All @@ -24,8 +25,9 @@ const ProductsPage: React.FC = () => {
setProducts(response._embedded.productViewModels);
setPageInfo(response.page);
} catch (err) {

setError(err);
if(err instanceof Error) {
setError(err.message);
}
} finally {
setLoading(false);
}
Expand Down
28 changes: 0 additions & 28 deletions src/app/admin/layout.tsx

This file was deleted.

88 changes: 0 additions & 88 deletions src/app/admin/login/page.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/app/admin/orders/page.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/admin/page.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/app/admin/products/page.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/admin/users/page.tsx

This file was deleted.

Loading

0 comments on commit 49217b1

Please sign in to comment.