β¨ feat: add new medium posts parser #134
Merged
+130
β34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, again! π
I hope the following contribution is all okay, and if it is not, please don't hesitate to let me know what I need to change! π
This fixes #133.
What type of PR is this? (check all applicable)
What I did
The current Medium posts activity does not work. The URL provided for the images comes back with two different errors depending on if the username is valid or not, which I commented about in #133.
I have replaced it with a different way to show the Medium posts, and updated the appropriate unit tests.
In addition to this, I have done some slight refactoring of the activities parser so that for future activities it should be easier to add new parsers for different types of posts from different sources without modifying the existing parser logic.
I wasn't sure how you would like the images to be styled, so I just assumed they would take up 100% of the width.
As the code for the activities ends up generating HTML, I added the package
html-react-parser
so that HTML can be safely injected into the activity container.If any changes need to be made, please let me know! π
Screenshots
Initial add:

After setting username:
