Query and display weather data for all country
This commit is contained in:
+12
-9
@@ -1,31 +1,34 @@
|
||||
import { Component, createSignal } from 'solid-js';
|
||||
import { Aggregator } from './aggregator/Aggregator';
|
||||
|
||||
import styles from './css/App.module.css';
|
||||
import { FileManager } from './fileManager/FileManager';
|
||||
import { Country } from './country/Country';
|
||||
import { Cities } from './cities/Cities';
|
||||
import { Database } from './database/Database';
|
||||
|
||||
console.log("env:", import.meta.env.MODE);
|
||||
console.log("api host:", import.meta.env.VITE_API_HOST);
|
||||
|
||||
type Section = "aggregator" | "mapView" | "fileManager";
|
||||
type Section = "cities" | "country" | "database";
|
||||
|
||||
const App: Component = () => {
|
||||
const [getSection, setSection] = createSignal<Section>("aggregator");
|
||||
const [getSection, setSection] = createSignal<Section>("country");
|
||||
|
||||
const section = () => {
|
||||
switch(getSection()) {
|
||||
case "fileManager": return <FileManager />;
|
||||
case "aggregator":
|
||||
case "database": return <Database />;
|
||||
case "country": return <Country />;
|
||||
case "cities": return <Cities />
|
||||
default:
|
||||
return <Aggregator />;
|
||||
return <Cities />;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={styles.App}>
|
||||
<div class={styles.sections}>
|
||||
<span onClick={() => setSection("aggregator")}>aggregator</span> |
|
||||
<span onClick={() => setSection("fileManager")}>file manager</span>
|
||||
<span onClick={() => setSection("cities")}>cities</span> |
|
||||
<span onClick={() => setSection("country")}>latvia</span> |
|
||||
<span onClick={() => setSection("database")}>database</span>
|
||||
</div>
|
||||
{ section() }
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user