forked from Standard-Hashrate-Group/btcst.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
29 lines (26 loc) · 879 Bytes
/
index.tsx
File metadata and controls
29 lines (26 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from "react";
import { EthersContextConsumer, EthersContextProvider } from "./EthersContext";
import { GlobalContextConsumer, GlobalContextProvider } from "./GlobalContext";
export const ContextProvider = ({ children }) => {
return (
<GlobalContextProvider>
<EthersContextProvider>{children}</EthersContextProvider>
</GlobalContextProvider>
);
};
export const ContextConsumer = ({ children }) => {
return (
<GlobalContextConsumer>
{globalContext => (
<EthersContextConsumer>
{ethersContext =>
children({
...globalContext,
...ethersContext
})
}
</EthersContextConsumer>
)}
</GlobalContextConsumer>
);
};