diff --git a/packages/app-client/src/app.css b/packages/app-client/src/app.css index b570a7f1..74a6e6f9 100644 --- a/packages/app-client/src/app.css +++ b/packages/app-client/src/app.css @@ -23,6 +23,9 @@ --destructive: 0 84.2% 60.2%; --destructive-foreground: 0 0% 98%; + --warning: 31 98% 50%; + --warning-foreground: 0 0% 98%; + --border: 0 0% 89.8%; --input: 0 0% 89.8%; --ring: 0 0% 3.9%; @@ -55,6 +58,9 @@ --destructive: 0 62.8% 30.6%; --destructive-foreground: 0 0% 98%; + --warning: 31 98% 50%; + --warning-foreground: 0 0% 98%; + --border: 0 0% 14.9%; --input: 0 0% 14.9%; --ring: 0 0% 83.1%; diff --git a/packages/app-client/src/locales/en.json b/packages/app-client/src/locales/en.json index cab8afee..07a8ac53 100644 --- a/packages/app-client/src/locales/en.json +++ b/packages/app-client/src/locales/en.json @@ -3,6 +3,10 @@ "title": "Enclosed", "description": "Send private and secure notes" }, + "insecureContextWarning": { + "description": "Your connection is not secure, the app must be served over HTTPS to work properly. You won't be able to create or view notes.", + "learn-more": "Learn more" + }, "navbar": { "new-note": "New note", "theme": { diff --git a/packages/app-client/src/locales/es.json b/packages/app-client/src/locales/es.json index 622aac3d..11f5dc00 100644 --- a/packages/app-client/src/locales/es.json +++ b/packages/app-client/src/locales/es.json @@ -3,6 +3,10 @@ "title": "Enclosed", "description": "Enviar notas privadas y seguras" }, + "insecureContextWarning": { + "description": "Su conexión no es segura, la aplicación debe ser servida a través de HTTPS para funcionar correctamente. No podrá crear ni ver notas.", + "learn-more": "Más información" + }, "navbar": { "new-note": "Nueva nota", "theme": { diff --git a/packages/app-client/src/locales/fr.json b/packages/app-client/src/locales/fr.json index 4855f8eb..ca4edad9 100644 --- a/packages/app-client/src/locales/fr.json +++ b/packages/app-client/src/locales/fr.json @@ -3,6 +3,10 @@ "title": "Enclosed", "description": "Envoyez des notes privées et sécurisées" }, + "insecureContextWarning": { + "description": "Votre connexion n'est pas sécurisée, l'application doit être servie via HTTPS pour fonctionner correctement. Vous ne pourrez pas créer ou consulter de notes.", + "learn-more": "En savoir plus" + }, "navbar": { "new-note": "Nouvelle note", "theme": { diff --git a/packages/app-client/src/modules/ui/layouts/app.layout.tsx b/packages/app-client/src/modules/ui/layouts/app.layout.tsx index 05691b4d..92236050 100644 --- a/packages/app-client/src/modules/ui/layouts/app.layout.tsx +++ b/packages/app-client/src/modules/ui/layouts/app.layout.tsx @@ -1,4 +1,3 @@ -import type { Component, ParentComponent } from 'solid-js'; import { authStore } from '@/modules/auth/auth.store'; import { buildTimeConfig } from '@/modules/config/config.constants'; import { useConfig } from '@/modules/config/config.provider'; @@ -10,6 +9,7 @@ import { useThemeStore } from '@/modules/theme/theme.store'; import { Button } from '@/modules/ui/components/button'; import { DropdownMenu } from '@kobalte/core/dropdown-menu'; import { A, useNavigate } from '@solidjs/router'; +import { type Component, type ParentComponent, Show } from 'solid-js'; import { DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '../components/dropdown-menu'; export const Navbar: Component = () => { @@ -165,8 +165,25 @@ export const Footer: Component = () => { }; export const AppLayout: ParentComponent = (props) => { + const getIsSecureContext = () => { + return window.isSecureContext ?? window.location.protocol === 'https:'; + }; + + const { t } = useI18n(); + return (