mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
made lab use provider and context
This commit is contained in:
parent
cb314e9f8d
commit
96f1529f2b
9 changed files with 129 additions and 56 deletions
26
src/utils/providers/LabProvider.tsx
Normal file
26
src/utils/providers/LabProvider.tsx
Normal file
|
@ -0,0 +1,26 @@
|
|||
import React, { FC } from 'react';
|
||||
import { LabContextProvider } from '~/utils/context/LabContextProvider';
|
||||
import { useLab } from '~/utils/hooks/lab/useLab';
|
||||
|
||||
interface LabProviderProps {}
|
||||
|
||||
const LabProvider: FC<LabProviderProps> = ({ children }) => {
|
||||
const { isLoading, nodes, count, onLoadMore, tags, heroes, isLoadingStats, updates } = useLab();
|
||||
|
||||
return (
|
||||
<LabContextProvider
|
||||
isLoading={isLoading && !nodes.length}
|
||||
nodes={nodes}
|
||||
count={count}
|
||||
onLoadMore={onLoadMore}
|
||||
tags={tags}
|
||||
heroes={heroes}
|
||||
isLoadingStats={isLoadingStats}
|
||||
updates={updates}
|
||||
>
|
||||
{children}
|
||||
</LabContextProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export { LabProvider };
|
Loading…
Add table
Add a link
Reference in a new issue