Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: on landscape map, link to profile #1334

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading