-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: simulation * Add context, update logos, remove canExecute * fix: reset on tx change + simplify context --------- Co-authored-by: Usame Algan <[email protected]>
- Loading branch information
1 parent
d259685
commit 4eae3e6
Showing
13 changed files
with
302 additions
and
66 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createContext } from 'react' | ||
|
||
import { useSimulation, type UseSimulationReturn } from '@/components/tx/TxSimulation/useSimulation' | ||
import { FETCH_STATUS } from '@/components/tx/TxSimulation/types' | ||
|
||
export const TxInfoContext = createContext<{ | ||
simulation: UseSimulationReturn | ||
}>({ | ||
simulation: { | ||
simulateTransaction: () => {}, | ||
simulation: undefined, | ||
simulationRequestStatus: FETCH_STATUS.NOT_ASKED, | ||
simulationLink: '', | ||
requestError: undefined, | ||
resetSimulation: () => {}, | ||
}, | ||
}) | ||
|
||
export const TxInfoProvider = ({ children }: { children: JSX.Element }) => { | ||
const simulation = useSimulation() | ||
|
||
return <TxInfoContext.Provider value={{ simulation }}>{children}</TxInfoContext.Provider> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.