Skip to content

Commit

Permalink
Merge pull request #247 from valory-xyz/bug/unstyled_text_fix
Browse files Browse the repository at this point in the history
fix unstyled text visible after splash screen
  • Loading branch information
truemiller authored Jul 26, 2024
2 parents f60616c + 4ffddcc commit e20b014
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../styles/globals.scss';

import { ConfigProvider } from 'antd';
import type { AppProps } from 'next/app';
import { useEffect, useRef } from 'react';
import { useEffect, useState } from 'react';

import { Layout } from '@/components/Layout';
import { BalanceProvider } from '@/context/BalanceProvider';
Expand All @@ -20,13 +20,9 @@ import { WalletProvider } from '@/context/WalletProvider';
import { mainTheme } from '@/theme';

export default function App({ Component, pageProps }: AppProps) {
const isMounted = useRef(false);

const [isMounted, setIsMounted] = useState(false);
useEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
setIsMounted(true);
}, []);

return (
Expand All @@ -42,13 +38,13 @@ export default function App({ Component, pageProps }: AppProps) {
<SetupProvider>
<SettingsProvider>
<StakingContractInfoProvider>
{isMounted ? (
<ConfigProvider theme={mainTheme}>
<ConfigProvider theme={mainTheme}>
{isMounted ? (
<Layout>
<Component {...pageProps} />
</Layout>
</ConfigProvider>
) : null}
) : null}
</ConfigProvider>
</StakingContractInfoProvider>
</SettingsProvider>
</SetupProvider>
Expand Down

0 comments on commit e20b014

Please sign in to comment.