@@ -12,7 +12,9 @@ import type { Customer } from '@/api/dataclasses/customer'
1212import { tw } from '@twind/core'
1313import { 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