mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
✨ Ability to change title and icons V2!
Results of criticism in pull request #182
This commit is contained in:
@@ -7,8 +7,8 @@ export function HeaderConfig(props: any) {
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<title>{config.title ?? "Homarr 🦞"}</title>
|
||||
<link rel="shortcut icon" href={config.favicon ?? "/favicon.svg"} />
|
||||
<title>{config.settings.title || 'Homarr 🦞'}</title>
|
||||
<link rel="shortcut icon" href={config.settings.favicon || '/favicon.svg'} />
|
||||
</Head>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { AppShell, createStyles } from '@mantine/core';
|
||||
import { Header } from './Header';
|
||||
import { Footer } from './Footer';
|
||||
import Aside from './Aside';
|
||||
import { HeaderConfig } from './HeaderConfig';
|
||||
|
||||
const useStyles = createStyles((theme) => ({
|
||||
main: {},
|
||||
@@ -10,11 +11,8 @@ const useStyles = createStyles((theme) => ({
|
||||
export default function Layout({ children, style }: any) {
|
||||
const { classes, cx } = useStyles();
|
||||
return (
|
||||
<AppShell
|
||||
aside={<Aside />}
|
||||
header={<Header />}
|
||||
footer={<Footer links={[]} />}
|
||||
>
|
||||
<AppShell aside={<Aside />} header={<Header />} footer={<Footer links={[]} />}>
|
||||
<HeaderConfig />
|
||||
<main
|
||||
className={cx(classes.main)}
|
||||
style={{
|
||||
|
||||
@@ -10,7 +10,7 @@ export function Logo({ style }: any) {
|
||||
<Group spacing="xs">
|
||||
<Image
|
||||
width={50}
|
||||
src={config.logo ?? "/imgs/logo.png"}
|
||||
src={config.settings.logo || '/imgs/logo.png'}
|
||||
style={{
|
||||
position: 'relative',
|
||||
}}
|
||||
@@ -28,8 +28,7 @@ export function Logo({ style }: any) {
|
||||
variant="gradient"
|
||||
gradient={{ from: 'red', to: 'orange', deg: 145 }}
|
||||
>
|
||||
{/* Added the .replace to remove emojis because they get screwed up by the gradient */}
|
||||
{config.title.replace(/([\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g, '') ?? "Homarr"}
|
||||
{config.settings.title || 'Homarr'}
|
||||
</Text>
|
||||
</NextLink>
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user