React Interface v1

This commit is contained in:
DomySh
2022-06-12 12:09:50 +02:00
parent af63ab176f
commit e62e655fdc
20 changed files with 547 additions and 110 deletions

View File

@@ -1,37 +1,22 @@
import { Container, MantineProvider } from '@mantine/core';
import React, { useEffect, useState } from 'react';
import { Service, update_freq } from '../js/models';
import { servicelist } from '../js/utils';
import { Container, MantineProvider, Space } from '@mantine/core';
import { NotificationsProvider } from '@mantine/notifications';
import React from 'react';
import Footer from './Footer';
import Header from './Header';
function MainLayout({ children }:{ children:any }) {
const [services, setServices] = useState<Service[]>([]);
const updateInfo = () => {
servicelist().then(res => {
setServices(res)
setTimeout(updateInfo, update_freq)
}).catch(
err =>{
setTimeout(updateInfo, update_freq)}
)
}
useEffect(updateInfo,[]);
return <>
<MantineProvider theme={{ colorScheme: 'dark' }} withGlobalStyles withNormalizeCSS>
<Header />
<div style={{marginTop:"50px"}}/>
<Container size="xl" style={{minHeight:"58vh"}}>
{children}
</Container>
<div style={{marginTop:"50px"}}/>
<Footer />
</MantineProvider>
<MantineProvider theme={{ colorScheme: 'dark' }} withGlobalStyles withNormalizeCSS>
<NotificationsProvider>
<Header />
<Space h="xl" />
<Container size="xl" style={{minHeight:"57.5vh"}}>
{children}
</Container>
<Space h="xl" />
<Footer />
</NotificationsProvider>
</MantineProvider>
</>
}