Correct use selector (#515)

This commit is contained in:
mrdrogdrog 2020-08-30 21:24:34 +02:00 committed by GitHub
parent 971421925a
commit a41d3d1515
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 74 additions and 205 deletions

View file

@ -10,7 +10,7 @@ import { VersionInfo } from './version-info'
export const PoweredByLinks: React.FC = () => {
useTranslation()
const config = useSelector((state: ApplicationState) => state.config)
const specialLinks = useSelector((state: ApplicationState) => Object.entries(state.config.specialLinks) as [string, string][])
return (
<p>
@ -20,7 +20,7 @@ export const PoweredByLinks: React.FC = () => {
&nbsp;|&nbsp;
<TranslatedInternalLink href='/n/release-notes' i18nKey='landing.footer.releases'/>
{
Object.entries({ ...config.specialLinks }).map(([i18nKey, href]) =>
specialLinks.map(([i18nKey, href]) =>
<Fragment key={i18nKey}>
&nbsp;|&nbsp;
<TranslatedExternalLink href={href} i18nKey={'landing.footer.' + i18nKey}/>

View file

@ -8,6 +8,7 @@ import frontendVersion from '../../../version.json'
import { TranslatedExternalLink } from '../../common/links/translated-external-link'
import { ShowIf } from '../../common/show-if/show-if'
import { CopyableField } from '../../common/copyable-field/copyable-field'
import equal from 'fast-deep-equal'
export const VersionInfo: React.FC = () => {
const [show, setShow] = useState(false)
@ -17,7 +18,7 @@ export const VersionInfo: React.FC = () => {
const { t } = useTranslation()
const serverVersion = useSelector((state: ApplicationState) => state.config.version)
const serverVersion = useSelector((state: ApplicationState) => state.config.version, equal)
const column = (title: string, version: string, sourceCodeLink: string, issueTrackerLink: string) => (
<Col md={6} className={'flex-column'}>