For the complete documentation index, see llms.txt. This page is also available as Markdown.
Context API
Providers that you'll need.
Overview
This section will show the code for the providers we will use, such as for tabs, wallet and escrows .
Tabs Global State Management
Tabs global state management involves maintaining and synchronizing the state of tab components across an application to ensure consistency and efficiency.
"use client";import{createContext,useContext,useState,ReactNode}from"react";typeTabs="deploy"|"escrow"|"helper";interfaceTabsContextType{activeTab:Tabs;setActiveTab:(tab:Tabs)=>void;}constTabsContext=createContext<TabsContextType|undefined>(undefined);exportfunctionuseTabsContext(){constcontext=useContext(TabsContext);if (!context) {thrownewError("useTabsContext must be used within TabsProvider");}returncontext;}exportfunctionTabsProvider({children}:{children:ReactNode}){const[activeTab,setActiveTab]=useState<Tabs>("deploy");return (<TabsContext.Providervalue={{activeTab,setActiveTab}}>{children}</TabsContext.Provider> );}
Escrow Global State Management
Escrow global state management involves handling the state related to escrow functionalities within an application. It ensures that all components engaging with escrow operations maintain a synchronized state.
Wallet Global State Management
Wallet global state management ensures the consistent handling of wallet-related states across the application.
Global Provider
We built a global provider in order to manage the providers.