Added advanced branding

This commit is contained in:
Sebastian Weise 2022-10-31 11:55:53 +01:00
parent 29fa4fe3bd
commit 7bf83d65b9
8 changed files with 50 additions and 12 deletions

View file

@ -7,7 +7,11 @@ import styles from './EmptyPlaceholder.module.css';
function EmptyPlaceholder({ msg, children }) {
return (
<div className={styles.placeholder}>
<Icon className={styles.icon} icon={<Logo />} size="xlarge" />
<Icon
icon={process.env.NEXT_PUBLIC_CUSTOM_LOGO_URL || <Logo />}
size="xlarge"
className={styles.icon}
/>
<h2 className={styles.msg}>{msg}</h2>
{children}
</div>

View file

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Image from 'next/image';
import styles from './Icon.module.css';
function Icon({ icon, className, size = 'medium', ...props }) {
@ -15,7 +16,7 @@ function Icon({ icon, className, size = 'medium', ...props }) {
})}
{...props}
>
{icon}
{typeof icon === 'string' ? <Image src={icon} width={20} height={20} /> : icon}
</div>
);
}

View file

@ -76,7 +76,11 @@ export default function LoginForm() {
{() => (
<Form>
<div className={styles.header}>
<Icon icon={<Logo />} size="xlarge" className={styles.icon} />
<Icon
icon={process.env.NEXT_PUBLIC_CUSTOM_LOGO_URL || <Logo />}
size="xlarge"
className={styles.icon}
/>
<h1 className="center">{process.env.NEXT_PUBLIC_CUSTOM_TITLE || 'umami'}</h1>
</div>
<FormRow>

View file

@ -26,7 +26,11 @@ export default function Header() {
{allowUpdate && <UpdateNotice />}
<header className={classNames(styles.header, 'row')}>
<div className={styles.title}>
<Icon icon={<Logo />} size="large" className={styles.logo} />
<Icon
icon={process.env.NEXT_PUBLIC_CUSTOM_FAVICON_URL || <Logo />}
size="large"
className={styles.logo}
/>
<Link
href={isSharePage ? process.env.NEXT_PUBLIC_CUSTOM_HOMEPAGE_URL || HOMEPAGE_URL : '/'}
>