Skip to content

Commit

Permalink
Merge pull request #2246 from Plant-for-the-Planet-org/hotfix/minor-b…
Browse files Browse the repository at this point in the history
…ugs-and-cleanup

Fix tooltip translation bug and update package-lock
  • Loading branch information
mohitb35 authored Sep 30, 2024
2 parents 28ca413 + 938244a commit f3d67f4
Show file tree
Hide file tree
Showing 6 changed files with 785 additions and 734 deletions.
1,501 changes: 776 additions & 725 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pages/api/data-explorer/map/plant-location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ handler.post(async (req, response) => {
}

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

const plantLocations: SinglePlantLocationApiResponse[] = qRes.map(
(plantLocation) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useLocale } from 'next-intl';
import { getFormattedNumber } from '../../../../../../../utils/getFormattedNumber';
import styles from './index.module.scss';

interface Props {
headerTitle: string;
bodyTitle: string;
value: string;
locale: string;
}

export const Tooltip = ({ headerTitle, bodyTitle, value }: Props) => {
const locale = useLocale();

export const Tooltip = ({ headerTitle, bodyTitle, value, locale }: Props) => {
return (
<div className={styles.container}>
<div className={styles.header}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const SpeciesPlanted = () => {
headerTitle={w.globals.categoryLabels[dataPointIndex]}
bodyTitle={'Planted Species'}
value={s[0][dataPointIndex]}
locale={locale}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useLocale } from 'next-intl';
import { getFormattedNumber } from '../../../../../../../utils/getFormattedNumber';
import styles from './index.module.scss';

interface Props {
headerTitle: string;
bodyTitle: string;
value: string;
locale: string;
}

export const Tooltip = ({ headerTitle, bodyTitle, value }: Props) => {
const locale = useLocale();

export const Tooltip = ({ headerTitle, bodyTitle, value, locale }: Props) => {
return (
<div className={styles.container}>
<div className={styles.header}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export const TreePlanted = () => {
headerTitle={(categories as DaysCategories[])[dataPointIndex].label}
bodyTitle={t('treesPlanted')}
value={`${seriesData[dataPointIndex]}`}
locale={locale}
/>
);
case TIME_FRAME.WEEKS:
Expand All @@ -450,6 +451,7 @@ export const TreePlanted = () => {
}`}
bodyTitle={t('treesPlanted')}
value={`${seriesData[dataPointIndex]}`}
locale={locale}
/>
);
case TIME_FRAME.MONTHS:
Expand All @@ -460,6 +462,7 @@ export const TreePlanted = () => {
} ${(categories as MonthsCategories[])[dataPointIndex].year}`}
bodyTitle={t('treesPlanted')}
value={`${seriesData[dataPointIndex]}`}
locale={locale}
/>
);
case TIME_FRAME.YEARS:
Expand All @@ -468,6 +471,7 @@ export const TreePlanted = () => {
headerTitle={(categories as DaysCategories[])[dataPointIndex].label}
bodyTitle={t('treesPlanted')}
value={`${seriesData[dataPointIndex]}`}
locale={locale}
/>
);
default:
Expand Down

0 comments on commit f3d67f4

Please sign in to comment.