MY-LOGO
This commit is contained in:
parent
db2c063a9a
commit
9dd32244eb
5
.gitignore
vendored
5
.gitignore
vendored
@ -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
1
frontend/json/runtimeError.json
Normal file
1
frontend/json/runtimeError.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -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>
|
||||
|
||||
@ -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: 'Личный кабинет' },
|
||||
];
|
||||
|
||||
24
frontend/src/pages/about.tsx
Normal file
24
frontend/src/pages/about.tsx
Normal 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>;
|
||||
};
|
||||
58
frontend/src/pages/shop.tsx
Normal file
58
frontend/src/pages/shop.tsx
Normal 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>;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user