From a463cb491b28c1f94803844973cdc043588d4b1d Mon Sep 17 00:00:00 2001
From: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
Date: Mon, 25 Dec 2023 21:25:09 +0100
Subject: [PATCH] feat: app settings (#658)
* feat: app settings
* refactor: cleanup routes
* style: smaller base font
* chore: migrate about modal
* fix: import links
---
.../external-link/ExternalLink.module.scss | 20 +++
.../components/external-link/ExternalLink.tsx | 29 +++
apps/client/src/externals.ts | 1 +
.../app-settings/AppSettings.module.scss | 13 ++
.../src/features/app-settings/AppSettings.tsx | 29 +++
.../panel-content/PanelContent.module.scss | 20 +++
.../panel-content/PanelContent.tsx | 22 +++
.../panel-list/PanelList.module.scss | 64 +++++++
.../app-settings/panel-list/PanelList.tsx | 55 ++++++
.../app-settings/panel/Panel.module.scss | 37 ++++
.../app-settings/panel/PanelUtils.tsx | 23 +++
.../panel/about-panel/AboutPanel.tsx | 35 ++++
.../panel/about-panel/CheckUpdatesButton.tsx | 73 ++++++++
.../features/app-settings/settingsStore.ts | 76 ++++++++
.../src/features/editors/Editor.module.scss | 169 +++---------------
apps/client/src/features/editors/Editor.tsx | 85 ++++++---
.../event-editor/EventEditor.module.scss | 31 ++++
.../event-editor/EventEditorExport.tsx | 19 +-
.../src/features/menu/MenuBar.module.scss | 10 +-
apps/client/src/features/menu/MenuBar.tsx | 25 ++-
apps/client/src/theme/ontimeButton.ts | 8 +
apps/client/src/theme/theme.ts | 2 +
apps/test-db/db.json | 2 +-
e2e/tests/000-smoke-tests.spec.ts | 2 +-
24 files changed, 666 insertions(+), 184 deletions(-)
create mode 100644 apps/client/src/common/components/external-link/ExternalLink.module.scss
create mode 100644 apps/client/src/common/components/external-link/ExternalLink.tsx
create mode 100644 apps/client/src/features/app-settings/AppSettings.module.scss
create mode 100644 apps/client/src/features/app-settings/AppSettings.tsx
create mode 100644 apps/client/src/features/app-settings/panel-content/PanelContent.module.scss
create mode 100644 apps/client/src/features/app-settings/panel-content/PanelContent.tsx
create mode 100644 apps/client/src/features/app-settings/panel-list/PanelList.module.scss
create mode 100644 apps/client/src/features/app-settings/panel-list/PanelList.tsx
create mode 100644 apps/client/src/features/app-settings/panel/Panel.module.scss
create mode 100644 apps/client/src/features/app-settings/panel/PanelUtils.tsx
create mode 100644 apps/client/src/features/app-settings/panel/about-panel/AboutPanel.tsx
create mode 100644 apps/client/src/features/app-settings/panel/about-panel/CheckUpdatesButton.tsx
create mode 100644 apps/client/src/features/app-settings/settingsStore.ts
diff --git a/apps/client/src/common/components/external-link/ExternalLink.module.scss b/apps/client/src/common/components/external-link/ExternalLink.module.scss
new file mode 100644
index 000000000..a09a53ba0
--- /dev/null
+++ b/apps/client/src/common/components/external-link/ExternalLink.module.scss
@@ -0,0 +1,20 @@
+@use '../../../theme/v2Styles' as *;
+@use '../../../theme/ontimeColours' as *;
+
+.link {
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+
+ color: $blue-500;
+ transition-property: color;
+ transition-duration: $transition-time-action;
+
+ &.inline {
+ display: inline-flex;
+ }
+
+ &:hover {
+ color: $ontime-color;
+ }
+}
diff --git a/apps/client/src/common/components/external-link/ExternalLink.tsx b/apps/client/src/common/components/external-link/ExternalLink.tsx
new file mode 100644
index 000000000..25e4b0e21
--- /dev/null
+++ b/apps/client/src/common/components/external-link/ExternalLink.tsx
@@ -0,0 +1,29 @@
+import { MouseEvent, ReactNode } from 'react';
+import { IoOpenOutline } from '@react-icons/all-files/io5/IoOpenOutline';
+
+import { openLink } from '../../utils/linkUtils';
+import { cx } from '../../utils/styleUtils';
+
+import style from './ExternalLink.module.scss';
+
+interface ExternalLinkProps {
+ href: string;
+ children: ReactNode;
+ inline?: boolean;
+}
+
+export default function ModalLink(props: ExternalLinkProps) {
+ const { href, inline, children } = props;
+ const classes = cx([style.link, inline ? style.inline : null]);
+
+ const handleClick = (event: MouseEvent) => {
+ event.preventDefault();
+ openLink(href);
+ };
+
+ return (
+
+ {children}
{children}
; +} + +export function Paragraph({ children }: { children: ReactNode }) { + return{children}
; +} + +export function Card({ children }: { children: ReactNode }) { + return