diff --git a/apps/react-starter/src/App.tsx b/apps/react-starter/src/App.tsx index 0a02c99..2d62e8c 100644 --- a/apps/react-starter/src/App.tsx +++ b/apps/react-starter/src/App.tsx @@ -14,17 +14,19 @@ import { IxMenuSettingsItem, } from "@siemens/ix-react"; import * as echarts from "echarts/core"; -import { useEffect } from "react"; +import { useEffect, useRef } from "react"; import { useTranslation } from "react-i18next"; import { NavLink, Outlet } from "react-router-dom"; import useShowDemoMessage from "./hooks/demoMessage"; import Logo from "./Logo"; -import { useDataStore } from "./store/device-store"; import UserSettings from "./pages/user-settings"; +import { useDataStore } from "./store/device-store"; +import ApplicationSettings from "./pages/application-settings"; registerTheme(echarts); function App() { + const menuRef = useRef(null); const showDemoMessage = useShowDemoMessage(); const { fetch } = useDataStore(); @@ -48,6 +50,7 @@ function App() { + + + diff --git a/apps/react-starter/src/locales/de/translation.json b/apps/react-starter/src/locales/de/translation.json index 47e4098..c024ed7 100644 --- a/apps/react-starter/src/locales/de/translation.json +++ b/apps/react-starter/src/locales/de/translation.json @@ -89,7 +89,14 @@ }, "settings": { "title": "Einstellungen", - "user-settings": "Benutzereinstellungen" + "user-settings": "Benutzereinstellungen", + "application-settings": "Anwendungseinstellungen", + "notification": "Benachrichtigung", + "toggle-on": "Eingeschaltet", + "toggle-off": "Ausgeschaltet", + "import-device": "Gerätedaten importieren", + "upload-text": "Dateien hierher ziehen oder...", + "upload-button": "Dateien auswählen" }, "toggle-theme": "Theme wechseln", "search": "Suchen", diff --git a/apps/react-starter/src/locales/en/translation.json b/apps/react-starter/src/locales/en/translation.json index 385d3d6..28f72ac 100644 --- a/apps/react-starter/src/locales/en/translation.json +++ b/apps/react-starter/src/locales/en/translation.json @@ -90,7 +90,14 @@ }, "settings": { "title": "Settings", - "user-settings": "User settings" + "user-settings": "User settings", + "application-settings": "Application settings", + "notification": "Notification", + "toggle-on": "On", + "toggle-off": "Off", + "import-device": "Import device data", + "upload-text": "Drag files here or...", + "upload-button": "Browse files" }, "toggle-theme": "Toggle theme", "search": "Search", diff --git a/apps/react-starter/src/pages/application-settings/index.tsx b/apps/react-starter/src/pages/application-settings/index.tsx new file mode 100644 index 0000000..7157c61 --- /dev/null +++ b/apps/react-starter/src/pages/application-settings/index.tsx @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { IxToggle, IxTypography, IxUpload } from "@siemens/ix-react"; +import styles from "./styles.module.css"; +import { useTranslation } from "react-i18next"; + +export default function ApplicationSettings() { + const { t } = useTranslation(); + return ( +
+
+ + {t("settings.notification")} + + +
+
+ + {t("settings.import-device")} + + +
+
+ ); +} diff --git a/apps/react-starter/src/pages/application-settings/styles.module.css b/apps/react-starter/src/pages/application-settings/styles.module.css new file mode 100644 index 0000000..6d9cf41 --- /dev/null +++ b/apps/react-starter/src/pages/application-settings/styles.module.css @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.ApplicationSettings { + display: flex; + flex-direction: column; + gap: 1.5rem; +} + +.Headline { + margin-bottom: 0.75rem; +} + +.Upload { + width: fit-content; + width: 25rem; + max-width: 25rem; +} diff --git a/apps/react-starter/src/pages/user-settings/index.tsx b/apps/react-starter/src/pages/user-settings/index.tsx index 478b971..862336c 100644 --- a/apps/react-starter/src/pages/user-settings/index.tsx +++ b/apps/react-starter/src/pages/user-settings/index.tsx @@ -24,12 +24,21 @@ function ThemeButton(props: { onClick?: () => void; }) { return ( -
+
{ + event.preventDefault(); + event.stopPropagation(); + + if (props.onClick) { + props.onClick(); + } + }} + >
Siemens brand theme
@@ -38,7 +47,9 @@ function ThemeButton(props: { type="radio" checked={props.active} id={props.name} - onChange={() => props.onClick?.()} + onChange={() => { + console.log("ThemeButton onChange", props.theme); + }} />
@@ -57,10 +68,8 @@ export default function UserSettings() { }, [currentTheme]); return ( -
- - Theme - +
+ Theme
setCurrentTheme("classic")} />
- - {t("language.title")} - -
-
- i18n.changeLanguage("en")} - /> - -
-
- i18n.changeLanguage("de")} - /> - -
+
+ + {t("language.title")} + +
+
+ i18n.changeLanguage("en")} + /> + +
+
+ i18n.changeLanguage("de")} + /> + +
+
); diff --git a/apps/react-starter/src/pages/user-settings/styles.module.css b/apps/react-starter/src/pages/user-settings/styles.module.css index a60cc52..5f4f5e4 100644 --- a/apps/react-starter/src/pages/user-settings/styles.module.css +++ b/apps/react-starter/src/pages/user-settings/styles.module.css @@ -7,6 +7,12 @@ * LICENSE file in the root directory of this source tree. */ +.UserSettings { + display: flex; + flex-direction: column; + gap: 1.5rem; +} + .ThemeSelection { display: flex; flex-wrap: wrap; @@ -32,10 +38,15 @@ padding: 0.5rem; gap: 1rem; cursor: pointer; + + width: 208px; + height: 160px; } .ThemeImagePreview img { - user-select: none; + object-fit: contain; + height: 100%; + width: 100%; } .ThemeImagePreview.Active { @@ -50,6 +61,6 @@ gap: 0.5rem; } -.HeadlineMargin { - margin-bottom: 1rem; +.HeadlineLanguage { + margin-bottom: 0.75rem; }