refactor: restrict WikiTree integration to the apps.wikitree.com domain and add helper utilities

This commit is contained in:
Przemek Więch
2026-07-05 20:35:44 +02:00
parent aeb73aced7
commit b285fe349f
6 changed files with 49 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import {Card, Grid, Image} from 'semantic-ui-react';
import {getChangelog, updateSeenVersion} from './changelog';
import logo from './topola.jpg';
import {Media} from './util/media';
import {isOnWikitreeDomain, WIKITREE_TOPOLA_URL} from './util/wikitree_util';
/** Link that loads a view. */
function ViewLink(props: {params: {[key: string]: string}; text: string}) {
@@ -82,13 +83,23 @@ function Contents() {
)
</li>
<li>
<ViewLink
params={{
indi: 'Skłodowska-2',
source: 'wikitree',
}}
text="Maria Skłodowska-Curie"
/>{' '}
{isOnWikitreeDomain() ? (
<ViewLink
params={{
indi: 'Skłodowska-2',
source: 'wikitree',
}}
text="Maria Skłodowska-Curie"
/>
) : (
<a
href={`${WIKITREE_TOPOLA_URL}/#/view?source=wikitree&indi=Sk%C5%82odowska-2`}
target="_blank"
rel="noopener noreferrer"
>
Maria Skłodowska-Curie
</a>
)}{' '}
(<FormattedMessage id="intro.from" defaultMessage="from" />{' '}
<a href="https://www.wikitree.com/wiki/Sk%C5%82odowska-2">
wikitree.com