Replace empty components with hooks (#666)

This commit is contained in:
mrdrogdrog 2020-10-12 22:33:23 +02:00 committed by GitHub
parent 9e9108ec9a
commit 0d2c2fe0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 24 deletions

View file

@ -1,17 +0,0 @@
import React, { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { ApplicationState } from '../../../redux'
export interface DocumentTitleProps {
title?: string
}
export const DocumentTitle: React.FC<DocumentTitleProps> = ({ title }) => {
const brandingName = useSelector((state: ApplicationState) => state.config.branding.name)
useEffect(() => {
document.title = `${title ? title + ' - ' : ''}HedgeDoc ${brandingName ? ` @ ${brandingName}` : ''}`
}, [brandingName, title])
return null
}