removed css from inside AssetPreview
This commit is contained in:
parent
b3f5d83f73
commit
1e9e9e4344
6 changed files with 32 additions and 24 deletions
|
@ -276,7 +276,7 @@ a, a:visited {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.align-content-right {
|
.align-content-bottom {
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ table {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#asset-preview {
|
#dropzone-preview {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -506,6 +506,20 @@ table {
|
||||||
|
|
||||||
/* Assets */
|
/* Assets */
|
||||||
|
|
||||||
|
.asset-holder {
|
||||||
|
clear : both;
|
||||||
|
display: inline-block;
|
||||||
|
width : 31%;
|
||||||
|
padding: 0px;
|
||||||
|
margin : 1%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.asset-preview {
|
||||||
|
width : 100%;
|
||||||
|
padding: 0px;
|
||||||
|
margin : 0px
|
||||||
|
}
|
||||||
|
|
||||||
.asset {
|
.asset {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ class AssetInfo extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div className="row row--wide">
|
<div className="row row--wide">
|
||||||
<a className="text link--primary" id="show-details-toggle" href="#" onClick={this.toggleDetails}>{this.state.showDetails ? '[less]' : '[more]'}</a>
|
<button className="button--primary" onClick={this.toggleDetails}>{this.state.showDetails ? '[less]' : '[more]'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,20 +4,8 @@ import { Link } from 'react-router-dom';
|
||||||
const AssetPreview = ({ name, claimId, fileExt, contentType }) => {
|
const AssetPreview = ({ name, claimId, fileExt, contentType }) => {
|
||||||
const directSourceLink = `${claimId}/${name}.${fileExt}`;
|
const directSourceLink = `${claimId}/${name}.${fileExt}`;
|
||||||
const showUrlLink = `${claimId}/${name}`;
|
const showUrlLink = `${claimId}/${name}`;
|
||||||
const previewHolderStyle = {
|
|
||||||
clear : 'both',
|
|
||||||
display: 'inline-block',
|
|
||||||
width : '31%',
|
|
||||||
padding: '0px',
|
|
||||||
margin : '1%',
|
|
||||||
};
|
|
||||||
const assetStyle = {
|
|
||||||
width : '100%',
|
|
||||||
padding: '0px',
|
|
||||||
margin : '0px',
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<div style={previewHolderStyle}>
|
<div className="asset-holder">
|
||||||
<Link to={showUrlLink} >
|
<Link to={showUrlLink} >
|
||||||
{(() => {
|
{(() => {
|
||||||
switch (contentType) {
|
switch (contentType) {
|
||||||
|
@ -25,15 +13,15 @@ const AssetPreview = ({ name, claimId, fileExt, contentType }) => {
|
||||||
case 'image/jpg':
|
case 'image/jpg':
|
||||||
case 'image/png':
|
case 'image/png':
|
||||||
return (
|
return (
|
||||||
<img style={assetStyle} className={'asset-preview--image'} src={directSourceLink} alt={name}/>
|
<img className={'asset-preview'} src={directSourceLink} alt={name}/>
|
||||||
);
|
);
|
||||||
case 'image/gif':
|
case 'image/gif':
|
||||||
return (
|
return (
|
||||||
<img style={assetStyle} className={'asset-preview--gif'} src={directSourceLink} alt={name}/>
|
<img className={'asset-preview'} src={directSourceLink} alt={name}/>
|
||||||
);
|
);
|
||||||
case 'video/mp4':
|
case 'video/mp4':
|
||||||
return (
|
return (
|
||||||
<video style={assetStyle}>
|
<video className={'asset-preview'}>
|
||||||
<source src={directSourceLink} type={contentType}/>
|
<source src={directSourceLink} type={contentType}/>
|
||||||
</video>
|
</video>
|
||||||
);
|
);
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Preview extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
id="asset-preview"
|
id="dropzone-preview"
|
||||||
src={this.state.imgSource}
|
src={this.state.imgSource}
|
||||||
className={this.props.dimPreview ? 'dim' : ''}
|
className={this.props.dimPreview ? 'dim' : ''}
|
||||||
alt="publish preview"
|
alt="publish preview"
|
||||||
|
|
|
@ -8,6 +8,8 @@ class ChannelClaimsDisplay extends React.Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
error: null,
|
error: null,
|
||||||
};
|
};
|
||||||
|
this.showNextResultsPage = this.showNextResultsPage.bind(this);
|
||||||
|
this.showPreviousResultsPage = this.showPreviousResultsPage.bind(this);
|
||||||
}
|
}
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
const name = this.props.name;
|
const name = this.props.name;
|
||||||
|
@ -66,8 +68,12 @@ class ChannelClaimsDisplay extends React.Component {
|
||||||
key={`${claim.name}-${index}`}
|
key={`${claim.name}-${index}`}
|
||||||
/>)}
|
/>)}
|
||||||
<div>
|
<div>
|
||||||
{(this.props.currentPage > 1) && <button onClick={this.showPreviousResultsPage}>Previous Page</button>}
|
{(this.props.currentPage > 1) &&
|
||||||
{(this.props.currentPage < this.props.totalPages) && <button onClick={this.showNextResultsPage}>Next Page</button>}
|
<button className={'button--primary'} onClick={this.showPreviousResultsPage}>Previous Page</button>
|
||||||
|
}
|
||||||
|
{(this.props.currentPage < this.props.totalPages) &&
|
||||||
|
<button className={'button--primary'} onClick={this.showNextResultsPage}>Next Page</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ class ShowChannel extends React.Component {
|
||||||
<div className="row row--tall row--padded">
|
<div className="row row--tall row--padded">
|
||||||
<div className="column column--10">
|
<div className="column column--10">
|
||||||
<h2>channel name: {this.props.name ? this.props.name : 'loading...'}</h2>
|
<h2>channel name: {this.props.name ? this.props.name : 'loading...'}</h2>
|
||||||
<p>full channel id: {this.props.longId ? this.props.longId : 'loading...'}</p>
|
<p className={'fine-print'}>full channel id: {this.props.longId ? this.props.longId : 'loading...'}</p>
|
||||||
<p>short channel id: {this.props.shortId ? this.props.shortId : 'loading...'}</p>
|
<p className={'fine-print'}>short channel id: {this.props.shortId ? this.props.shortId : 'loading...'}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="column column--10">
|
<div className="column column--10">
|
||||||
{(this.props.name && this.props.longId) && <ChannelClaimsDisplay />}
|
{(this.props.name && this.props.longId) && <ChannelClaimsDisplay />}
|
||||||
|
|
Loading…
Reference in a new issue