Skip to content

Commit

Permalink
fix: on landscape map, link to profile (#1334)
Browse files Browse the repository at this point in the history
* feat: add profile link
* chore: Added ES translation
---------
Co-authored-by: Jose Buitron <[email protected]>
  • Loading branch information
paulschreiber authored Nov 29, 2023
1 parent 31c6aca commit 1f752ca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/landscape/components/LandscapeMapEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,28 @@ import { useSelector } from 'react-redux';
import { useFetchData } from 'terraso-client-shared/store/utils';
import { Typography } from '@mui/material';

import ExternalLink from 'common/components/ExternalLink';
import { useDocumentTitle } from 'common/document';
import PageLoader from 'layout/PageLoader';
import { fetchLandscapes } from 'landscape/landscapeSlice';

import LandscapeListMap from './LandscapeListMap';

const LandscapeDescriptionPopup = ({ landscape }) => (
<>
<Typography variant="h2">{landscape.data.name}</Typography>
<Typography variant="body2">{landscape.data.description}</Typography>
</>
);
const LandscapeDescriptionPopup = ({ landscape }) => {
const { t } = useTranslation();

return (
<>
<Typography variant="h2">{landscape.data.name}</Typography>
<Typography variant="body2">{landscape.data.description}</Typography>
<Typography variant="body2">
<ExternalLink href={`/landscapes/${landscape.data.slug}/profile`}>
{t('landscape.map_profile_link_text', { name: landscape.data.name })}
</ExternalLink>
</Typography>
</>
);
};

const LandscapeMapEmbed = () => {
const { t } = useTranslation();
Expand Down
1 change: 1 addition & 0 deletions src/localization/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
"boundaries_document_description": "Updated the boundary of the “{{name}}” landscape",
"list_column_actions_description": "Actions",
"view_map_title": "Landscape map",
"map_profile_link_text": "View {{name}}’s profile",
"boundaries_title": "Update {{name}}’s boundaries",
"boundaries_help_geojson": "Don’t have a GeoJSON file?",
"boundaries_help_geojson_detail": "<1>Learn how to create one</1>.",
Expand Down
1 change: 1 addition & 0 deletions src/localization/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
"boundaries_document_description": "Actualiza la frontera geográfica del paisaje “{{name}}”",
"list_column_actions_description": "Acciones",
"view_map_title": "Mapa del paisaje",
"map_profile_link_text": "Ver el perfil de {{name}}",
"boundaries_title": "Actualiza la información geográfica del {{name}}",
"boundaries_help_geojson": "¿No tienes un archivo GeoJSON?",
"boundaries_help_geojson_detail": "<1>Aprende a crear uno</1>.",
Expand Down

0 comments on commit 1f752ca

Please sign in to comment.