Skip to content

Commit

Permalink
Merge pull request #21 from meta-panic/feature/add-frontend-architecture
Browse files Browse the repository at this point in the history
frontend main page: in work
  • Loading branch information
meta-panic authored Jan 7, 2025
2 parents 0dd279c + 68319a3 commit b2a8cc0
Show file tree
Hide file tree
Showing 26 changed files with 759 additions and 116 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Where:
* **`<type>`:** One of the following types:
* `feat`: A new feature for the user.
* `fix`: A bug fix for the user.
* `hotfix`: A 🔥hot🔥 fix.
* `docs`: Changes to the documentation.
* `style`: Changes that don't affect the functionality (e.g., formatting, whitespace).
* `refactor`: A code change that neither fixes a bug nor adds a feature.
Expand Down
6 changes: 6 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const compat = new FlatCompat({

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
rules: {
"comma-dangle": ["error", "always-multiline"],
"semi": ["warn", "always"],
},
},
];

export default eslintConfig;
6 changes: 6 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
"lint": "next lint"
},
"dependencies": {
"classnames": "^2.5.1",
"next": "15.1.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.1.3"
"react-dom": "^19.0.0"
},
"devDependencies": {
"typescript": "^5",
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.1.3",
"@eslint/eslintrc": "^3"
"typescript": "^5"
}
}
}
Binary file added frontend/public/fonts/BebasNeue-Regular.ttf
Binary file not shown.
Binary file not shown.
Binary file added frontend/public/fonts/Raleway-regular.ttf
Binary file not shown.
Binary file added frontend/public/fonts/Raleway-semi-bold.ttf
Binary file not shown.
Empty file.
35 changes: 35 additions & 0 deletions frontend/src/app/components/navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";

export const Navigation = () => {
const pathname = usePathname();
return (
<nav className="flex justify-center items-center p-4">
<Link
href="/"
className={pathname === "/" ? "font-bold mr-4" : "text-blue-500 mr-4"}
>
Home
</Link>
<Link
href="/about"
className={
pathname === "/about" ? "font-bold mr-4" : "text-blue-500 mr-4"
}
>
About
</Link>
<Link
href="/products/1"
className={
pathname.startsWith("/products/1")
? "font-bold mr-4"
: "text-blue-500 mr-4"
}
>
Product 1
</Link>
</nav>
);
};
42 changes: 0 additions & 42 deletions frontend/src/app/globals.css

This file was deleted.

62 changes: 46 additions & 16 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,64 @@
import { isDebug } from "@/utils/isDebug";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import localFont from 'next/font/local';

const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
const bebas = localFont({
weight: '500',
variable: '--font-bebas-regular',
src: '../../public/fonts/BebasNeue-Regular.ttf',
display: 'swap',
});

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
const ralewayRegular = localFont({
weight: '500',
variable: '--font-raleway-regular',
src: '../../public/fonts/Raleway-regular.ttf',
display: 'swap',
});
const ralewayItalic = localFont({
weight: '500',
variable: '--font-raleway-italic',
src: '../../public/fonts/Raleway-Italic-VariableFont_wght.ttf',
display: 'swap',
});
const ralewaySemiBold = localFont({
weight: '500',
variable: '--font-raleway-semobold',
src: '../../public/fonts/Raleway-semi-bold.ttf',
display: 'swap',
});


export const metadata: Metadata = {
title: "Дом Молитвы",
description: "Дом Молитвы - христианская протестантская церковь",
title: "Дом молитвы",
description: "Церковь Евангельских христиан-баптистов",
icons: {
icon: { url: '/favicon.png' }
}
icon: { url: '/favicon.png' },
},
};

export default function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const isDevelopment = await isDebug();

if (!isDevelopment) {
return (
<html lang="ru">
<body className={`${bebas.variable} ${ralewayRegular.variable} ${ralewayItalic.variable} ${ralewaySemiBold.variable}`}>
{children}
</body>
</html>
);
}

