-
Notifications
You must be signed in to change notification settings - Fork 479
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
Improvements to editing expandable images #39336
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.
couple of minor nits, but overall LGTM! I love the idea of making sure we add explicit UI support for all of our custom rich text features
let param = expandable ? 'expandable' : ''; | ||
let e = {target: {value: this.props.markdown + `\n\n![${param}](${url})`}}; |
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.
nit:
let param = expandable ? 'expandable' : ''; | |
let e = {target: {value: this.props.markdown + `\n\n![${param}](${url})`}}; | |
const param = expandable ? 'expandable' : ''; | |
const e = {target: {value: this.props.markdown + `\n\n![${param}](${url})`}}; |
type="checkbox" | ||
checked={this.state.expandable} | ||
style={styles.checkbox} | ||
onChange={() => this.setState({expandable: !this.state.expandable})} |
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 believe this should be something like
onChange={() => this.setState({expandable: !this.state.expandable})} | |
onChange={(e) => this.setState({expandable: e.target.checked})} |
|
||
ReactDOM.render( | ||
<Provider store={getStore()}> | ||
<ExpandableImageDialog /> |
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.
is there a specific reason this can't just go in edit-container
alongside LessonEditor
above?
<SafeMarkdown markdown={lesson.preparation} /> | ||
<EnhancedSafeMarkdown | ||
markdown={lesson.preparation} | ||
expandableImages={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.
I think you can just do
expandableImages={true} | |
expandableImages |
here and elsewhere
Adds a checkbox which allows an editor to say if an image is expandable so that editors don't have to memorize the syntax for expandable images in order to add an expandable image. It adds the syntax for them.
Makes expandable images work in the lesson editor so you can preview them there.
Testing story
Follow-up work
Do we want to make expandable images work for the ScriptOverview or CourseOverview?
PR Checklist: