-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Add badges on gifs #19111
Conversation
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.
Here are some suggested test cases for this PR.
WordPress iOS:
- Simultaneous uploads - steps
- Image block - Insert image from device (failing) - steps
- Image block - Insert image from device (cancel) - steps
- Image block - Add Caption - steps
- Image block - Close/Re-open post with an ongoing image upload - steps
- Image block - Close post with an ongoing image upload - steps
- Image block - Switch to classic editor with an image block in page - steps
WordPress Android:
- Simultaneous uploads - steps
- Image block - Insert image from device (failing) - steps
- Image block - Insert image from device (cancel) - steps
- Image block - Add Caption - steps
- Image block - Close/Re-open post with an ongoing image upload - steps
- Image block - Close post with an ongoing image upload - steps
- Image block - Switch to classic editor with an image block in page - steps
If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration.
If you are a beginner in mobile platforms follow build instructions.
@kmdupr33 A quick feedback on the format of your PR. I think you could have created a draft PR instead of having it as part of the title https://github.blog/2019-02-14-introducing-draft-pull-requests/
Could you update the title to be more specific? Gutenberg (native) already supports gifs, what we're adding here is the badge. Another nice to have is to use a prefix to indicate that it's a gutenberg mobile related PR:
We usually adds that at the end of the PR with the format: Github is going to prettify the url as much as possible and it's clearer to see the actual issue number before hovering it to get more info. |
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 had a few comments but the code looks good so far 👍
As discussed on slack I believe Badge
/Badgeable
could be moved to packages/components/mobile
so we can reuse them for other media content in the future
5848bbb
to
e5e9d86
Compare
Quick update for @iamthomasbishop : This is how the badge looks like now (on Android) |
e5e9d86
to
ca33b4f
Compare
The styling looks about right, other than the font-size diff that was already mentioned. Thanks for the update! |
1755b06
to
7e91e53
Compare
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 LGTM 👍
(You'll need to rebase and fix conflicts before we can merge this PR)
7e91e53
to
7a69ded
Compare
7a69ded
to
7b95b89
Compare
7b95b89
to
afa2f84
Compare
Any plans to rebase and merge this PR or should it be closed? It looks abandoned 🙁 |
Description
This pr adds badges to the GIF images.
This feature was implemented to support some reusability of badges (since the issue mentions that badges are something we're interested in reusing). The
Badge
andBadgeable
components inbadgeable.native.js
are how we achieve this (limited) reusability.Badge
, as the name suggests, is a simple presentational component that merely handles the styling of the badge and takes in atext
prop to support arbitrary text inside the badge.Badgeable
can wrap a component we want to display a badge overtop it's content. ABadgeable
component allows us to easily add badges to existing components without duplicating code for overlaying and positioning theBadge
component. Moreover, with this approach, changing the positioning of badges can be done in one place instead of every place where a badge is visible.HOCs and render props were briefly considered as a way of accomplishing this same sort of DRY implementation, but ultimately I decided that these two solutions were overkill. Although either of these solutions could have worked,
Badgeable
doesn't need add or share state or functionality with the component it's wrapping, so a simpler wrapper component is a better solution.How has this been tested?
The main sample post has a GIF image, so I simply opened the app and checked to see if the GIF badge was visible over the GIF image and not visible over other images that weren't GIFs.
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
Fixes wordpress-mobile/gutenberg-mobile#968