-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix/532-home-page-on-2560-and-1920-resolutions #625
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,19 @@ export const Hero = () => { | |
flexDirection="row" | ||
overflow="visible" | ||
position="relative" | ||
px={screenWidth < 640 ? 3 : screenWidth < 1512 ? 10 : 14} | ||
px={ | ||
screenWidth < 640 | ||
? 3 | ||
: screenWidth < 1512 | ||
? 9.375 | ||
: screenWidth < 1728 | ||
? 14 | ||
: screenWidth < 1920 | ||
? 27.375 | ||
: screenWidth < 2560 | ||
? 39.375 | ||
: 49.25 | ||
} | ||
> | ||
<Box alignItems="center" flex={1} height="min-content"> | ||
<Typography | ||
|
@@ -82,13 +94,13 @@ export const Hero = () => { | |
flex={1} | ||
position="absolute" | ||
right={ | ||
screenWidth >= 1728 | ||
? IMAGE_SIZE / 8 | ||
: screenWidth >= 1512 | ||
? -(IMAGE_SIZE / 12) | ||
: screenWidth >= 860 | ||
? -(IMAGE_SIZE / 8) | ||
: -(IMAGE_SIZE / 4) | ||
screenWidth <= 860 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why on the above nested ternaries we are checking 640, 1512, 1728, 1920, 2560 and here we are checking 860, 1440, 1728? Why it can't be unified? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its not necessary to check every resolution |
||
? -(IMAGE_SIZE / 4) | ||
: screenWidth <= 1440 | ||
? -(IMAGE_SIZE / 15) | ||
: screenWidth <= 1728 | ||
? screenWidth / 20 | ||
: screenWidth / 11 | ||
} | ||
top={-80} | ||
zIndex={-1} | ||
|
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.
I understand but when we see the blocks like this there is a place for questions. We won't handle the breakpoints now as we are going to migrate to the components library, but for the stake of a clarity - please lift up this nested ternaries above to not chain so much in the render.
At this moment it might be just the inner function that returns the px value eg.:
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.
oki doki, i will