mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
returned fluid lab
This commit is contained in:
parent
8ff18dfd10
commit
2e4cb24cf4
4 changed files with 41 additions and 37 deletions
|
@ -1,4 +1,5 @@
|
|||
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';
|
||||
|
@ -8,6 +9,11 @@ import { values } from 'ramda';
|
|||
|
||||
interface IProps {}
|
||||
|
||||
const breakpointCols = {
|
||||
default: 2,
|
||||
1280: 1,
|
||||
};
|
||||
|
||||
const getRandomNodeType = () =>
|
||||
values(NODE_TYPES)[Math.floor(Math.random() * values(NODE_TYPES).length)];
|
||||
|
||||
|
@ -26,17 +32,30 @@ const LabGrid: FC<IProps> = () => {
|
|||
|
||||
if (is_loading) {
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<Masonry
|
||||
className={styles.wrap}
|
||||
breakpointCols={breakpointCols}
|
||||
columnClassName={styles.column}
|
||||
>
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
</div>
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
</Masonry>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<Masonry
|
||||
className={styles.wrap}
|
||||
breakpointCols={breakpointCols}
|
||||
columnClassName={styles.column}
|
||||
>
|
||||
{nodes.map(node => (
|
||||
<LabNode
|
||||
node={node.node}
|
||||
|
@ -45,7 +64,7 @@ const LabGrid: FC<IProps> = () => {
|
|||
commentCount={node.comment_count}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Masonry>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue