From a80041f2b8a09aa8083e083a30cad84cfde5ac7c Mon Sep 17 00:00:00 2001 From: balzack Date: Thu, 5 Sep 2024 14:55:36 -0700 Subject: [PATCH] populating settings screen --- app/client/web/src/access/Access.module.css | 1 - app/client/web/src/constants/Strings.ts | 6 ++ app/client/web/src/session/Session.module.css | 2 + app/client/web/src/session/Session.tsx | 1 - .../web/src/settings/Settings.module.css | 84 ++++++++++++++++++- app/client/web/src/settings/Settings.tsx | 62 +++++++++++++- 6 files changed, 150 insertions(+), 6 deletions(-) diff --git a/app/client/web/src/access/Access.module.css b/app/client/web/src/access/Access.module.css index c6a0aefd..5acd6f3a 100644 --- a/app/client/web/src/access/Access.module.css +++ b/app/client/web/src/access/Access.module.css @@ -24,7 +24,6 @@ height: 48px; display: flex; align-items: center; - color: var(--mantine-color-red-6); } } diff --git a/app/client/web/src/constants/Strings.ts b/app/client/web/src/constants/Strings.ts index 82b1dfc6..0c2115e0 100644 --- a/app/client/web/src/constants/Strings.ts +++ b/app/client/web/src/constants/Strings.ts @@ -12,6 +12,7 @@ export const en = { enableNotifications: 'Push Notifications', accessCode: 'Access Code', forgotPassword: 'Forgot Password', + manageTopics: 'Manage Sealing Key', new: 'New', newMessage: 'New Message', @@ -225,6 +226,7 @@ export const fr = { enableNotifications: 'Notifications Push', accessCode: "Code d'Accès", forgotPassword: 'Mot de Passe Oublié', + manageTopics: 'Gérer la clé de sécurité', new: 'Nouveau', newMessage: 'Nouveau Message', @@ -441,6 +443,7 @@ export const sp = { enableNotifications: 'Notificaciones Push', accessCode: 'Código de Acceso', forgotPassword: 'Contraseña Olvidada', + manageTopics: 'Administrar clave de seguridad', new: 'Nuevo', newMessage: 'Nuevo mensaje', @@ -655,6 +658,7 @@ export const pt = { enableNotifications: 'Notificações Push', accessCode: 'Código de Acesso', forgotPassword: 'Senha Esquecida', + manageTopics: 'Gerenciar Chave de Selagem', new: 'Novo', newMessage: 'Nova mensagem', @@ -869,6 +873,7 @@ export const de = { enableNotifications: 'Mitteilungen', accessCode: 'Zugangscode', forgotPassword: 'Passwort Vergessen', + manageTopics: 'Sicherheitsschlüssel verwalten', new: 'Neu', newMessage: 'Neue Nachricht', @@ -1084,6 +1089,7 @@ export const ru = { enableNotifications: 'Уведомления', accessCode: 'Код доступа', forgotPassword: 'Пароль забыт', + manageTopics: 'Управление ключом запечатывания', new: 'Новый', newMessage: 'Новое сообщение', diff --git a/app/client/web/src/session/Session.module.css b/app/client/web/src/session/Session.module.css index ed984690..b5040356 100644 --- a/app/client/web/src/session/Session.module.css +++ b/app/client/web/src/session/Session.module.css @@ -27,6 +27,8 @@ .screen { width: 100%; + padding-left: 10%; + padding-right: 10%; height: calc(100% - 48px); background-color: #444444; } diff --git a/app/client/web/src/session/Session.tsx b/app/client/web/src/session/Session.tsx index dc261512..2a8057a6 100644 --- a/app/client/web/src/session/Session.tsx +++ b/app/client/web/src/session/Session.tsx @@ -25,7 +25,6 @@ export function Session() { { display.state.layout === 'small' && ( <>
- { tab === 'settings' && ( )} diff --git a/app/client/web/src/settings/Settings.module.css b/app/client/web/src/settings/Settings.module.css index 709be3cd..2d525d10 100644 --- a/app/client/web/src/settings/Settings.module.css +++ b/app/client/web/src/settings/Settings.module.css @@ -2,10 +2,11 @@ display: flex; flex-direction: column; align-items: center; - gap: 8px; + padding: 8px; + gap: 2px; .header { - font-size: 24px; + font-size: 22px; text-align: center; text-wrap: nowrap; text-overflow: ellipsis; @@ -14,8 +15,10 @@ .image { position: relative; - width: 80%; + width: 90%; max-width: 250px; + margin-top: 8px; + margin-bottom: 24px; } .edit { @@ -25,4 +28,79 @@ display: flex; justify-content: center; } + + .section { + width: 100%; + display: flex; + align-items: center; + + .sectionEdit { + flex-shrink: 0; + color: var(--mantine-color-dbgreen-1); + padding-left: 8px; + height: 0px; + position: relative; + top: -12px; + } + } + + .divider { + margin-top: 8px; + margin-bottom: 8px; + border: 1px solid var(--mantine-color-text-9); + width: 100%; + } + + .nameSet { + width: 100%; + padding-left: 8px; + font-size: 24px; + text-wrap: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + + .nameUnset { + width: 100%; + padding-left: 8px; + font-size: 24px; + text-wrap: nowrap; + text-overflow: ellipsis; + overflow: hidden; + font-style: italic; + color: var(--mantine-color-text-9); + } + + .entry { + width: 100%; + padding-left: 8px; + display: flex; + + .entryIcon { + width: 32px; + } + + .entrySet { + } + + .entryUnset { + font-style: italic; + color: var(--mantine-color-text-9); + } + + .entryValue { + display: flex; + cursor: pointer; + + .entryLabel { + padding-right: 16px; + color: var(--mantine-color-dbgreen-1); + } + + .entryControl { + display: flex; + align-items: center; + } + } + } } diff --git a/app/client/web/src/settings/Settings.tsx b/app/client/web/src/settings/Settings.tsx index 81423745..40095b2a 100644 --- a/app/client/web/src/settings/Settings.tsx +++ b/app/client/web/src/settings/Settings.tsx @@ -1,6 +1,7 @@ import { useSettings } from './useSettings.hook'; -import { Text, Image, Button } from '@mantine/core'; +import { Switch, Text, Image, Button, UnstyledButton } from '@mantine/core'; import classes from './Settings.module.css'; +import { IconCloudLock, IconBell, IconEye, IconBook, IconMapPin } from '@tabler/icons-react' export function Settings() { const { state, actions } = useSettings(); @@ -16,6 +17,65 @@ export function Settings() {
+
+
+ { state.strings.edit } +
+ { !state.profile.name && ( + {state.strings.name} + )} + { state.profile.name && ( + {state.profile.name} + )} +
+
+ +
+ { !state.profile.location && ( + {state.strings.location} + )} + { state.profile.location && ( + {state.profile.location} + )} +
+
+
+ +
+ { !state.profile.description && ( + {state.strings.description} + )} + { state.profile.description && ( + {state.profile.description} + )} +
+
+
+
+ +
+
+ { state.strings.registry } + +
+
+
+
+ +
+
+ { state.strings.manageTopics } +
+
+
+
+ +
+
+ { state.strings.enableNotifications } + +
+
); }