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

refactored flow layout

This commit is contained in:
Fedor Katurov 2020-04-18 13:54:18 +07:00
parent 756c82c8aa
commit 02885b89d5
4 changed files with 150 additions and 78 deletions

View file

@ -1,14 +1,11 @@
import React, { FC } from 'react';
import { Cell } from '~/components/flow/Cell';
import * as styles from './styles.scss';
import { IFlowState } from '~/redux/flow/reducer';
import { INode } from '~/redux/types';
import { canEditNode } from '~/utils/node';
import { IUser } from '~/redux/auth/types';
import { flowSetCellView } from '~/redux/flow/actions';
import { FlowHero } from '../FlowHero';
import { FlowRecent } from '../FlowRecent';
type IProps = Partial<IFlowState> & {
user: Partial<IUser>;
@ -16,34 +13,16 @@ type IProps = Partial<IFlowState> & {
onChangeCellView: typeof flowSetCellView;
};
export const FlowGrid: FC<IProps> = ({
user,
nodes,
heroes,
recent,
updated,
onSelect,
onChangeCellView,
}) => (
<div>
<div className={styles.grid_test}>
<div className={styles.hero}>
<FlowHero heroes={heroes} />
</div>
<div className={styles.stamp}>
<FlowRecent recent={recent} updated={updated} />
</div>
{nodes.map(node => (
<Cell
key={node.id}
node={node}
onSelect={onSelect}
can_edit={canEditNode(node, user)}
onChangeCellView={onChangeCellView}
/>
))}
</div>
</div>
export const FlowGrid: FC<IProps> = ({ user, nodes, onSelect, onChangeCellView }) => (
<>
{nodes.map(node => (
<Cell
key={node.id}
node={node}
onSelect={onSelect}
can_edit={canEditNode(node, user)}
onChangeCellView={onChangeCellView}
/>
))}
</>
);

View file

@ -2,11 +2,6 @@ $cols: $content_width / $cell;
$stamp_color: $content_bg;
.grid {
padding: $gap / 2;
margin: 0 (-$gap / 2);
}
.grid_test {
display: grid;
grid-template-columns: repeat(5, 1fr);
@ -73,7 +68,7 @@ $stamp_color: $content_bg;
.stamp {
@include outer_shadow();
// grid-row: -1 / 3;
grid-row-end: span 2;
grid-column: -2 / -1;
background: $stamp_color;
@ -90,16 +85,13 @@ $stamp_color: $content_bg;
position: relative;
&::after {
content: "";
content: '';
position: absolute;
bottom: 0;
left: 0;
height: 60px;
width: 100%;
background: linear-gradient(
transparentize($stamp_color, 1),
$stamp_color 90%
);
background: linear-gradient(transparentize($stamp_color, 1), $stamp_color 90%);
pointer-events: none;
touch-action: none;
}