fix react embedly (#1089)
This commit is contained in:
parent
de4f51bb5c
commit
780e66632b
2 changed files with 8 additions and 3 deletions
frontend/src/components/TopicCard
|
@ -9,7 +9,11 @@ class Attachments extends Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="attachments">
|
<div className="attachments">
|
||||||
<EmbedlyLink link={link} authorizedToEdit={authorizedToEdit} updateTopic={updateTopic} />
|
<EmbedlyLink topicId={topic.id}
|
||||||
|
link={link}
|
||||||
|
authorizedToEdit={authorizedToEdit}
|
||||||
|
updateTopic={updateTopic}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class EmbedlyLink extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render = () => {
|
render = () => {
|
||||||
const { link, authorizedToEdit } = this.props
|
const { link, authorizedToEdit, topicId } = this.props
|
||||||
const { linkEdit } = this.state
|
const { linkEdit } = this.state
|
||||||
const hasAttachment = !!link
|
const hasAttachment = !!link
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class EmbedlyLink extends Component {
|
||||||
{linkEdit && <div id="addLinkReset" onClick={this.resetLink}></div>}
|
{linkEdit && <div id="addLinkReset" onClick={this.resetLink}></div>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{link && <Card link={link} />}
|
{link && <Card key={topicId} link={link} />}
|
||||||
{authorizedToEdit && (
|
{authorizedToEdit && (
|
||||||
<div id="linkremove"
|
<div id="linkremove"
|
||||||
style={{ display: hasAttachment ? 'block' : 'none' }}
|
style={{ display: hasAttachment ? 'block' : 'none' }}
|
||||||
|
@ -68,6 +68,7 @@ class EmbedlyLink extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
EmbedlyLink.propTypes = {
|
EmbedlyLink.propTypes = {
|
||||||
|
topicId: PropTypes.number,
|
||||||
link: PropTypes.string,
|
link: PropTypes.string,
|
||||||
authorizedToEdit: PropTypes.bool,
|
authorizedToEdit: PropTypes.bool,
|
||||||
updateTopic: PropTypes.func
|
updateTopic: PropTypes.func
|
||||||
|
|
Loading…
Reference in a new issue