From 493ab9204d9a706d0dacb5f74f296793dec716eb Mon Sep 17 00:00:00 2001 From: jedtan Date: Thu, 13 Jul 2023 17:33:57 -0400 Subject: [PATCH] Fixing some Spacing, Fixing Env Var --- .env.development | 2 +- .env.local.info | 2 +- .env.preview.info | 4 ++++ .env.production.info | 2 +- .../GroupImpactLeaderboard.js | 5 ++++- .../groupImpactComponents/GroupImpactSidebar.js | 1 - .../__tests__/GroupImpactLeaderboard.test.js | 2 +- .../__tests__/GroupImpactLeaderboardRow.test.js | 2 +- src/utils/__tests__/misc.test.js | 14 +++++++------- src/utils/misc.js | 4 ++-- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.env.development b/.env.development index f7e01b62..5df0ddf5 100644 --- a/.env.development +++ b/.env.development @@ -72,4 +72,4 @@ NEXT_PUBLIC_GROWTHBOOK_ENV=dev ########## Estimated Money Per Tab ########## -EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file +NEXT_EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file diff --git a/.env.local.info b/.env.local.info index f2c7b1ef..afa8f850 100644 --- a/.env.local.info +++ b/.env.local.info @@ -33,4 +33,4 @@ NEXT_PUBLIC_GROWTHBOOK_ENV=local ########## Estimated Money Per Tab ########## -EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file +NEXT_EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file diff --git a/.env.preview.info b/.env.preview.info index cf76523d..8a433952 100644 --- a/.env.preview.info +++ b/.env.preview.info @@ -69,3 +69,7 @@ NEXT_PUBLIC_MEDIA_ENDPOINT=https://prod-tab2017-media.gladly.io ########## Growthbook ########## NEXT_PUBLIC_GROWTHBOOK_ENV=dev + +########## Estimated Money Per Tab ########## + +NEXT_EST_MONEY_RAISED_PER_TAB=0.000765 diff --git a/.env.production.info b/.env.production.info index 7fa91a60..374a08b9 100644 --- a/.env.production.info +++ b/.env.production.info @@ -77,4 +77,4 @@ NEXT_PUBLIC_GROWTHBOOK_ENV=production ########## Estimated Money Per Tab ########## -EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file +NEXT_EST_MONEY_RAISED_PER_TAB=0.000765 \ No newline at end of file diff --git a/src/components/groupImpactComponents/GroupImpactLeaderboard.js b/src/components/groupImpactComponents/GroupImpactLeaderboard.js index c3cafabe..5497c0eb 100644 --- a/src/components/groupImpactComponents/GroupImpactLeaderboard.js +++ b/src/components/groupImpactComponents/GroupImpactLeaderboard.js @@ -57,6 +57,9 @@ const useStyles = makeStyles((theme) => ({ marginRight: theme.spacing(2), width: '90px', }, + subtitle: { + marginBottom: theme.spacing(2), + }, })) const Leaderboard = ({ leaderboardEntries, userId, onClose }) => { @@ -100,7 +103,7 @@ const Leaderboard = ({ leaderboardEntries, userId, onClose }) => { LEADERBOARD - + Impact points earned for this group goal by opening tabs, searching, and/or shopping diff --git a/src/components/groupImpactComponents/GroupImpactSidebar.js b/src/components/groupImpactComponents/GroupImpactSidebar.js index 75317914..96f5c5c1 100644 --- a/src/components/groupImpactComponents/GroupImpactSidebar.js +++ b/src/components/groupImpactComponents/GroupImpactSidebar.js @@ -58,7 +58,6 @@ const useStyles = makeStyles((theme) => ({ display: 'flex', flexDirection: 'row', paddingLeft: theme.spacing(2), - paddingRight: theme.spacing(2), cursor: 'pointer', position: 'relative', maxHeight: '100vh', diff --git a/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboard.test.js b/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboard.test.js index 0fde5233..162db58a 100644 --- a/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboard.test.js +++ b/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboard.test.js @@ -63,7 +63,7 @@ const getMockProps = () => ({ }) beforeEach(() => { - process.env.EST_MONEY_RAISED_PER_TAB = 0.00001 + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = 0.00001 }) describe('GroupImpactLeaderboard component', () => { diff --git a/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboardRow.test.js b/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboardRow.test.js index c0364fdd..5b6f2d6b 100644 --- a/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboardRow.test.js +++ b/src/components/groupImpactComponents/__tests__/GroupImpactLeaderboardRow.test.js @@ -17,7 +17,7 @@ const getMockProps = () => ({ }) beforeEach(() => { - process.env.EST_MONEY_RAISED_PER_TAB = 0.00001 + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = 0.00001 }) describe('GroupImpactLeaderboardRow component', () => { diff --git a/src/utils/__tests__/misc.test.js b/src/utils/__tests__/misc.test.js index 185dd102..26cce1e8 100644 --- a/src/utils/__tests__/misc.test.js +++ b/src/utils/__tests__/misc.test.js @@ -1,7 +1,7 @@ jest.mock('../logger') beforeEach(() => { - process.env.EST_MONEY_RAISED_PER_TAB = '0.01287' + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = '0.01287' }) afterEach(() => { @@ -10,25 +10,25 @@ afterEach(() => { describe('globals', () => { it('returns the estimated money raised per tab [test #1]', () => { - process.env.EST_MONEY_RAISED_PER_TAB = '0.01287' + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = '0.01287' const { getEstimatedMoneyRaisedPerTab } = require('../misc') expect(getEstimatedMoneyRaisedPerTab()).toBe(0.01287) }) it('returns the estimated money raised per tab [test #2]', () => { - process.env.EST_MONEY_RAISED_PER_TAB = '2' + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = '2' const { getEstimatedMoneyRaisedPerTab } = require('../misc') expect(getEstimatedMoneyRaisedPerTab()).toBe(2.0) }) - it('returns 0 for the estimated money raised per tab if process.env.EST_MONEY_RAISED_PER_TAB is undefined', () => { - process.env.EST_MONEY_RAISED_PER_TAB = undefined + it('returns 0 for the estimated money raised per tab if process.env.NEXT_EST_MONEY_RAISED_PER_TAB is undefined', () => { + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = undefined const { getEstimatedMoneyRaisedPerTab } = require('../misc') expect(getEstimatedMoneyRaisedPerTab()).toBe(0.0) }) - it('returns 0 for the estimated money raised per tab if process.env.EST_MONEY_RAISED_PER_TAB does not parse into a float', () => { - process.env.EST_MONEY_RAISED_PER_TAB = 'xyz' + it('returns 0 for the estimated money raised per tab if process.env.NEXT_EST_MONEY_RAISED_PER_TAB does not parse into a float', () => { + process.env.NEXT_EST_MONEY_RAISED_PER_TAB = 'xyz' const { getEstimatedMoneyRaisedPerTab } = require('../misc') expect(getEstimatedMoneyRaisedPerTab()).toBe(0.0) }) diff --git a/src/utils/misc.js b/src/utils/misc.js index 33eb2e54..d5c48745 100644 --- a/src/utils/misc.js +++ b/src/utils/misc.js @@ -6,11 +6,11 @@ import logger from './logger' * @return {Number} */ export const getEstimatedMoneyRaisedPerTab = () => { - let moneyRaised = parseFloat(process.env.EST_MONEY_RAISED_PER_TAB) + let moneyRaised = parseFloat(process.env.NEXT_EST_MONEY_RAISED_PER_TAB) if (Number.isNaN(moneyRaised)) { moneyRaised = 0.0 logger.error( - `Could not parse float from money raised env var value ${process.env.EST_MONEY_RAISED_PER_TAB}` + `Could not parse float from money raised env var value ${process.env.NEXT_EST_MONEY_RAISED_PER_TAB}` ) } return moneyRaised