-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add sponsorship information in post editor #531
Add sponsorship information in post editor #531
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.
I think overall looks great! The only thing I would add is only try to clean up and parse for solution type post
Can you elaborate? |
I mean the parsing and clean up should only apply to |
supervisor = sponsorMatch ? sponsorMatch[1] : null; | ||
} | ||
|
||
const seekingFunding = amount !== null || token !== null || supervisor !== null; |
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 can be problematic: if state.postType is not Solution, then amount, token and supervisor is all undefined
, and this will be true
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.
Made these variables null by default to avoid this case
@@ -52,7 +63,7 @@ initState({ | |||
labelStrings, | |||
postType, | |||
name: props.name ?? "", | |||
description: props.description ?? "", | |||
description: cleanDescription(props.description) ?? "", |
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.
Also here we want to only cleanDescription if it's a solution type
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.
Handled this case as well :)
ce1a1f8
to
77503f9
Compare
rebased to main |
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.
Looks great to me!
Resolved #469
The cause of this issue was due to the props not being saved with post. The props being passed to the editor didn't exist. So I wrote some regex to extract those props from the description and used them.
For future posts, I recommend saving these props when creating the post.
2023-11-29.06-15-44.mp4