@@ -8,7 +8,6 @@ import { format } from "date-fns";
8
8
import { ActivityType } from "../models/Data" ;
9
9
10
10
export default function Step4 ( props : CommonFormProps ) {
11
-
12
11
const {
13
12
questionWork,
14
13
questionMeasures,
@@ -21,15 +20,15 @@ export default function Step4(props: CommonFormProps) {
21
20
prevStep,
22
21
send,
23
22
showLoader,
24
- error
23
+ error,
25
24
} = props ;
26
25
27
26
const [ isChecked , setIsChecked ] = useState < boolean > ( false ) ;
28
27
29
28
// Validators
30
29
const questionConsentValidated = ( ) => {
31
30
return questionConsent ;
32
- }
31
+ } ;
33
32
34
33
// Check form
35
34
const checkForm = ( event : FormEvent ) => {
@@ -38,74 +37,47 @@ export default function Step4(props: CommonFormProps) {
38
37
if ( questionConsentValidated ( ) ) {
39
38
send ( event ) ;
40
39
}
41
- }
40
+ } ;
42
41
42
+ //todo, oversette activityType til work
43
43
const days = [ ] ;
44
44
for ( const key in savedDates ) {
45
45
const date = format ( new Date ( + key ) , "dd.MM.yy" ) ;
46
46
const type = savedDates [ key ] . type ;
47
- const hours = type == ActivityType . WORK ? '(' + savedDates [ key ] . hours + ' t)' : '' ;
48
- const str = date + ' ' + type + ' ' + hours ;
47
+ const hours =
48
+ type == ActivityType . WORK ? "(" + savedDates [ key ] . hours + " t)" : "" ;
49
+ const str = date + " " + type + " " + hours ;
49
50
50
- days . push (
51
- < div key = { key } >
52
- { str }
53
- </ div >
54
- ) ;
51
+ days . push ( < div key = { key } > { str } </ div > ) ;
55
52
}
56
53
57
54
// Render
58
55
return (
59
56
< >
60
- < Heading level = "3" size = "large" > Arbeidssøker</ Heading >
57
+ < Heading level = "3" size = "large" >
58
+ Arbeidssøker
59
+ </ Heading >
61
60
62
61
< Spacer />
63
62
64
63
< Panel >
65
64
< Heading spacing level = "4" size = "small" >
66
- Har du vært i arbeid de siste 14 dager?
67
- </ Heading >
68
- < BodyShort >
69
- { questionWork ? 'Ja' : 'Nei' }
70
- </ BodyShort >
71
- </ Panel >
72
- < Panel >
73
- < Heading spacing level = "4" size = "small" >
74
- Har du deltatt på tiltak, kurs eller utdanning?
75
- </ Heading >
76
- < BodyShort >
77
- { questionMeasures ? 'Ja' : 'Nei' }
78
- </ BodyShort >
79
- </ Panel >
80
- < Panel >
81
- < Heading spacing level = "4" size = "small" >
82
- Har du vært syk?
83
- </ Heading >
84
- < BodyShort >
85
- { questionIllness ? 'Ja' : 'Nei' }
86
- </ BodyShort >
87
- </ Panel >
88
- < Panel >
89
- < Heading spacing level = "4" size = "small" >
90
- Har du hatt ferie eller annet fravær?
65
+ Har du vært i aktivitet de siste 14 dager?
91
66
</ Heading >
92
- < BodyShort >
93
- { questionVacation ? 'Ja' : 'Nei' }
94
- </ BodyShort >
67
+ < BodyShort > { questionWork ? "Ja" : "Nei" } </ BodyShort >
95
68
</ Panel >
96
69
< Panel >
97
70
< Heading spacing level = "4" size = "small" >
98
71
Registrerte dager
99
72
</ Heading >
100
- { days }
73
+ { days }
101
74
</ Panel >
102
75
< Panel >
103
76
< Heading spacing level = "4" size = "small" >
104
- Ønsker du fortsatt å være registrert hos NAV som arbeidssøker de neste 14 dager?
77
+ Ønsker du fortsatt å være registrert hos NAV som arbeidssøker de neste
78
+ 14 dager?
105
79
</ Heading >
106
- < BodyShort >
107
- { questionProceed ? 'Ja' : 'Nei' }
108
- </ BodyShort >
80
+ < BodyShort > { questionProceed ? "Ja" : "Nei" } </ BodyShort >
109
81
</ Panel >
110
82
111
83
< Spacer />
@@ -114,21 +86,27 @@ export default function Step4(props: CommonFormProps) {
114
86
label = "Ja, jeg samtykker."
115
87
checked = { questionConsent }
116
88
onChange = { ( ) => setQuestionConsent ( ( x ) => ! x ) }
117
- error = { isChecked && ! questionConsentValidated ( ) && "Du må samtykke før du kan fortsette." }
89
+ error = {
90
+ isChecked &&
91
+ ! questionConsentValidated ( ) &&
92
+ "Du må samtykke før du kan fortsette."
93
+ }
118
94
>
119
- For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
120
- om deg.
95
+ For å komme videre må du gi oss lov til å hente inn og bruke
96
+ opplysninger om deg.
121
97
</ ConfirmationPanel >
122
98
123
99
< Spacer />
124
100
125
101
< Error showError = { ! ! error } error = { error } />
126
102
127
- < NavPanelWithButtons backText = "Forrige steg"
128
- backOnClick = { prevStep }
129
- nextText = "Send"
130
- nextOnClick = { checkForm }
131
- showLoader = { showLoader } />
103
+ < NavPanelWithButtons
104
+ backText = "Forrige steg"
105
+ backOnClick = { prevStep }
106
+ nextText = "Send"
107
+ nextOnClick = { checkForm }
108
+ showLoader = { showLoader }
109
+ />
132
110
</ >
133
111
) ;
134
112
}
0 commit comments