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

fix/532-home-page-on-2560-and-1920-resolutions #625

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

Sworzen1
Copy link
Contributor

@Sworzen1 Sworzen1 commented Apr 4, 2024

List of changes

  • fix margins

Checklist

  • related issue
  • My changes generate no new warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the changelog
  • I have added tests that prove my fix is effective or that my feature works

@Sworzen1 Sworzen1 linked an issue Apr 4, 2024 that may be closed by this pull request
@Sworzen1 Sworzen1 marked this pull request as ready for review April 4, 2024 13:29
@@ -32,7 +32,19 @@ export const Hero = () => {
flexDirection="row"
overflow="visible"
position="relative"
px={screenWidth < 640 ? 3 : screenWidth < 1512 ? 10 : 14}
px={
Copy link
Contributor

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.:

const getSize = useCallback(() => {
if (screenWidth < 640) return 3
...
return 49.25}, [screenWidth])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oki doki, i will

: screenWidth >= 860
? -(IMAGE_SIZE / 8)
: -(IMAGE_SIZE / 4)
screenWidth <= 860
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its not necessary to check every resolution

@Sworzen1 Sworzen1 merged commit aff3fa2 into develop Apr 5, 2024
4 checks passed
@Sworzen1 Sworzen1 deleted the fix/532-home-page-on-2560-and-1920-resolutions branch April 5, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 Frontend Frontend related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Home page on 2560 and 1920 resolutions fixes
2 participants