return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<html lang="ru">
<body className={`${bebas.variable} ${ralewayRegular.variable} ${ralewayItalic.variable} ${ralewaySemiBold.variable}`}>
<header>header</header>
{children}
<footer>footer</footer>
</body>
</html>
);
Expand Down
103 changes: 50 additions & 53 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,53 @@
import Image from "next/image";

export default function Home() {
return (
<div style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
fontFamily: 'Arial, sans-serif',
backgroundColor: '#f4f4f4',
}}>
<Image
src="/church-logo.svg"
alt="Логотип церкви"
width={208}
height={96}
style={{ marginBottom: '1.5rem' }}
/>
<h1 style={{
fontSize: '2.5em',
textAlign: 'center',
color: '#333',
marginBottom: '0.5rem',
}}>Скоро здесь будет сайт</h1>
<p style={{
fontSize: '1.2em',
textAlign: 'center',
color: '#555',
}}>Загляните позже за обновлениями</p>
<p style={{
fontSize: '0.8em',
textAlign: 'center',
color: '#555',
marginTop: '2rem',
}}>
Местная религиозная организация Церковь Евангельских христиан-баптистов
</p>
<p style={{
fontSize: '0.8em',
textAlign: 'center',
color: '#555',
}}>
г. Невинномысск Ставропольского края
</p>
<p style={{
fontSize: '0.8em',
textAlign: 'center',
color: '#555',
}}>
ИНН 2631020933 / КПП 263101001
</p>
</div>
import "../styles/reset.css";
import "../styles/colours.css";
import "../styles/semantic.css";
import "../styles/sizes.css";
import "../styles/globals.css";

import Typography from "@/components/atoms/typography/Typography";
import { isDebug } from "@/utils/isDebug";


const Stub = () => {
return (<div style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
fontFamily: 'Arial, sans-serif',
backgroundColor: '#f4f4f4',
}}
>
<Image
src="/church-logo.svg"
alt="Логотип церкви"
width={208}
height={96}
style={{ marginBottom: '1.5rem' }}
/>
<Typography tag="H1">Скоро здесь будет сайт</Typography>
<Typography tag="body">Загляните позже за обновлениями</Typography>

<br />
<br />
<Typography tag="body-mini">Местная религиозная организация Церковь Евангельских христиан-баптистов</Typography>
<Typography tag="body-mini">г. Невинномысск Ставропольского края</Typography>
<Typography tag="body-mini">ИНН 2631020933 / КПП 263101001</Typography>
</div >
);
}
};

export default async function Home() {
const isDebugMode = await isDebug();

if (!isDebugMode) {
console.log("Runnin in prod mode");
return <Stub />;
}

console.log("Runnin in debug mode");
return (<div>test</div>);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.dark-block {
--default-text: var(--common-light-100);
--default-components-link-fg: #f8f6f7;
--hover-text: var(--common-light-100);
--hover-components-link-fg: #f8f6f7;
--active-text-ondark: var(--common-light-100);
--active-components-link-fg: #f8f6f7;
}
26 changes: 26 additions & 0 deletions frontend/src/components/atoms/ColorBlock/ColorBlock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { createContext, ReactNode } from 'react';
import classNames from 'classnames';
import styles from './ColorBlock.module.css';

type BlockColor = 'light' | 'dark';

const BlockColorContext = createContext<BlockColor>('light');

interface BlockColorProviderProps {
children: ReactNode;
blockColor: BlockColor;
}

export const BlockColorProvider: React.FC<BlockColorProviderProps> = ({ children, blockColor }) => {
return (
<BlockColorContext.Provider
value={blockColor}
>
<div
className={classNames({ [styles["dark-block"]]: blockColor === 'dark' })}
>
{children}
</div>
</BlockColorContext.Provider>
);
};
Loading

0 comments on commit b2a8cc0

Please sign in to comment.