mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
added placeholders
This commit is contained in:
parent
44ab426915
commit
b4b138e90f
16 changed files with 239 additions and 117 deletions
|
@ -2,12 +2,38 @@ import React, { FC } from 'react';
|
|||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||
import styles from './styles.module.scss';
|
||||
import { LabNode } from '~/components/lab/LabNode';
|
||||
import { selectLabListNodes } from '~/redux/lab/selectors';
|
||||
import { selectLabList, selectLabListNodes } from '~/redux/lab/selectors';
|
||||
import { EMPTY_NODE, NODE_TYPES } from '~/redux/node/constants';
|
||||
import { values } from 'ramda';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const getRandomNodeType = () =>
|
||||
values(NODE_TYPES)[Math.floor(Math.random() * values(NODE_TYPES).length)];
|
||||
|
||||
const LoadingNode = () => (
|
||||
<LabNode
|
||||
node={{ ...EMPTY_NODE, type: getRandomNodeType() }}
|
||||
isLoading
|
||||
lastSeen=""
|
||||
commentCount={0}
|
||||
/>
|
||||
);
|
||||
|
||||
const LabGrid: FC<IProps> = () => {
|
||||
const nodes = useShallowSelect(selectLabListNodes);
|
||||
const { is_loading } = useShallowSelect(selectLabList);
|
||||
|
||||
if (is_loading) {
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
<LoadingNode />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue