+ Приведены все функции приложения в рабочий вид

+ Наведен порядок в файлах проекта
+ Наведен порядок в документации
+ Настроены скрипты установки, развертки и так далее, расширен MakeFile
This commit is contained in:
2025-11-02 06:09:55 +09:00
parent 367e1c932e
commit 2e535513b5
6103 changed files with 7040 additions and 1027861 deletions

View File

@@ -9,7 +9,7 @@ import Script from 'next/script'
interface User {
username: string
avatar: string
avatar: string | null
}
export function LayoutWrapper({ children }: { children: ReactNode }) {
@@ -44,7 +44,10 @@ export function LayoutWrapper({ children }: { children: ReactNode }) {
}, [])
const handleLogout = () => {
localStorage.removeItem('token')
if (typeof window !== 'undefined') {
localStorage.removeItem('token')
}
setUser(null)
router.push('/')
}
@@ -80,9 +83,11 @@ export function LayoutWrapper({ children }: { children: ReactNode }) {
<div className="ms-auto d-flex align-items-center gap-3">
<Image
src={
user.avatar.startsWith('http')
user.avatar && user.avatar.startsWith('http')
? user.avatar
: `http://localhost:8000${user.avatar}`
: user.avatar
? `http://localhost:8000${user.avatar}`
: '/assets/img/avatar-dhg.png'
}
alt="Avatar"
width={32}
@@ -115,8 +120,8 @@ export function LayoutWrapper({ children }: { children: ReactNode }) {
{/* Подвал не выводим на публичных страницах */}
{!isPublicUserPage && (
<footer className="bg-light footer fixed-bottom border-top">
<div className="container py-2">
<footer className="bg-light footer border-top mt-5">
<div className="container py-4">
<div className="row">
<div className="col-lg-6 text-center text-lg-start mb-2 mb-lg-0">
<ul className="list-inline mb-1">
@@ -143,15 +148,12 @@ export function LayoutWrapper({ children }: { children: ReactNode }) {
)}
{/* Bootstrap JS */}
<Script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"
strategy="beforeInteractive"
/>
{/* Bootstrap JS: load after React hydrates to avoid DOM mutations during hydration */}
<Script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
strategy="beforeInteractive"
strategy="afterInteractive"
/>
<Script src="/assets/js/bs-init.js" strategy="lazyOnload" />
<Script src="/assets/js/bs-init.js" strategy="afterInteractive" />
</>
)
}