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

Reuse PostEditor instead of Create component #615

Merged
merged 26 commits into from
Jan 4, 2024

Conversation

Megha-Dev-19
Copy link
Collaborator

@Megha-Dev-19 Megha-Dev-19 commented Dec 29, 2023

Resolves #538
Resolves #555
Resolves #591
Resolves #590
Resolves #547
Preview link

@Megha-Dev-19 Megha-Dev-19 marked this pull request as ready for review December 30, 2023 16:23
@Megha-Dev-19
Copy link
Collaborator Author

Redirection on Approval/Rejection of txn works only on @petersalomonsen preview, since it invalidates the cache which cause rerendering

@Megha-Dev-19
Copy link
Collaborator Author

Megha-Dev-19 commented Dec 30, 2023

Since we can't redirect user without their explicit action in BOS, so I did this instead.
@ori-near please let me know if this is suitable UX

Video.mov

@ori-near
Copy link
Collaborator

ori-near commented Jan 3, 2024

Hi @Megha-Dev-19 – It this UX going to apply to all users? Or just ones who use MNW? Can you also share the current state that you're trying to fix with this solution?

@Megha-Dev-19
Copy link
Collaborator Author

Hey @ori-near, this UX will be applied to all users (once Peter's PR is merged), but until then only to those who use his MNV.
So there are two things: one is when we edit/reply on a post, and when we create a new post. And for each there is two possibilities, user can use a wallet, which redirects them to new approval screen (a new link), or opens a popup modal.

Currently this is how it is handled:

  1. Post creation (when user is redirected for approval)
Screen.Recording.2024-01-03.at.14.08.15.mov
  1. Post creation (when popup window is opened for approval)
Video.1.mov
  1. Edit/reply post (when popup window is opened for approval)
Video.2.mov

but with current changes, edit/reply post will be like this (irrespective of if user has allowed the function calls) :

Screen.Recording.2024-01-03.at.14.20.05.mov

@ori-near
Copy link
Collaborator

ori-near commented Jan 3, 2024

Hi @Megha-Dev-19 – thank you so much for clarifying. As we discussed, I think this solution looks good. However, if there is a way to redirect the user to the actual post that would be even better.

CC: @petersalomonsen

@petersalomonsen
Copy link
Collaborator

In order to redirect the user to the latest created post, we need the result of the create transaction, which should return the post_id. To get results from a transaction, we depend on this: NearSocial/VM#105

@Megha-Dev-19
Copy link
Collaborator Author

hey @Tguntenaar @elliotBraem, can you please review the PR.?

@Megha-Dev-19
Copy link
Collaborator Author

hey @ori-near, as we discussed yesterday, I can't scroll to the top or the edited post, since we don't have access to window in VM, so it will remain as is for now.

@elliotBraem elliotBraem merged commit 84a8ad4 into NEAR-DevHub:main Jan 4, 2024
2 checks passed
@Megha-Dev-19 Megha-Dev-19 deleted the post-editor-update branch January 5, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants