Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LevelThermometer uses hard coded max level value #41

Open
mrfmunger opened this issue Jul 9, 2018 · 0 comments · May be fixed by #42
Open

LevelThermometer uses hard coded max level value #41

mrfmunger opened this issue Jul 9, 2018 · 0 comments · May be fixed by #42

Comments

@mrfmunger
Copy link

The LevelThermometer component uses a hard coded value to determine the scale of the overall thermometer. If you change the pointsToLevels and maxLevel values in the constants file, the LevelThermometer will render incorrectly (since it's still referencing the hard coded value).

Locations where maxLevel is hard coded instead of referenced.
https://github.com/Medium/snowflake/blob/master/components/LevelThermometer.js#L32
https://github.com/Medium/snowflake/blob/master/components/PointSummaries.js#L25

Example

Updating the following values in constants.js results in a poorly formatted thermometer.

export const pointsToLevels = {
  "0": "1",
  "20": "2",
  "24": "3",
  "29": "4",
  "34": "5",
  "38": "6",
  "43": "7",
  "47": "8",
  "49": "9",
  "51": "10"
};

export const maxLevel = 52;

screen shot 2018-07-09 at 12 10 12 pm

@mrfmunger mrfmunger linked a pull request Jul 9, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant