mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00

Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
21 lines
663 B
TypeScript
21 lines
663 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import type { BrandingDto } from '@hedgedoc/commons'
|
|
import { useFrontendConfig } from '../frontend-config-context/use-frontend-config'
|
|
import { useMemo } from 'react'
|
|
|
|
/**
|
|
* Extracts the branding from the config.
|
|
*
|
|
* @return the branding configuration or null if no branding has been configured
|
|
*/
|
|
export const useBrandingDetails = (): null | BrandingDto => {
|
|
const branding = useFrontendConfig().branding
|
|
|
|
return useMemo(() => {
|
|
return branding.name === null && branding.logo === null ? null : branding
|
|
}, [branding])
|
|
}
|