start home page and settings

This commit is contained in:
marlon-erler
2024-07-19 23:45:07 +02:00
parent 5da13eace5
commit eaaf4b813c
13 changed files with 349 additions and 301 deletions
+33
View File
@@ -0,0 +1,33 @@
#home-page > div {
display: flex;
flex-direction: column;
gap: var(--large-gap);
}
#home-page > div > div {
display: flex;
flex-direction: column;
justify-content: start;
gap: var(--gap-between-tiles);
width: 100%;
flex: 1;
}
#home-page #overview-section {
max-width: var(--max-input-width);
}
@media (min-width: 1000px) {
#home-page > div {
flex-direction: row;
gap: 8rem;
}
#home-page #overview-section {
width: var(--max-input-width);
}
}
+48
View File
@@ -0,0 +1,48 @@
import "./homePage.css";
import * as React from "bloatless-react";
import { translations } from "./translations";
export function HomePage() {
return (
<article id="home-page">
<header>
<span>{translations.homePage.appName}</span>
</header>
<div>
<div id="overview-section">
<h2>{translations.homePage.overviewHeadline}</h2>
<div class="tile flex-no">
<span class="icon">cell_tower</span>
<div>
<h3>{translations.homePage.statusHeadline}</h3>
</div>
</div>
<button class="tile flex-no">
<span class="icon">settings</span>
<div>{translations.homePage.settingsButton}</div>
</button>
</div>
<div id="chat-section">
<h2>{translations.homePage.chatsHeadline}</h2>
<div class="flex-row width-input">
<input
placeholder={translations.homePage.addChatPlaceholder}
aria-label={translations.homePage.addChatAudioLabel}
></input>
<button
class="primary"
aria-label={translations.homePage.addChatButton}
>
<span class="icon">add</span>
</button>
</div>
</div>
</div>
</article>
);
}
+14
View File
@@ -0,0 +1,14 @@
import * as React from "bloatless-react";
import { translations } from "./translations";
export function MainPage() {
return (
<article id="home-page">
<header>
<span>{translations.homePage.appName}</span>
</header>
<div></div>
</article>
);
}
+19
View File
@@ -0,0 +1,19 @@
import * as React from "bloatless-react";
import { translations } from "./translations";
export function SetttingsModal() {
return (
<div class="modal">
<div>
<main>
<h2>{translations.settings.settingsHeadline}</h2>
</main>
<button>
{translations.general.closeButton}
<span class="icon">close</span>
</button>
</div>
</div>
);
}
+39
View File
@@ -0,0 +1,39 @@
const englishTranslations = {
general: {
closeButton: "close",
},
homePage: {
appName: "Comms",
///
overviewHeadline: "Overview",
statusHeadline: "Status",
settingsButton: "Settings",
///
chatsHeadline: "Chats",
addChatAudioLabel: "name of new chat",
addChatPlaceholder: "Add chat",
addChatButton: "Add chat",
},
settings: {
settingsHeadline: "Settings",
///
}
};
const allTranslations: { [language: string]: typeof englishTranslations } = {
en: englishTranslations,
};
const language = navigator.language.substring(0, 2);
export const translations = allTranslations[language] || allTranslations.en;