Skip to content

Commit

Permalink
chore(selector): encapsulate settings.baselineYear to the params object
Browse files Browse the repository at this point in the history
  • Loading branch information
willian-viana committed Nov 13, 2024
1 parent 5f3a5c8 commit 1244042
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const parseSentence = createSelector(
gain: formatNumber({ num: gain, unit: 'ha', spaceUnit: true }),
gainPercent: formatNumber({ num: gainPerc, unit: '%' }),
location,
baselineYear: settings?.baselineYear || 2000,
baselineYear: (settings?.baselineYear) || 2000,
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const parseSentence = createSelector(
percent: formatNumber({ num: areaPercent, unit: '%' }),
gainPercent: formatNumber({ num: gainPercent, unit: '%' }),
parent: parentLabel || null,
baselineYear: settings?.baselineYear || 2000,
baselineYear: (settings?.baselineYear) || 2000,
};

let sentence = indicator ? withIndicator : initial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const parseSentence = createSelector(
const aveFormat = avgGain < 1 ? '.3r' : '.3s';

const params = {
baselineYear: settings?.baselineYear || 2000,
baselineYear: (settings?.baselineYear) || 2000,
indicator: indicator && indicator.label,
location: locationName,
topGain: formatNumber({
Expand Down

0 comments on commit 1244042

Please sign in to comment.