Skip to content

Commit f3d67f4

Browse files
authored
Merge pull request #2246 from Plant-for-the-Planet-org/hotfix/minor-bugs-and-cleanup
Fix tooltip translation bug and update package-lock
2 parents 28ca413 + 938244a commit f3d67f4

File tree

6 files changed

+785
-734
lines changed

6 files changed

+785
-734
lines changed

package-lock.json

Lines changed: 776 additions & 725 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pages/api/data-explorer/map/plant-location/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ handler.post(async (req, response) => {
5454
}
5555

5656
const qRes = await db.query<UncleanPlantLocations[]>(query, values);
57-
console.log('qRes:', qRes);
5857

5958
const plantLocations: SinglePlantLocationApiResponse[] = qRes.map(
6059
(plantLocation) => ({

src/features/user/TreeMapper/Analytics/components/SpeciesPlanted/Tooltip/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { useLocale } from 'next-intl';
21
import { getFormattedNumber } from '../../../../../../../utils/getFormattedNumber';
32
import styles from './index.module.scss';
43

54
interface Props {
65
headerTitle: string;
76
bodyTitle: string;
87
value: string;
8+
locale: string;
99
}
1010

11-
export const Tooltip = ({ headerTitle, bodyTitle, value }: Props) => {
12-
const locale = useLocale();
13-
11+
export const Tooltip = ({ headerTitle, bodyTitle, value, locale }: Props) => {
1412
return (
1513
<div className={styles.container}>
1614
<div className={styles.header}>

src/features/user/TreeMapper/Analytics/components/SpeciesPlanted/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const SpeciesPlanted = () => {
9898
headerTitle={w.globals.categoryLabels[dataPointIndex]}
9999
bodyTitle={'Planted Species'}
100100
value={s[0][dataPointIndex]}
101+
locale={locale}
101102
/>
102103
);
103104
};

src/features/user/TreeMapper/Analytics/components/TreePlanted/Tooltip/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { useLocale } from 'next-intl';
21
import { getFormattedNumber } from '../../../../../../../utils/getFormattedNumber';
32
import styles from './index.module.scss';
43

54
interface Props {
65
headerTitle: string;
76
bodyTitle: string;
87
value: string;
8+
locale: string;
99
}
1010

11-
export const Tooltip = ({ headerTitle, bodyTitle, value }: Props) => {
12-
const locale = useLocale();
13-
11+
export const Tooltip = ({ headerTitle, bodyTitle, value, locale }: Props) => {
1412
return (
1513
<div className={styles.container}>
1614
<div className={styles.header}>

src/features/user/TreeMapper/Analytics/components/TreePlanted/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ export const TreePlanted = () => {
438438
headerTitle={(categories as DaysCategories[])[dataPointIndex].label}
439439
bodyTitle={t('treesPlanted')}
440440
value={`${seriesData[dataPointIndex]}`}
441+
locale={locale}
441442
/>
442443
);
443444
case TIME_FRAME.WEEKS:
@@ -450,6 +451,7 @@ export const TreePlanted = () => {
450451
}`}
451452
bodyTitle={t('treesPlanted')}
452453
value={`${seriesData[dataPointIndex]}`}
454+
locale={locale}
453455
/>
454456
);
455457
case TIME_FRAME.MONTHS:
@@ -460,6 +462,7 @@ export const TreePlanted = () => {
460462
} ${(categories as MonthsCategories[])[dataPointIndex].year}`}
461463
bodyTitle={t('treesPlanted')}
462464
value={`${seriesData[dataPointIndex]}`}
465+
locale={locale}
463466
/>
464467
);
465468
case TIME_FRAME.YEARS:
@@ -468,6 +471,7 @@ export const TreePlanted = () => {
468471
headerTitle={(categories as DaysCategories[])[dataPointIndex].label}
469472
bodyTitle={t('treesPlanted')}
470473
value={`${seriesData[dataPointIndex]}`}
474+
locale={locale}
471475
/>
472476
);
473477
default:

0 commit comments

Comments
 (0)