Skip to content

Commit

Permalink
chore: move layer action hint strings into layer_actions.tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
albaranau committed Jun 3, 2024
1 parent 869da55 commit 070457b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
5 changes: 4 additions & 1 deletion src/components/Layer/DownloadControl/DownloadControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { LayerActionIcon } from '~components/LayerActionIcon/LayerActionIcon';

export function DownloadControl({ startDownload }: { startDownload: () => void }) {
return (
<LayerActionIcon onClick={startDownload} hint={i18n.t('tooltips.download')}>
<LayerActionIcon
onClick={startDownload}
hint={i18n.t('layer_actions.tooltips.download')}
>
<Download16 />
</LayerActionIcon>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layer/EditControl/EditControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function EditControl({
}, [featureFlags, layerActions, layerState]);

return (
<LayerActionIcon onClick={editLayer} hint={i18n.t('tooltips.edit')}>
<LayerActionIcon onClick={editLayer} hint={i18n.t('layer_actions.tooltips.edit')}>
<Edit16 />
</LayerActionIcon>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layer/EraseControl/CleanControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function CleanControl({ layerActions }: { layerActions: LogicalLayerActio
);

return (
<LayerActionIcon onClick={cleanLayer} hint={i18n.t('tooltips.erase')}>
<LayerActionIcon onClick={cleanLayer} hint={i18n.t('layer_actions.tooltips.erase')}>
<Rubber16 />
</LayerActionIcon>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/LayerHideControl/LayerHideControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export function LayerHideControl({
}: LayerHideControlType) {
if (isVisible) {
return (
<LayerActionIcon onClick={hideLayer} hint={i18n.t('tooltips.hide')}>
<LayerActionIcon onClick={hideLayer} hint={i18n.t('layer_actions.tooltips.hide')}>
<Eye16 />
</LayerActionIcon>
);
}

return (
<LayerActionIcon onClick={unhideLayer} hint={i18n.t('tooltips.show')}>
<LayerActionIcon onClick={unhideLayer} hint={i18n.t('layer_actions.tooltips.show')}>
<EyeOff16 />
</LayerActionIcon>
);
Expand Down
14 changes: 8 additions & 6 deletions src/core/localization/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
"selected_area_label": "Selected area",
"upload_mcda": "Upload MCDA"
},
"tooltips": {
"erase": "Erase",
"download": "Download",
"edit": "Edit",
"hide": "Hide",
"show": "Show"
"layer_actions": {
"tooltips": {
"erase": "Erase",
"download": "Download",
"edit": "Edit",
"hide": "Hide",
"show": "Show"
}
},
"feed": "Feed",
"deselect": "Deselect",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export function MCDALayerParameters({ layer, onLayerEdited }: MCDALayerLegendPro
{!editMode && (
<LayerActionIcon
onClick={editLayer}
hint={i18n.t('tooltips.edit')}
hint={i18n.t('layer_actions.tooltips.edit')}
className={s.editButton}
>
<Edit16 />
Expand Down

0 comments on commit 070457b

Please sign in to comment.