1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

related items without cover now has letters

This commit is contained in:
Fedor Katurov 2020-04-08 15:36:27 +07:00
parent 0f3ac203f7
commit eade3efc7c
4 changed files with 34 additions and 5 deletions

View file

@ -5,6 +5,7 @@ import { getURL, getPrettyDate } from '~/utils/dom';
import { Link } from 'react-router-dom';
import { URLS, PRESETS } from '~/constants/urls';
import classNames from 'classnames';
import { NodeRelatedItem } from '~/components/node/NodeRelatedItem';
interface IProps {
recent: IFlowState['recent'];
@ -31,10 +32,10 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
{recent &&
recent.slice(0, 20).map(node => (
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
<div
className={styles.thumb}
style={{ backgroundImage: `url("${getURL({ url: node.thumbnail }, PRESETS.avatar)}")` }}
/>
<div className={styles.thumb}>
<NodeRelatedItem item={node} />
</div>
<div className={styles.info}>
<div className={styles.title}>{node.title}</div>
<div className={styles.comment}>{getPrettyDate(node.created_at)}</div>