File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
src/ui/SurveyUnit/Communication Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,11 @@ const CommunicationConfirmation = ({
29
29
bypassReasonLabel,
30
30
} : CommunicationConfirmationProps ) => {
31
31
const address = getAddressData ( surveyUnit . address ) ;
32
- const addressLines = Object . values ( address ) . filter ( v => ! ! v ) ;
33
32
const recipient = getprivilegedPerson ( surveyUnit ) ;
34
33
const { user } = useUser ( ) ;
35
-
36
34
const userError = userSchema . safeParse ( user ) ;
37
35
const recipientError = recipientSchema . safeParse ( { ...address , ...recipient } ) ;
38
36
const communicationError = communicationSchema . safeParse ( communication ) ;
39
-
40
37
const isValid = userError . success && recipientError . success && communicationError . success ;
41
38
42
39
return (
@@ -89,12 +86,22 @@ const CommunicationConfirmation = ({
89
86
>
90
87
{ getTitle ( recipient . title ) } { recipient . firstName } { recipient . lastName }
91
88
< br />
92
- { addressLines . map ( line => (
93
- < Fragment key = { line . toString ( ) } >
94
- { line }
95
- < br />
89
+ < Fragment >
90
+ { address . streetName } < br />
91
+ </ Fragment >
92
+ { address . additionalAddress . length > 0 && (
93
+ < Fragment >
94
+ { address . additionalAddress } < br />
96
95
</ Fragment >
97
- ) ) }
96
+ ) }
97
+ { address . locality . length > 0 && (
98
+ < Fragment >
99
+ { address . locality } < br />
100
+ </ Fragment >
101
+ ) }
102
+ < Fragment >
103
+ { address . postCode } , { address . cityName }
104
+ </ Fragment >
98
105
</ Typography >
99
106
{ ! recipientError . success && < ValidationError error = { recipientError . error } mt = { 1 } /> }
100
107
</ div >
You can’t perform that action at this time.
0 commit comments