This commit is contained in:
Flatlogic Bot 2025-08-31 20:24:31 +00:00
parent db2c063a9a
commit 9dd32244eb
7 changed files with 97 additions and 18 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
node_modules/
*/node_modules/
*/build/
**/node_modules/
**/build/
.DS_Store
.env

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{}

View File

@ -62,17 +62,6 @@ export default function WebSiteHeader({ projectName }: WebSiteHeaderProps) {
})}
</div>
</div>
<div
id='loginButton'
className='flex justify-center md:justify-start w-full md:w-auto mt-4 md:mt-0'
>
<BaseButton
href='/login'
label='Login'
color={`${design ? 'info' : 'white'}`}
className='text-midnightBlueTheme-buttonColor px-6 py-2 '
/>
</div>
</div>
</div>
</div>

View File

@ -46,6 +46,9 @@ const menuNavBar: MenuNavBarItem[] = [
},
];
export const webPagesNavBar = [];
export default menuNavBar;
export const webPagesNavBar = [
{ href: '/about', label: 'О нас' },
{ href: '/shop', label: 'Магазин' },
{ href: '/services', label: 'Наши услуги' },
{ href: '/login', label: 'Личный кабинет' },
];

View File

@ -0,0 +1,24 @@
import React from 'react';
import type { ReactElement } from 'react';
import Head from 'next/head';
import LayoutGuest from '../layouts/Guest';
import WebSiteHeader from '../components/WebPageComponents/Header';
import AboutUsComponent from '../components/WebPageComponents/AboutUsComponent';
import WebSiteFooter from '../components/WebPageComponents/Footer';
export default function AboutPage() {
return (
<>
<Head>
<title>О нас - my-logo</title>
</Head>
<WebSiteHeader projectName="my-logo" />
<AboutUsComponent />
<WebSiteFooter />
</>
);
}
AboutPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>;
};

View File

@ -0,0 +1,58 @@
import React, { useEffect, useState } from 'react';
import type { ReactElement } from 'react';
import Head from 'next/head';
import LayoutGuest from '../layouts/Guest';
import WebSiteHeader from '../components/WebPageComponents/Header';
import WebSiteFooter from '../components/WebPageComponents/Footer';
import CardBox from '../components/CardBox';
import BaseButton from '../components/BaseButton';
export default function ShopPage() {
const [products, setProducts] = useState<any[]>([]);
useEffect(() => {
async function fetchProducts() {
try {
const res = await fetch('/api/products');
const data = await res.json();
setProducts(data);
} catch (error) {
console.error('Failed to load products', error);
}
}
fetchProducts();
}, []);
return (
<>
<Head>
<title>Магазин</title>
</Head>
<WebSiteHeader projectName="my-logo" />
<div className="container mx-auto px-4 py-8">
<h1 className="text-3xl font-bold mb-6">Магазин</h1>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
{products.map(product => (
<CardBox key={product.id} className="p-4">
{product.images && product.images.length > 0 && (
<img
src={product.images[0]}
alt={product.name}
className="w-full h-48 object-cover mb-4"
/>
)}
<h2 className="text-xl font-semibold mb-2">{product.name}</h2>
<p className="text-lg text-gray-700 mb-4">{product.price} руб.</p>
<BaseButton href="#" label="В корзину" className="w-full" />
</CardBox>
))}
</div>
</div>
<WebSiteFooter />
</>
);
}
ShopPage.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>;
};