Refactor: refactor of thumbnail badges and compact post cards #1066
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.
Pull Request Description
This PR refactors some of the existing logic with post cards. The reasoning for this is to reduce dependencies across widgets, and to clean up some duplicated code. This will be one of many refactors for post cards to help reduce code complexity.
Main changes performed:
PostCardViewCompact
. A lot of the current parameters that are passed in can be derived fromThunderBloc
. As such, it's unnecessary to pass that data down the widget tree.TypeBadge
to reduce duplicated code.TypeBadge
no longer has a dependency on PostViewMedia, which will help in certain situations. Rather, it will have a more generic parameterMediaType
which will determine the look of the badge.ThumbnailPreview
. This helps with reducing duplicated code, and allows us to useThumbnailPreview
elsewhere in the app if needed.Sidenote: Moderator post reports
/post/report/list
only returns back aPost
rather than aPostView
. Because of this, a lot of our existing widgets are not compatible with the response of moderator reports since they take inPostViewMedia
. This is one of the initial triggers for refactoring the post cards.e.g., an example response of
/post/report/list
Issue Being Fixed
Issue Number: N/A
Screenshots / Recordings
Checklist
semanticLabel
s where applicable for accessibility?