Skip to content

Commit b25d023

Browse files
committed
[OPG] Remove additional OPG links for now
1 parent 37e8e31 commit b25d023

2 files changed

Lines changed: 4 additions & 28 deletions

File tree

src/components/FeaturePanel/FeatureOpenPlaceGuideLink.tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useEffect, useState } from 'react';
1+
import React, { useState } from 'react';
22
import styled from '@emotion/styled';
33
import { Button } from '@mui/material';
44
import { t } from '../../services/intl';
55
import { fetchJson } from '../../services/fetch';
66
import { useFeatureContext } from '../utils/FeatureContext';
7-
import { getUrlOsmId } from '../../services/helpers';
7+
import { getDetailPageLink } from '../../services/helpers';
88
import { LonLat } from '../../services/types';
99

1010
const Spacer = styled.div`
@@ -30,18 +30,9 @@ const getData = async (center: LonLat, osmId: string) => {
3030
const OpenPlaceGuideLink = () => {
3131
const [instances, setInstances] = useState<Instance[]>([]);
3232
const { feature } = useFeatureContext();
33-
const osmId = getUrlOsmId(feature.osmMeta);
34-
35-
useEffect(() => {
36-
getData(feature.center, osmId).then((data) => setInstances(data ?? []));
37-
}, [feature.center, osmId]);
38-
39-
if (instances.length === 0) {
40-
return null;
41-
}
4233

4334
const selfInstance = {
44-
url: `${window.location.origin}/detail/${osmId}`,
35+
url: getDetailPageLink(feature),
4536
name: 'map.et',
4637
};
4738

@@ -50,22 +41,7 @@ const OpenPlaceGuideLink = () => {
5041
<Button variant="contained" href={selfInstance.url}>
5142
{t('featurepanel.detail_page')}
5243
</Button>
53-
5444
<Spacer />
55-
{instances.map((instance) =>
56-
instance.name === selfInstance.name ? (
57-
''
58-
) : (
59-
<>
60-
<a href={instance.url}>
61-
{t('featurepanel.more_in_openplaceguide', {
62-
instanceName: instance.name,
63-
})}
64-
</a>
65-
<Spacer />
66-
</>
67-
),
68-
)}
6945
</>
7046
);
7147
};

src/locales/vocabulary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default {
195195
'featurepanel.inline_edit_title': 'Edit',
196196
'featurepanel.objects_around': 'Nearby objects',
197197
'featurepanel.more_in_openplaceguide': 'More information on __instanceName__',
198-
'featurepanel.detail_page': 'Detail page',
198+
'featurepanel.detail_page': 'More Information',
199199
'featurepanel.climbing_restriction': 'Climbing restriction',
200200
'featurepanel.login': 'Login',
201201
'featurepanel.footer_title': 'Other info',

0 commit comments

Comments
 (0)