dashboard/src/app.tsx

64 lines
1.5 KiB
TypeScript
Raw Normal View History

import { createGlobalStyle } from "styled-components";
2020-07-08 19:36:36 +02:00
import SearchBar from "./components/searchBar";
import Greeter from "./components/greeter";
import AppList from "./components/appList";
2021-06-14 11:29:03 +02:00
import BookmarkList from "./components/bookmarks";
2020-09-08 13:18:58 +02:00
import Settings from "./components/settings";
2020-09-08 18:26:45 +02:00
import Imprint from "./components/imprint";
2020-07-08 19:36:36 +02:00
2021-03-21 18:05:24 +01:00
import selectedTheme from "./lib/theme";
import useFetcher from "./lib/fetcher";
2020-07-08 19:36:36 +02:00
2021-06-23 12:25:10 +02:00
export const GlobalStyle = createGlobalStyle`
2020-07-08 19:36:36 +02:00
body {
background-color: ${selectedTheme.backgroundColor};
font-family: Roboto, sans-serif;
2020-07-10 00:04:47 +02:00
margin: auto;
max-width: 95%;
max-height: 100%;
@media (min-width: 1366px) {
max-width: 70%;
}
2020-07-08 19:36:36 +02:00
}
`;
2021-03-21 18:05:24 +01:00
/**
* Renders the entire app by calling individual components
*/
const App = () => {
2021-06-14 11:29:03 +02:00
const {
appData,
bookmarkData,
searchProviderData,
themeData,
imprintData,
greeterData,
} = useFetcher();
return (
<>
<GlobalStyle />
<div>
2021-04-22 11:15:41 +02:00
<SearchBar search={searchProviderData?.search} />
2021-06-30 00:56:01 +02:00
{(!themeData.error || !searchProviderData.error) && (
<Settings
themes={themeData?.themes}
search={searchProviderData?.search}
/>
)}
2021-04-03 16:54:44 +02:00
<Greeter data={greeterData.greeter} />
{!appData.error && (
<AppList apps={appData.apps} categories={appData.categories} />
)}
{!bookmarkData.error && <BookmarkList groups={bookmarkData.groups} />}
{!imprintData.error && <Imprint imprint={imprintData.imprint} />}
</div>
</>
);
};
2020-07-08 19:36:36 +02:00
export default App;