mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 09:31:35 -04:00
refactor(frontend): switch to DTOs from @hedgedoc/commons
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>
This commit is contained in:
parent
deee8e885f
commit
e411ddf099
121 changed files with 620 additions and 819 deletions
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { BrandingConfig } from '../../../api/config/types'
|
||||
import type { BrandingDto } from '@hedgedoc/commons'
|
||||
import { useFrontendConfig } from '../frontend-config-context/use-frontend-config'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
|
@ -12,10 +12,10 @@ import { useMemo } from 'react'
|
|||
*
|
||||
* @return the branding configuration or null if no branding has been configured
|
||||
*/
|
||||
export const useBrandingDetails = (): null | BrandingConfig => {
|
||||
export const useBrandingDetails = (): null | BrandingDto => {
|
||||
const branding = useFrontendConfig().branding
|
||||
|
||||
return useMemo(() => {
|
||||
return !branding.name && !branding.logo ? null : branding
|
||||
return branding.name === null && branding.logo === null ? null : branding
|
||||
}, [branding])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue