Implement aggregation frontend, also http on prod

This commit is contained in:
Guntis Smaukstelis
2023-05-15 20:50:53 +03:00
parent db900d6a33
commit ff45876377
12 changed files with 259 additions and 18 deletions
+17 -13
View File
@@ -1,24 +1,28 @@
import type { Component } from 'solid-js';
import { Component, createSignal } from 'solid-js';
import { Aggregator } from './aggregator/Aggregator';
import logo from './assets/logo.svg';
import styles from './css/App.module.css';
import { FileManager } from './fileManager/FileManager';
console.log("env:", import.meta.env.MODE);
console.log("api host:", import.meta.env.VITE_API_HOST);
type Section = "aggregator" | "fileManager";
const App: Component = () => {
return (
<div class={styles.App}>
<FileManager />
<header class={styles.header}>
<img src={logo} class={styles.logo} alt="logo" />
<p>
Weather tool web
</p>
</header>
</div>
);
const [getSection, setSection] = createSignal<Section>("aggregator");
const section = () => getSection() === "aggregator" ? <Aggregator /> : <FileManager />;
return (
<div class={styles.App}>
<div class={styles.sections}>
<span onClick={() => setSection("aggregator")}>aggregator</span> |
<span onClick={() => setSection("fileManager")}>file manager</span>
</div>
{ section() }
</div>
);
};
export default App;