1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

removed fluid lab

This commit is contained in:
Fedor Katurov 2021-09-14 17:00:06 +07:00
parent 5bdfeb6ce4
commit 6ba26e9c3e
3 changed files with 9 additions and 44 deletions

View file

@ -1,5 +1,4 @@
import React, { FC } from 'react';
import Masonry from 'react-masonry-css';
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
import styles from './styles.module.scss';
import { LabNode } from '~/components/lab/LabNode';
@ -7,15 +6,7 @@ import { selectLabList, selectLabListNodes } from '~/redux/lab/selectors';
import { EMPTY_NODE, NODE_TYPES } from '~/redux/node/constants';
import { values } from 'ramda';
interface IProps {
isFluid: boolean;
}
const breakpointColumnsObj = {
default: 3,
1100: 2,
700: 1,
};
interface IProps {}
const getRandomNodeType = () =>
values(NODE_TYPES)[Math.floor(Math.random() * values(NODE_TYPES).length)];
@ -29,7 +20,7 @@ const LoadingNode = () => (
/>
);
const LabGrid: FC<IProps> = ({ isFluid }) => {
const LabGrid: FC<IProps> = () => {
const nodes = useShallowSelect(selectLabListNodes);
const { is_loading } = useShallowSelect(selectLabList);
@ -45,11 +36,7 @@ const LabGrid: FC<IProps> = ({ isFluid }) => {
}
return (
<Masonry
className={styles.wrap}
breakpointCols={isFluid ? breakpointColumnsObj : 1}
columnClassName={styles.column}
>
<div className={styles.wrap}>
{nodes.map(node => (
<LabNode
node={node.node}
@ -58,7 +45,7 @@ const LabGrid: FC<IProps> = ({ isFluid }) => {
commentCount={node.comment_count}
/>
))}
</Masonry>
</div>
);
};