You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
900 B
34 lines
900 B
3 years ago
|
import React, { createContext, useContext, useState } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
|
||
|
export const AdvanceGasFeePopoverContext = createContext({});
|
||
|
|
||
|
export const AdvanceGasFeePopoverContextProvider = ({ children }) => {
|
||
|
const [maxFeePerGas, setMaxFeePerGas] = useState();
|
||
|
const [maxPriorityFeePerGas, setMaxPriorityFeePerGas] = useState();
|
||
|
const [isDirty, setDirty] = useState();
|
||
|
|
||
|
return (
|
||
|
<AdvanceGasFeePopoverContext.Provider
|
||
|
value={{
|
||
|
isDirty,
|
||
|
maxFeePerGas,
|
||
|
maxPriorityFeePerGas,
|
||
|
setDirty,
|
||
|
setMaxPriorityFeePerGas,
|
||
|
setMaxFeePerGas,
|
||
|
}}
|
||
|
>
|
||
|
{children}
|
||
|
</AdvanceGasFeePopoverContext.Provider>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export function useAdvanceGasFeePopoverContext() {
|
||
|
return useContext(AdvanceGasFeePopoverContext);
|
||
|
}
|
||
|
|
||
|
AdvanceGasFeePopoverContextProvider.propTypes = {
|
||
|
children: PropTypes.node.isRequired,
|
||
|
};
|