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

Use real container width in MediaGallery srcSet #7571

Merged
merged 1 commit into from
May 21, 2018
Merged

Use real container width in MediaGallery srcSet #7571

merged 1 commit into from
May 21, 2018

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented May 21, 2018

Fix #7568

@Gargron Gargron added the bug Something isn't working label May 21, 2018
@Gargron Gargron merged commit 22e067b into master May 21, 2018
@Gargron Gargron deleted the fix-srcset branch May 21, 2018 14:04
@@ -263,9 +264,9 @@ export default class MediaGallery extends React.PureComponent {
const size = media.take(4).size;

if (this.isStandaloneEligible()) {
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} />;
children = <Item standalone onClick={this.handleClick} attachment={media.get(0)} displayWidth={width} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears to work, but I'm not sure how, as width is undefined when it's rendered for the first time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, not sure what we can do there. Hardcode a fallback width? That's back to status quo with ~330px

Copy link
Contributor

Choose a reason for hiding this comment

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

It's kind of redundant with the CSS, but we can always know which size it is going to be, from the context. That would be best. But apparently it works as is, so… 🤷‍♂️

luckyyang added a commit to open-archive/moooon-network that referenced this pull request May 24, 2018
* commit 'd8864b9e9d4fd56606a3b809bedeb1216b6620ae': (84 commits)
  Fix caret position after selected suggestion and media upload (mastodon#7595)
  Fix tests for invites controller (regression from 4d81809) (mastodon#7597)
  Yeah, it was supposed to be #create?
  Bump version to 2.4.0
  Remove pointer to light theme until it is more polished (mastodon#7594)
  Remove unneeded code now that attachment URL isn't appended to toots (mastodon#7593)
  Do not encode HTML entities in initial Web Push payload body (mastodon#7592)
  [WIP] i18n: Update Simplified Chinese translations (mastodon#7576)
  Add tests for report notes controller (mastodon#7589)
  Enforce order on authorized applications page (mastodon#7587)
  Hide section headline for timelines in production (mastodon#7590)
  Change column params on pinned timeline (mastodon#7581)
  Remove outline (mastodon#7582)
  [RU] Added mastodon-light string (mastodon#7583)
  🌍: 🇵🇱⬆️ (mastodon#7580)
  Save onlyMedia prop when pinning column (mastodon#7575)
  Display only domain of report account if remote under comment (mastodon#7574)
  Add exact attribute to WrappedRoute for community timeline (mastodon#7572)
  Bump version to 2.4.0rc5
  Use real container width in MediaGallery srcSet (mastodon#7571)
  ...

# Conflicts:
#	config/locales/en.yml
#	config/locales/simple_form.zh-CN.yml
#	config/locales/zh-CN.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants