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

Remove unnecessary state update for reply gate #4897

Merged
merged 3 commits into from
Aug 8, 2024
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Aug 8, 2024

We currently set state on mount in post thread. This is only necessary because the mobile reply prompt is located above the post in the hierarchy so we don't have access to the post itself from the parent component.

This moves the mobile inline prompt into the main post thread component. This lets us remove this state and calculate it during render. This will also enable another simplification that I'll stack on top of this PR.

Test Plan

Mobile "Write your reply" still shows up on all platforms in the right place.

Screenshot 2024-08-08 at 16 42 27
Screenshot 2024-08-08 at 16 42 42
Screenshot 2024-08-08 at 16 52 48

Reply gating still works.

Screenshot 2024-08-08 at 16 53 10

Copy link

render bot commented Aug 8, 2024

src/view/com/post-thread/PostThread.tsx Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Aug 8, 2024

Old size New size Diff
7.16 MB 7.09 MB -70.05 KB (-0.95%)

Copy link
Member

@mozzius mozzius 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!

@gaearon gaearon merged commit 4b71950 into main Aug 8, 2024
6 checks passed
@gaearon gaearon deleted the postthread-rf-1 branch August 8, 2024 16:05
estrattonbailey added a commit that referenced this pull request Aug 8, 2024
* origin/main: (30 commits)
  Show just-posted replies above OP replies (#4901)
  Remove client filtering of starter packs (#4753)
  Remove show_avi_follow_button (#4900)
  Remove native_pwi_disabled (#4896)
  Fix overflow on posts (#4899)
  Move onPressReply into child component (#4898)
  Remove new_user_progress_guide (#4895)
  Remove explore_page_profile_card_social_proof (#4894)
  Remove ungroup_follow_backs gate (#4893)
  Remove unnecessary state update for reply gate (#4897)
  Include follow-based suggestions in interstitial (#4889)
  Cleanup flags (#4891)
  ALF suggested follows in profile header (#4828)
  Added trans (#4890)
  Keep interstitial fresh on refresh (#4888)
  Include popcluster in suggestion ranking (#4887)
  Add logging of selected feed preference when displaying the following feed (#4789)
  [Video] Visibility detection view (#4741)
  [Videos] Video player - PR #2 - better web support (#4732)
  [Video] Authed video upload (#4885)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants