mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 17:56:21 +01:00
✨ Add common header to manage pages
This commit is contained in:
@@ -46,6 +46,7 @@ import { useScreenLargerThan } from '~/hooks/useScreenLargerThan';
|
||||
import { usePackageAttributesStore } from '~/tools/client/zustands/usePackageAttributesStore';
|
||||
|
||||
import { Logo } from '../Logo';
|
||||
import { CommonHeader } from '../common-header';
|
||||
import { MainHeader } from '../new-header/Header';
|
||||
|
||||
interface MainLayoutProps {
|
||||
@@ -140,17 +141,7 @@ export const MainLayout = ({ children }: MainLayoutProps) => {
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<link rel="shortcut icon" href="/imgs/favicon/favicon.svg" />
|
||||
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
|
||||
{/* configure apple splash screen & touch icon */}
|
||||
<link rel="apple-touch-icon" href="/imgs/favicon/favicon.svg" />
|
||||
<meta name="apple-mobile-web-app-title" content="Homarr" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
</Head>
|
||||
<CommonHeader />
|
||||
<AppShell
|
||||
styles={{
|
||||
root: {
|
||||
|
||||
24
src/components/layout/common-header.tsx
Normal file
24
src/components/layout/common-header.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import Head from 'next/head';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
interface CommonHeaderProps {
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export const CommonHeader = ({ children }: CommonHeaderProps) => {
|
||||
return (
|
||||
<Head>
|
||||
<link rel="shortcut icon" href="/imgs/favicon/favicon.svg" />
|
||||
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
|
||||
{/* configure apple splash screen & touch icon */}
|
||||
<link rel="apple-touch-icon" href="/imgs/favicon/favicon.svg" />
|
||||
<meta name="apple-mobile-web-app-title" content="Homarr" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
|
||||
{children}
|
||||
</Head>
|
||||
);
|
||||
};
|
||||
@@ -19,6 +19,7 @@ import { useTranslation } from 'next-i18next';
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
||||
import { useRouter } from 'next/router';
|
||||
import { z } from 'zod';
|
||||
import { CommonHeader } from '~/components/layout/common-header';
|
||||
import { signInSchema } from '~/validations/user';
|
||||
|
||||
import { loginNamespaces } from '../../tools/server/translation-namespaces';
|
||||
@@ -44,6 +45,9 @@ export default function LoginPage() {
|
||||
|
||||
return (
|
||||
<Flex h="100dvh" display="flex" w="100%" direction="column" align="center" justify="center">
|
||||
<CommonHeader>
|
||||
<title>Login • Homarr</title>
|
||||
</CommonHeader>
|
||||
<Card withBorder shadow="md" p="xl" radius="md" w="90%" maw={420}>
|
||||
<Title align="center" weight={900}>
|
||||
{t('title')}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Head from 'next/head';
|
||||
import { forwardRef } from 'react';
|
||||
import { AccessibilitySettings } from '~/components/Settings/Customization/Accessibility/AccessibilitySettings';
|
||||
import { MainLayout } from '~/components/layout/admin/main-admin.layout';
|
||||
import { CommonHeader } from '~/components/layout/common-header';
|
||||
import { languages } from '~/tools/language';
|
||||
|
||||
const PreferencesPage = () => {
|
||||
@@ -15,9 +16,9 @@ const PreferencesPage = () => {
|
||||
}));
|
||||
return (
|
||||
<MainLayout>
|
||||
<Head>
|
||||
<CommonHeader>
|
||||
<title>Preferences • Homarr</title>
|
||||
</Head>
|
||||
</CommonHeader>
|
||||
<Title mb="xl">Preferences</Title>
|
||||
|
||||
<Stack spacing={5}>
|
||||
|
||||
Reference in New Issue
Block a user