From 774e254afce5d8b0a42cd30a9f735c7f03cfef7a Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 25 Oct 2019 10:37:29 +0700 Subject: [PATCH] fixed flow appearance --- src/components/flow/Cell/styles.scss | 3 +++ src/components/node/NodeRelated/index.tsx | 13 +++++++++---- src/components/node/NodeRelated/styles.scss | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/flow/Cell/styles.scss b/src/components/flow/Cell/styles.scss index 0777feae..feec9ca8 100644 --- a/src/components/flow/Cell/styles.scss +++ b/src/components/flow/Cell/styles.scss @@ -166,6 +166,7 @@ max-width: 100%; // height: auto; width: auto; + padding: ($grid_line / 2) $grid_line $grid_line $grid_line; } .horizontal > &.has_text { @@ -176,9 +177,11 @@ // height: auto; width: auto; bottom: 0; + padding: $grid_line ($grid_line / 2) $grid_line $grid_line; } .quadro > &.has_text { + padding: ($grid_line / 2) ($grid_line / 2) $grid_line $grid_line; top: auto; height: 50%; max-width: 50%; diff --git a/src/components/node/NodeRelated/index.tsx b/src/components/node/NodeRelated/index.tsx index 118ee233..a24beee5 100644 --- a/src/components/node/NodeRelated/index.tsx +++ b/src/components/node/NodeRelated/index.tsx @@ -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 & { +type IProps = RouteComponentProps & { + title: string; items: Partial[]; }; -const NodeRelated: FC = ({ title, items }) => ( +const NodeRelatedUnconnected: FC = ({ title, items, history }) => (
@@ -22,10 +24,13 @@ const NodeRelated: FC = ({ title, items }) => ( className={styles.item} key={item.id} style={{ backgroundImage: `url("${getURL({ url: item.thumbnail })}")` }} + onClick={() => history.push(URLS.NODE_URL(item.id))} /> ))}
); +const NodeRelated = withRouter(NodeRelatedUnconnected); + export { NodeRelated }; diff --git a/src/components/node/NodeRelated/styles.scss b/src/components/node/NodeRelated/styles.scss index 59da263f..959fbce5 100644 --- a/src/components/node/NodeRelated/styles.scss +++ b/src/components/node/NodeRelated/styles.scss @@ -23,6 +23,7 @@ background-size: cover; padding-bottom: 100%; border-radius: $cell_radius; + cursor: pointer; } .title {