diff --git a/app/components/ResourceCard.jsx b/app/components/ResourceCard.jsx index ca4e573..8dd5788 100644 --- a/app/components/ResourceCard.jsx +++ b/app/components/ResourceCard.jsx @@ -127,6 +127,7 @@ export default class extends Component { title={this.state.title} actAsExpander={true} showExpandableButton={true} + className="resource-card-header" /> { - let key = resourcesRef.push().key + const key = resourcesRef.push().key if (this.props.milestoneRef) { // Add resource URL to parent goal's uploads: this.props.goalRef.child('resources').child(key).set({ - resourceURL: response.url, + resourceURL: target, milestoneId: this.props.milestoneId }) // Add resource URL to milestone: this.props.milestoneRef.child(key).set({ - resourceURL: response.url + resourceURL: target }) } else { // Otherwise, just add resource directly to goal this.props.goalRef.child(key).set({ - resourceURL: response.url + resourceURL: target + }) + } + + if (!response.error) { + resourcesRef.child(key).set(response) + } else { + resourcesRef.child(key).set({ + ...response, + url: response.url || target, + title: response.title || target, + description: '', }) } - resourcesRef.child(key).set(response) } }) this.setState({url: ''}) diff --git a/public/style.css b/public/style.css index 7769dd2..37e0c86 100644 --- a/public/style.css +++ b/public/style.css @@ -41,6 +41,13 @@ h1, h2, h3, h4 { left: 50% !important; } +/* Make resource titles with long words break the +words rather than spill out */ +.resource-card-header > * { + max-width: 100%; + overflow-wrap: break-word; +} + .flexy-columns { display: flex; flex-wrap: wrap;