-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Conversation
Signed-off-by: sarthakpranesh <sarthak.pranesh2018@vitstudent.ac.in>
Wow, thanks, I'll have a look tonight. |
There was a problem hiding this 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
App/Screens/Home/Home.tsx
Outdated
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 | ||
); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes applied 👍
Signed-off-by: sarthakpranesh <sarthak.pranesh2018@vitstudent.ac.in>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
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 sarthak.pranesh2018@vitstudent.ac.in