mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
added lab sorting
This commit is contained in:
parent
566e1192cd
commit
948f3a7e04
7 changed files with 63 additions and 15 deletions
|
@ -1,6 +1,8 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import { LabHeadItem } from '~/components/lab/LabHeadItem';
|
||||
import { LabNodesSort } from '~/types/lab';
|
||||
import { useLabContext } from '~/utils/context/LabContextProvider';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
|
@ -9,20 +11,28 @@ interface IProps {
|
|||
}
|
||||
|
||||
const LabHead: FC<IProps> = ({ isLoading }) => {
|
||||
const { sort, setSort } = useLabContext();
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<div className={styles.group}>
|
||||
<LabHeadItem icon="recent" active isLoading={isLoading}>
|
||||
<LabHeadItem
|
||||
icon="recent"
|
||||
active={sort === LabNodesSort.New}
|
||||
isLoading={isLoading}
|
||||
onClick={() => setSort(LabNodesSort.New)}
|
||||
>
|
||||
Свежие
|
||||
</LabHeadItem>
|
||||
|
||||
<LabHeadItem icon="hot" isLoading={isLoading}>
|
||||
<LabHeadItem
|
||||
icon="hot"
|
||||
active={sort === LabNodesSort.Hot}
|
||||
isLoading={isLoading}
|
||||
onClick={() => setSort(LabNodesSort.Hot)}
|
||||
>
|
||||
Популярные
|
||||
</LabHeadItem>
|
||||
|
||||
<LabHeadItem icon="star_full" isLoading={isLoading}>
|
||||
Важные
|
||||
</LabHeadItem>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue