-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add delete cover feature to edit community form #4535
add delete cover feature to edit community form #4535
Conversation
Generated by 🚫 dangerJS |
@brianlovin any comments on this? |
@ThomasRoest sorry for the slow review - just pulled everything and this works great! Just one question below about the code and then we can ship this. |
@@ -301,6 +311,13 @@ class EditForm extends React.Component<Props, State> { | |||
<SectionTitle>Community Settings</SectionTitle> | |||
<Form onSubmit={this.save}> | |||
<ImageInputWrapper> | |||
{coverPhoto && !/default_images/.test(coverPhoto) && ( |
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've never seen this !/default_images/.test(coverPhoto)
syntax before - could you point me to where I can learn what's going on here?
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.
It's a regex method to check if there's a default image or custom (user uploaded image) and to show or hide the delete (X) button.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test
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.
Thank you!
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 looks amazing, thank you so much @ThomasRoest!!! 💯 💯 💯
Status
Deploy after merge (delete what needn't be deployed)
Closes #4385
This is what I've got so far.