diff --git a/customer/components/layout/Page.tsx b/customer/components/layout/Page.tsx index 59cca32ea..66d526ef3 100644 --- a/customer/components/layout/Page.tsx +++ b/customer/components/layout/Page.tsx @@ -10,7 +10,7 @@ import Link from 'next/link' import { Helpwave } from '@helpwave/common/icons/Helpwave' import type { Languages } from '@helpwave/common/hooks/useLanguage' import { useTranslation } from '@helpwave/common/hooks/useTranslation' -import { CircleUser, GaugeIcon, Menu, Package, Receipt } from 'lucide-react' +import { GaugeIcon, Menu, Package, Receipt, Settings } from 'lucide-react' import Head from 'next/head' import { MobileNavigationOverlay } from '@/components/layout/MobileNavigationOverlay' @@ -36,7 +36,7 @@ const navItems: NavItem[] = [ { name: { en: 'Dashboard', de: 'dashboard' }, url: '/', icon: () }, { name: { en: 'Products', de: 'Produkte' }, url: '/products', icon: () }, { name: { en: 'Invoices', de: 'Rechnungen' }, url: '/invoices', icon: () }, - { name: { en: 'Contact Information', de: 'Kontakt Informationen' }, url: '/contact-info', icon: () }, + { name: { en: 'Settings', de: 'Einstellungen' }, url: '/settings', icon: () }, ] /** diff --git a/customer/pages/contact-info/index.tsx b/customer/pages/settings/index.tsx similarity index 78% rename from customer/pages/contact-info/index.tsx rename to customer/pages/settings/index.tsx index a2e04d53e..c6e0b6822 100644 --- a/customer/pages/contact-info/index.tsx +++ b/customer/pages/settings/index.tsx @@ -12,7 +12,9 @@ import type { Customer } from '@/api/dataclasses/customer' import { tw } from '@twind/core' import { Button } from '@helpwave/common/components/Button' -type ContactInfoTranslation = { +type SettingsTranslation = { + settings: string, + settingsDescription: string, contactInfo: string, additionalInformation: string, name: string, @@ -29,8 +31,10 @@ type ContactInfoTranslation = { save: string, } -const defaultContactInfoTranslations: Record = { +const defaultSettingsTranslations: Record = { en: { + settings: 'Settings', + settingsDescription: 'Here you can change the settings and information of your organization.', contactInfo: 'Contact Information', additionalInformation: 'Additional Information', name: 'Name', @@ -40,13 +44,15 @@ const defaultContactInfoTranslations: Record address: 'Address', street: 'Street', houseNumber: 'Housenumber', - houseNumberAdditional: 'Housenumber Addition', + houseNumberAdditional: 'Addition', postalCode: 'Postal code', city: 'City', country: 'Country', save: 'Save' }, de: { + settings: 'Einstellungen', + settingsDescription: 'Hier kannst du die Einstellungen und Informationen deiner Organization ändern.', contactInfo: 'Kontakt Informationen', additionalInformation: 'Zusätzliche Informationen', name: 'Name', @@ -56,7 +62,7 @@ const defaultContactInfoTranslations: Record address: 'Adresse', street: 'Straße', houseNumber: 'Hausnummer', - houseNumberAdditional: 'Hausnummer Zusatz', + houseNumberAdditional: 'Zusatz', postalCode: 'Postleitzahl', city: 'Stadt', country: 'Land', @@ -64,12 +70,12 @@ const defaultContactInfoTranslations: Record } } -type ContactInfoServerSideProps = { +type SettingsServerSideProps = { jsonFeed: unknown, } -const ContactInfo: NextPage> = ({ overwriteTranslation }) => { - const translation = useTranslation(defaultContactInfoTranslations, overwriteTranslation) +const Settings: NextPage> = ({ overwriteTranslation }) => { + const translation = useTranslation(defaultSettingsTranslations, overwriteTranslation) const [currentData, setcurrentData] = useState() const { data, isError, isLoading } = useCustomerMyselfQuery() const customerUpdate = useCustomerUpdateMutation() @@ -80,11 +86,13 @@ const ContactInfo: NextPage -
+ +
{!!currentData && ( -
+
+ {translation.settingsDescription} +

{translation.contactInfo}

setcurrentData({ ...currentData, name })} @@ -100,14 +108,14 @@ const ContactInfo: NextPage setcurrentData({ ...currentData, phoneNumber })} label={{ name: translation.phone }} /> -
-

{translation.address}

+
+

{translation.address}

setcurrentData({ ...currentData, address: { ...currentData.address, country } })} label={{ name: translation.country }} /> -
+
setcurrentData({ ...currentData, address: { ...currentData.address, city } })} @@ -123,7 +131,7 @@ const ContactInfo: NextPage
-
+
setcurrentData({ @@ -151,8 +159,8 @@ const ContactInfo: NextPage
-
-

{translation.additionalInformation}

+
+

{translation.additionalInformation}

setcurrentData({ ...currentData, websiteURL })} @@ -172,4 +180,4 @@ const ContactInfo: NextPage