Skip to content
This repository was archived by the owner on Dec 6, 2025. It is now read-only.

Commit 42ed67c

Browse files
authored
chore: change contact info to settings (#1194)
1 parent 3e5117d commit 42ed67c

2 files changed

Lines changed: 27 additions & 19 deletions

File tree

customer/components/layout/Page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Link from 'next/link'
1010
import { Helpwave } from '@helpwave/common/icons/Helpwave'
1111
import type { Languages } from '@helpwave/common/hooks/useLanguage'
1212
import { useTranslation } from '@helpwave/common/hooks/useTranslation'
13-
import { CircleUser, GaugeIcon, Menu, Package, Receipt } from 'lucide-react'
13+
import { GaugeIcon, Menu, Package, Receipt, Settings } from 'lucide-react'
1414
import Head from 'next/head'
1515
import { MobileNavigationOverlay } from '@/components/layout/MobileNavigationOverlay'
1616

@@ -36,7 +36,7 @@ const navItems: NavItem[] = [
3636
{ name: { en: 'Dashboard', de: 'dashboard' }, url: '/', icon: (<GaugeIcon size={24}/>) },
3737
{ name: { en: 'Products', de: 'Produkte' }, url: '/products', icon: (<Package size={24}/>) },
3838
{ name: { en: 'Invoices', de: 'Rechnungen' }, url: '/invoices', icon: (<Receipt size={24}/>) },
39-
{ name: { en: 'Contact Information', de: 'Kontakt Informationen' }, url: '/contact-info', icon: (<CircleUser size={24}/>) },
39+
{ name: { en: 'Settings', de: 'Einstellungen' }, url: '/settings', icon: (<Settings size={24}/>) },
4040
]
4141

4242
/**
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import type { Customer } from '@/api/dataclasses/customer'
1212
import { tw } from '@twind/core'
1313
import { Button } from '@helpwave/common/components/Button'
1414

15-
type ContactInfoTranslation = {
15+
type SettingsTranslation = {
16+
settings: string,
17+
settingsDescription: string,
1618
contactInfo: string,
1719
additionalInformation: string,
1820
name: string,
@@ -29,8 +31,10 @@ type ContactInfoTranslation = {
2931
save: string,
3032
}
3133

32-
const defaultContactInfoTranslations: Record<Languages, ContactInfoTranslation> = {
34+
const defaultSettingsTranslations: Record<Languages, SettingsTranslation> = {
3335
en: {
36+
settings: 'Settings',
37+
settingsDescription: 'Here you can change the settings and information of your organization.',
3438
contactInfo: 'Contact Information',
3539
additionalInformation: 'Additional Information',
3640
name: 'Name',
@@ -40,13 +44,15 @@ const defaultContactInfoTranslations: Record<Languages, ContactInfoTranslation>
4044
address: 'Address',
4145
street: 'Street',
4246
houseNumber: 'Housenumber',
43-
houseNumberAdditional: 'Housenumber Addition',
47+
houseNumberAdditional: 'Addition',
4448
postalCode: 'Postal code',
4549
city: 'City',
4650
country: 'Country',
4751
save: 'Save'
4852
},
4953
de: {
54+
settings: 'Einstellungen',
55+
settingsDescription: 'Hier kannst du die Einstellungen und Informationen deiner Organization ändern.',
5056
contactInfo: 'Kontakt Informationen',
5157
additionalInformation: 'Zusätzliche Informationen',
5258
name: 'Name',
@@ -56,20 +62,20 @@ const defaultContactInfoTranslations: Record<Languages, ContactInfoTranslation>
5662
address: 'Adresse',
5763
street: 'Straße',
5864
houseNumber: 'Hausnummer',
59-
houseNumberAdditional: 'Hausnummer Zusatz',
65+
houseNumberAdditional: 'Zusatz',
6066
postalCode: 'Postleitzahl',
6167
city: 'Stadt',
6268
country: 'Land',
6369
save: 'Speichern'
6470
}
6571
}
6672

67-
type ContactInfoServerSideProps = {
73+
type SettingsServerSideProps = {
6874
jsonFeed: unknown,
6975
}
7076

71-
const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactInfoServerSideProps>> = ({ overwriteTranslation }) => {
72-
const translation = useTranslation(defaultContactInfoTranslations, overwriteTranslation)
77+
const Settings: NextPage<PropsForTranslation<SettingsTranslation, SettingsServerSideProps>> = ({ overwriteTranslation }) => {
78+
const translation = useTranslation(defaultSettingsTranslations, overwriteTranslation)
7379
const [currentData, setcurrentData] = useState<Customer>()
7480
const { data, isError, isLoading } = useCustomerMyselfQuery()
7581
const customerUpdate = useCustomerUpdateMutation()
@@ -80,11 +86,13 @@ const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactI
8086

8187
// TODO do input validation
8288
return (
83-
<Page pageTitle={titleWrapper(translation.contactInfo)} mainContainerClassName={tw('min-h-[auto] pb-6')}>
84-
<Section titleText={translation.contactInfo}>
89+
<Page pageTitle={titleWrapper(translation.settings)} mainContainerClassName={tw('min-h-[auto] pb-6')}>
90+
<Section titleText={translation.settings}>
8591
<LoadingAndErrorComponent isLoading={isLoading} hasError={isError} minimumLoadingDuration={200}>
8692
{!!currentData && (
87-
<div className={tw('flex flex-col gap-y-4 max-w-[700px]')}>
93+
<div className={tw('flex flex-col gap-y-1 max-w-[700px]')}>
94+
<span>{translation.settingsDescription}</span>
95+
<h3 className={tw('font-space font-bold text-2xl')}>{translation.contactInfo}</h3>
8896
<Input
8997
value={currentData.name}
9098
onChange={name => setcurrentData({ ...currentData, name })}
@@ -100,14 +108,14 @@ const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactI
100108
onChange={phoneNumber => setcurrentData({ ...currentData, phoneNumber })}
101109
label={{ name: translation.phone }}
102110
/>
103-
<div className={tw('flex flex-col gap-y-4')}>
104-
<h3 className={tw('font-space font-bold text-lg')}>{translation.address}</h3>
111+
<div className={tw('flex flex-col gap-y-1')}>
112+
<h4 className={tw('font-space font-bold text-lg')}>{translation.address}</h4>
105113
<Input
106114
value={currentData.address.country ?? ''}
107115
onChange={country => setcurrentData({ ...currentData, address: { ...currentData.address, country } })}
108116
label={{ name: translation.country }}
109117
/>
110-
<div className={tw('flex flex-row gap-x-2')}>
118+
<div className={tw('flex flex-row gap-x-1')}>
111119
<Input
112120
value={currentData.address.city ?? ''}
113121
onChange={city => setcurrentData({ ...currentData, address: { ...currentData.address, city } })}
@@ -123,7 +131,7 @@ const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactI
123131
containerClassName={tw('max-w-[180px]')}
124132
/>
125133
</div>
126-
<div className={tw('flex flex-row gap-x-2')}>
134+
<div className={tw('flex flex-row gap-x-1')}>
127135
<Input
128136
value={currentData.address.street ?? ''}
129137
onChange={street => setcurrentData({
@@ -151,8 +159,8 @@ const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactI
151159
containerClassName={tw('max-w-[180px]')}
152160
/>
153161
</div>
154-
<div className={tw('flex flex-col gap-y-4')}>
155-
<h3 className={tw('font-space font-bold text-lg')}>{translation.additionalInformation}</h3>
162+
<div className={tw('flex flex-col gap-y-1')}>
163+
<h4 className={tw('font-space font-bold text-lg')}>{translation.additionalInformation}</h4>
156164
<Input
157165
value={currentData.websiteURL ?? ''}
158166
onChange={websiteURL => setcurrentData({ ...currentData, websiteURL })}
@@ -172,4 +180,4 @@ const ContactInfo: NextPage<PropsForTranslation<ContactInfoTranslation, ContactI
172180
)
173181
}
174182

175-
export default ContactInfo
183+
export default Settings

0 commit comments

Comments
 (0)