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

fixed flow appearance

This commit is contained in:
Fedor Katurov 2019-10-25 10:37:29 +07:00
parent db992a375b
commit 774e254afc
3 changed files with 13 additions and 4 deletions

View file

@ -1,15 +1,17 @@
import React, { FC, HTMLAttributes } from 'react';
import { range } from 'ramda';
import React, { FC } from 'react';
import * as styles from './styles.scss';
import { Group } from '~/components/containers/Group';
import { INode } from '~/redux/types';
import { getURL } from '~/utils/dom';
import { withRouter, RouteComponentProps } from 'react-router';
import { URLS } from '~/constants/urls';
type IProps = HTMLAttributes<HTMLDivElement> & {
type IProps = RouteComponentProps & {
title: string;
items: Partial<INode>[];
};
const NodeRelated: FC<IProps> = ({ title, items }) => (
const NodeRelatedUnconnected: FC<IProps> = ({ title, items, history }) => (
<Group className={styles.wrap}>
<div className={styles.title}>
<div className={styles.line} />
@ -22,10 +24,13 @@ const NodeRelated: FC<IProps> = ({ title, items }) => (
className={styles.item}
key={item.id}
style={{ backgroundImage: `url("${getURL({ url: item.thumbnail })}")` }}
onClick={() => history.push(URLS.NODE_URL(item.id))}
/>
))}
</div>
</Group>
);
const NodeRelated = withRouter(NodeRelatedUnconnected);
export { NodeRelated };

View file

@ -23,6 +23,7 @@
background-size: cover;
padding-bottom: 100%;
border-radius: $cell_radius;
cursor: pointer;
}
.title {