mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-23 06:42:09 +03:00
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
|
import React from 'react';
|
||
|
import { BrowserRouter } from 'react-router-dom';
|
||
|
import { ThemeProvider } from 'styled-components';
|
||
|
import light from './themes/light';
|
||
|
import { Box, Reset } from '@tlon/indigo-react';
|
||
|
import StartupModal from './components/StartupModal';
|
||
|
import { useSettings } from './hooks/useSettings';
|
||
|
import Body from './components/Body';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const { loaded, wallet, provider, scanProgress } = useSettings();
|
||
|
const scanning = scanProgress?.main !== null || scanProgress?.change !== null;
|
||
|
const blur = !loaded || scanning ? false : !(wallet && provider);
|
||
|
|
||
|
return (
|
||
|
<BrowserRouter basename="/apps/bitcoin">
|
||
|
<ThemeProvider theme={light}>
|
||
|
<Reset />
|
||
|
{loaded && !scanning ? <StartupModal /> : null}
|
||
|
<Box
|
||
|
display="flex"
|
||
|
flexDirection="column"
|
||
|
position="absolute"
|
||
|
alignItems="center"
|
||
|
backgroundColor="lightOrange"
|
||
|
width="100%"
|
||
|
minHeight={loaded && !scanning ? '100%' : 'none'}
|
||
|
height={loaded && !scanning ? 'none' : '100%'}
|
||
|
style={{ filter: blur ? 'blur(8px)' : 'none' }}
|
||
|
px={[0, 4]}
|
||
|
pb={[0, 4]}
|
||
|
>
|
||
|
<Body />
|
||
|
</Box>
|
||
|
</ThemeProvider>
|
||
|
</BrowserRouter>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|