Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] remove unnecessary .Provider as React19 doesnt require it #639

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/GlobalStateProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const GlobalStateProvider = ({ children }: { children: JSX.Element }) => {
[dAppName, getThemeName, removeWalletAccount, setWalletAccount, tenantName, walletAccount],
);

return <GlobalStateContext.Provider value={providerValue}>{children}</GlobalStateContext.Provider>;
return <GlobalStateContext value={providerValue}>{children}</GlobalStateContext>;
};

const useGlobalState = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/NodeInfoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const NodeInfoProvider = ({ children, tenantRPC }: { children: React.ReactNode;
}
}, [currentTenantRPC, tenantRPC, pendingInitiationPromise, setPendingInitiationPromise]);

return <NodeInfoContext.Provider value={{ state, setState }}>{children}</NodeInfoContext.Provider>;
return <NodeInfoContext value={{ state, setState }}>{children}</NodeInfoContext>;
};

const useNodeInfoState = () => useContext(NodeInfoContext);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/spacewalk/bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Bridge() {
const bridgeDirection = tabValue === BridgeTabs.Issue ? BridgeDirection.Issue : BridgeDirection.Redeem;

return chain ? (
<BridgeContext.Provider
<BridgeContext
value={{
selectedAsset,
setSelectedAsset,
Expand All @@ -86,18 +86,18 @@ function Bridge() {
setExtendedVaults,
}}
>
<div className="flex items-center justify-center mt-4">
<div className="mt-4 flex items-center justify-center">
<SettingsDialog
visible={settingsVisible}
onClose={() => setSettingsVisible(false)}
bridgeDirection={bridgeDirection}
/>
<Card className="bridge-card min-h-500 w-full max-w-[520px] rounded-lg bg-base-200">
<div className="flex justify-between px-5 mt-5">
<div className="mt-5 flex justify-between px-5">
<SpacewalkTabs activeTab={tabValue} setActiveTab={setTabValue} />
<Button
color="ghost"
className="min-h-0 p-1 m-auto settings h-fit"
className="settings m-auto h-fit min-h-0 p-1"
onClick={() => setSettingsVisible(true)}
>
<SettingsIcon />
Expand All @@ -106,7 +106,7 @@ function Bridge() {
{Content}
</Card>
</div>
</BridgeContext.Provider>
</BridgeContext>
) : (
<></>
);
Expand Down
6 changes: 3 additions & 3 deletions src/services/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const ModalProvider = ({ children }: ModalProviderProps): JSX.Element | null =>
}, []);

return (
<ModalStateContext.Provider value={state}>
<ModalToggleContext.Provider value={toggleModal}>{children}</ModalToggleContext.Provider>
</ModalStateContext.Provider>
<ModalStateContext value={state}>
<ModalToggleContext value={toggleModal}>{children}</ModalToggleContext>
</ModalStateContext>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/shared/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SharedStateProvider = ({ children, api, signer, address }: { childr
}),
[api, signer, address],
);
return <SharedStateContext.Provider value={providerValue}>{children}</SharedStateContext.Provider>;
return <SharedStateContext value={providerValue}>{children}</SharedStateContext>;
};

export const useSharedState = () => {
Expand Down
Loading