Skip to content

Commit

Permalink
chore: address review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Jul 2, 2024
1 parent fbbfbf9 commit a1605a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions frontend/context/StakingContractInfoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import { createContext, PropsWithChildren, useEffect, useState } from 'react';

import { AutonolasService } from '@/service/Autonolas';

type StakingContractInfoProviderContextType = {
type StakingContractInfoContextProps = {
isStakingContractInfoLoading: boolean;
isRewardsAvailable: boolean;
hasEnoughServiceSlots: boolean;
isAgentEvicted: boolean; // TODO: Implement this
canStartAgent: boolean;
};

export const StakingContractInfoProviderContext =
createContext<StakingContractInfoProviderContextType>({
export const StakingContractInfoContext =
createContext<StakingContractInfoContextProps>({
isStakingContractInfoLoading: true,
isRewardsAvailable: false,
hasEnoughServiceSlots: false,
isAgentEvicted: false,
canStartAgent: false,
});

export const StakingContractInfoProviderProvider = ({
export const StakingContractInfoProvider = ({
children,
}: PropsWithChildren) => {
const [isStakingContractInfoLoading, setIsStakingContractInfoLoading] =
Expand Down Expand Up @@ -55,7 +55,7 @@ export const StakingContractInfoProviderProvider = ({
}, []);

return (
<StakingContractInfoProviderContext.Provider
<StakingContractInfoContext.Provider
value={{
isStakingContractInfoLoading,
isRewardsAvailable,
Expand All @@ -65,6 +65,6 @@ export const StakingContractInfoProviderProvider = ({
}}
>
{children}
</StakingContractInfoProviderContext.Provider>
</StakingContractInfoContext.Provider>
);
};
4 changes: 2 additions & 2 deletions frontend/hooks/useStakingContractInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext } from 'react';

import { StakingContractInfoProviderContext } from '@/context/StakingContractInfoProvider';
import { StakingContractInfoContext } from '@/context/StakingContractInfoProvider';

export const useStakingContractInfo = () => {
const {
Expand All @@ -9,7 +9,7 @@ export const useStakingContractInfo = () => {
isAgentEvicted,
isRewardsAvailable,
isStakingContractInfoLoading,
} = useContext(StakingContractInfoProviderContext);
} = useContext(StakingContractInfoContext);

return {
canStartAgent,
Expand Down
6 changes: 3 additions & 3 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MasterSafeProvider } from '@/context/MasterSafeProvider';
import { OnlineStatusProvider } from '@/context/OnlineStatusProvider';
import { RewardProvider } from '@/context/RewardProvider';
import { SettingsProvider } from '@/context/SettingsProvider';
import { StakingContractInfoProviderProvider } from '@/context/StakingContractInfoProvider';
import { StakingContractInfoProvider } from '@/context/StakingContractInfoProvider';
import { StoreProvider } from '@/context/StoreProvider';
import { WalletProvider } from '@/context/WalletProvider';
import { mainTheme } from '@/theme';
Expand All @@ -39,15 +39,15 @@ export default function App({ Component, pageProps }: AppProps) {
<BalanceProvider>
<SetupProvider>
<SettingsProvider>
<StakingContractInfoProviderProvider>
<StakingContractInfoProvider>
{isMounted ? (
<ConfigProvider theme={mainTheme}>
<Layout>
<Component {...pageProps} />
</Layout>
</ConfigProvider>
) : null}
</StakingContractInfoProviderProvider>
</StakingContractInfoProvider>
</SettingsProvider>
</SetupProvider>
</BalanceProvider>
Expand Down

0 comments on commit a1605a1

Please sign in to comment.