mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 12:07:08 -04:00
parent
5baef25b21
commit
0e8d2f1639
13 changed files with 188 additions and 63 deletions
|
@ -1,35 +1,36 @@
|
|||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { TranslatedLink } from './translated-link'
|
||||
import React, { Fragment } from 'react'
|
||||
import { ExternalLink } from './external-link'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { ApplicationState } from '../../../../redux'
|
||||
import { ExternalLink } from '../../../links/external-link'
|
||||
import { TranslatedExternalLink } from '../../../links/translated-external-link'
|
||||
import { VersionInfo } from '../version-info/version-info'
|
||||
|
||||
export const PoweredByLinks: React.FC = () => {
|
||||
useTranslation()
|
||||
|
||||
const defaultLinks =
|
||||
{
|
||||
releases: '/s/release-notes',
|
||||
sourceCode: 'https://github.com/codimd/server/tree/41b13e71b6b1d499238c04b15d65e3bd76442f1d'
|
||||
releases: '/n/release-notes'
|
||||
}
|
||||
|
||||
const config = useSelector((state: ApplicationState) => state.backendConfig)
|
||||
|
||||
return (
|
||||
<p>
|
||||
<Trans i18nKey="poweredBy" components={[<ExternalLink href="https://codimd.org" text="CodiMD"/>]}/>
|
||||
<Trans i18nKey="poweredBy">
|
||||
<ExternalLink href="https://codimd.org" text="CodiMD"/>
|
||||
</Trans>
|
||||
{
|
||||
Object.entries({ ...defaultLinks, ...(config.specialLinks) }).map(([i18nKey, href]) =>
|
||||
<Fragment key={i18nKey}>
|
||||
|
|
||||
<TranslatedLink
|
||||
href={href}
|
||||
i18nKey={i18nKey}
|
||||
/>
|
||||
<TranslatedExternalLink href={href} i18nKey={i18nKey}/>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
|
||||
<VersionInfo/>
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue