add pending marker

This commit is contained in:
Travis Eden 2018-11-14 19:51:25 -08:00 committed by Shawn
parent b49cb4484c
commit cdbd5eee80
4 changed files with 34 additions and 1 deletions

View file

@ -1,3 +1,7 @@
.asset-preview {
position: relative;
}
.asset-preview__image { .asset-preview__image {
width : 100%; width : 100%;
padding: 0; padding: 0;

View file

@ -0,0 +1,12 @@
.claim-pending {
display: inline-block;
position: absolute;
top: 10px;
left: 10px;
padding: 5px;
border-radius: 5px;
border: 2px solid red;
color: red;
font-weight: bold;
background-color: white;
}

View file

@ -18,6 +18,7 @@
@import '~scss/_button'; @import '~scss/_button';
@import '~scss/_button-primary'; @import '~scss/_button-primary';
@import '~scss/_button-secondary'; @import '~scss/_button-secondary';
@import '~scss/_claim-pending';
@import '~scss/_click-to-copy'; @import '~scss/_click-to-copy';
@import '~scss/_form-feedback'; @import '~scss/_form-feedback';
@import '~scss/_horizontal-split'; @import '~scss/_horizontal-split';

View file

@ -2,8 +2,14 @@ import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import createCanonicalLink from '../../../../utils/createCanonicalLink'; import createCanonicalLink from '../../../../utils/createCanonicalLink';
const ClaimPending = () => {
return (
<div className='claim-pending'>PENDING</div>
);
};
const AssetPreview = ({ defaultThumbnail, claimData }) => { const AssetPreview = ({ defaultThumbnail, claimData }) => {
const {name, fileExt, contentType, thumbnail, title} = claimData; const {name, fileExt, contentType, thumbnail, title, pending} = claimData;
const showUrl = createCanonicalLink({asset: {...claimData}}); const showUrl = createCanonicalLink({asset: {...claimData}});
const embedUrl = `${showUrl}.${fileExt}`; const embedUrl = `${showUrl}.${fileExt}`;
switch (contentType) { switch (contentType) {
@ -27,6 +33,7 @@ const AssetPreview = ({ defaultThumbnail, claimData }) => {
return ( return (
<Link to={showUrl} className='asset-preview'> <Link to={showUrl} className='asset-preview'>
<div> <div>
<<<<<<< HEAD
<div className='asset-preview__play-wrapper'> <div className='asset-preview__play-wrapper'>
<img <img
className={'asset-preview__video'} className={'asset-preview__video'}
@ -36,6 +43,15 @@ const AssetPreview = ({ defaultThumbnail, claimData }) => {
<div className='asset-preview__play-overlay'></div> <div className='asset-preview__play-overlay'></div>
</div> </div>
<h3 className='asset-preview__title'>{title}</h3> <h3 className='asset-preview__title'>{title}</h3>
=======
{pending && <ClaimPending/>}
<img
className={'asset-preview-video'}
src={thumbnail || defaultThumbnail}
alt={name}
/>
<h3 className='list-title'>{title}</h3>
>>>>>>> add pending marker
</div> </div>
</Link> </Link>
); );