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

Calculating Max Cigarattes to display dynamically #750

Merged
merged 3 commits into from
Oct 2, 2020
Merged

Calculating Max Cigarattes to display dynamically #750

merged 3 commits into from
Oct 2, 2020

Conversation

sarthakpranesh
Copy link
Contributor

Calculating the total number of cigarettes it will take to completely fill two rows dynamically according to the screen width and assigning it to showMaxCigarettes

closes #440

Signed-off-by: sarthakpranesh [email protected]

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2020

CLA assistant check
All committers have signed the CLA.

@amaury1093
Copy link
Member

Wow, thanks, I'll have a look tonight.

Copy link
Member

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I have just one small refactor nit

Comment on lines 71 to 81
const height = scale(
count <= THRESHOLD.FIRST
? SIZES.BIG
: count <= THRESHOLD.SECOND
? SIZES.MEDIUM
: count <= THRESHOLD.THIRD
? SIZES.BIG
: count <= THRESHOLD.FOURTH
? SIZES.MEDIUM
: SIZES.SMALL
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is used twice, could you factor it out in a separate function getCigarettesHeight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes applied 👍

Copy link
Member

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@amaury1093 amaury1093 merged commit 2d7fb34 into shootismoke:master Oct 2, 2020
@sarthakpranesh sarthakpranesh deleted the numOfCigs branch October 2, 2020 09:22
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 this pull request may close these issues.

When there are too many cigarettes, show 2 full lines
3 participants