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 for full viewport of 375px for potrait images #5610

Merged
merged 14 commits into from
Feb 21, 2020

Conversation

rhenshaw56
Copy link
Contributor

@rhenshaw56 rhenshaw56 commented Feb 19, 2020

Resolves #5525

Overall change:

  • Fix for protrait images not occupying the full width of the viewport below 375px

N/B: This is for just gel group1, portrait Images will still preserve their default grid span of 4 ie ( > 375px)

Code changes:
- Adds grid image span for gel group1 ( ~ 375px)


  • I have assigned myself to this PR and the corresponding issues
  • I have added labels to this PR for the relevant pod(s) affected by these changes
  • I have assigned this PR to the Simorgh project

Testing:

  • Automated (jest and/or cypress) tests added (for new features) or updated (for existing features)
  • If necessary, I have run the local E2E non-smoke tests relevant to my changes (CYPRESS_APP_ENV=local CYPRESS_SMOKE=false npm run test:e2e:interactive)
  • This PR requires manual testing

@rhenshaw56 rhenshaw56 added bug Something isn't working ws-articles Tasks for the WS Articles Team stories-pgl labels Feb 19, 2020
@rhenshaw56 rhenshaw56 self-assigned this Feb 19, 2020
@rhenshaw56 rhenshaw56 marked this pull request as ready for review February 19, 2020 15:00
@rhenshaw56 rhenshaw56 changed the title Fix for full viewport for 375px images Fix for full viewport of 375px for potrait images Feb 19, 2020
@rhenshaw56 rhenshaw56 requested review from sareh and 12 February 19, 2020 19:50
Copy link
Contributor

@12 12 left a comment

Choose a reason for hiding this comment

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

Looks good. Tested locally and appears to be working as expected.

@@ -35,6 +35,7 @@ const ArticleFigure = ({
}) => {
const imageSpan = {
default: '6',
group1: '6',
Copy link
Contributor

Choose a reason for hiding this comment

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

Groups will inherit the default value, so setting group1 to the same value is unnecessary. This change works, because portrait images have a different default value. We should probably apply this rule within the control block on line 47 instead. E.G.:

  if (height > width) {
    ParentWrapper = NestedGridParentSmall;
    ChildWrapper = NestedGridItemChildSmall;
    imageSpan.default = '4';
    imageSpan.group1 = '6';
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion. Thanks @simonsinclair

Copy link
Contributor

@simonsinclair simonsinclair left a comment

Choose a reason for hiding this comment

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

👍

@PriyaKR PriyaKR self-assigned this Feb 20, 2020
@PriyaKR
Copy link
Contributor

PriyaKR commented Feb 21, 2020

Looks good the potrait and all images seem to occupy the entire viewport at widths < 375px.
Screen Shot 2020-02-21 at 11 51 56

Tested across browsers and devices only on Samsung galaxy s10(android 10) the images still dont occupy full width tested on BS but on other devices of same viewport as S10 it looks good.

@PriyaKR
Copy link
Contributor

PriyaKR commented Feb 21, 2020

May be we should merge it and when on test should look on a real device.

@rhenshaw56 rhenshaw56 merged commit ffc4527 into latest Feb 21, 2020
@rhenshaw56 rhenshaw56 deleted the full-viewport-for-375px-images branch February 21, 2020 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ws-articles Tasks for the WS Articles Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPS PGL - All images should be full width in viewport below 375px
4 participants