fix: carousel sidebar

This commit is contained in:
Akuoko Daniel Jnr 2021-04-02 15:17:51 +00:00
parent b860987762
commit 597bd2e603
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC

View File

@ -469,7 +469,7 @@ class CarouselSidebarData extends React.Component {
</div> </div>
); );
} }
console.log(Validations.isPreviewableImage(type));
elements.push( elements.push(
<div key="s-2" style={{ marginBottom: 80 }}> <div key="s-2" style={{ marginBottom: 80 }}>
<div css={STYLES_META}> <div css={STYLES_META}>
@ -563,25 +563,35 @@ class CarouselSidebarData extends React.Component {
)} )}
{type && Validations.isPreviewableImage(type) ? null : ( {type && Validations.isPreviewableImage(type) ? null : (
<div> <div>
{coverImage && (
<React.Fragment>
<System.P css={STYLES_SECTION_HEADER} style={{ margin: "48px 0px 8px 0px" }}> <System.P css={STYLES_SECTION_HEADER} style={{ margin: "48px 0px 8px 0px" }}>
Preview image Preview image
</System.P> </System.P>
{coverImage ? (
<React.Fragment> <React.Fragment>
<System.P css={STYLES_TEXT}>This is the preview image of your file.</System.P> <System.P css={STYLES_TEXT}>This is the preview image of your file.</System.P>
<div css={STYLES_IMAGE_BOX} style={{ marginTop: 24 }}> <div css={STYLES_IMAGE_BOX} style={{ marginTop: 24 }}>
<img <img
src={coverImage.url} src={coverImage?.url}
alt="" alt=""
style={{ maxWidth: "368px", maxHeight: "368px" }} style={{ maxWidth: "368px", maxHeight: "368px" }}
/> />
</div> </div>
</React.Fragment> </React.Fragment>
) : ( </React.Fragment>
<System.P css={STYLES_TEXT}>Add a cover image for your file.</System.P>
)} )}
{this.props.isOwner && (
<React.Fragment>
<System.P css={STYLES_TEXT}>Add a cover image for your file.</System.P>
<div style={{ marginTop: 16 }}> <div style={{ marginTop: 16 }}>
<input css={STYLES_FILE_HIDDEN} type="file" id="file" onChange={this._handleUpload} /> <input
css={STYLES_FILE_HIDDEN}
type="file"
id="file"
onChange={this._handleUpload}
/>
<System.ButtonPrimary <System.ButtonPrimary
full full
type="label" type="label"
@ -591,6 +601,8 @@ class CarouselSidebarData extends React.Component {
Upload image Upload image
</System.ButtonPrimary> </System.ButtonPrimary>
</div> </div>
</React.Fragment>
)}
</div> </div>
)} )}
{this.props.isOwner ? ( {this.props.isOwner ? (