@@ -13,6 +13,7 @@ import { useTranslation } from '@ifrc-go/ui/hooks';
1313import { numericIdSelector } from '@ifrc-go/ui/utils' ;
1414import {
1515 _cs ,
16+ compareNumber ,
1617 isFalsyString ,
1718 isNotDefined ,
1819 listToGroupList ,
@@ -149,18 +150,24 @@ function ComponentInput(props: Props) {
149150
150151 const groupedQuestions = useMemo (
151152 ( ) => listToGroupList (
152- questions ,
153+ questions ?. sort ( ( q1 , q2 ) => compareNumber ( q1 . question_num , q2 . question_num ) ) ,
153154 ( question ) => question . question_group ?? NO_GROUP ,
154155 ) ,
155156 [ questions ] ,
156157 ) ;
157158
158- const groupedQuestionList = mapToList (
159- groupedQuestions ,
160- ( questionsInGroup , groupId ) => ( {
161- groupId : Number ( groupId ) ,
162- questionsInGroup,
163- } ) ,
159+ const groupedQuestionList = useMemo (
160+ ( ) => mapToList (
161+ groupedQuestions ,
162+ ( questionsInGroup , groupId ) => ( {
163+ groupId : Number ( groupId ) ,
164+ questionsInGroup,
165+ } ) ,
166+ ) ?. sort ( ( g1 , g2 ) => compareNumber (
167+ g1 . questionsInGroup [ 0 ] . question_num ,
168+ g2 . questionsInGroup [ 0 ] . question_num ,
169+ ) ) ,
170+ [ groupedQuestions ] ,
164171 ) ;
165172
166173 if ( isNotDefined ( componentNumber ) ) {
@@ -272,6 +279,7 @@ function ComponentInput(props: Props) {
272279 />
273280 { epi_considerations && (
274281 < InputSection
282+ withoutPadding
275283 title = { strings . epiConsiderationTitle }
276284 description = { (
277285 < ul className = { styles . description } >
@@ -291,11 +299,13 @@ function ComponentInput(props: Props) {
291299 onChange = { setFieldValue }
292300 disabled = { disabled }
293301 readOnly = { readOnly }
302+ rows = { 8 }
294303 />
295304 </ InputSection >
296305 ) }
297306 { urban_considerations && (
298307 < InputSection
308+ withoutPadding
299309 title = { strings . urbanConsiderationTitle }
300310 description = { strings . urbanConsiderationDescription }
301311 >
@@ -306,11 +316,13 @@ function ComponentInput(props: Props) {
306316 onChange = { setFieldValue }
307317 disabled = { disabled }
308318 readOnly = { readOnly }
319+ rows = { 8 }
309320 />
310321 </ InputSection >
311322 ) }
312323 { climate_environmental_considerations && (
313324 < InputSection
325+ withoutPadding
314326 title = { strings . environmentConsiderationTitle }
315327 description = { (
316328 < ul className = { styles . description } >
@@ -330,6 +342,7 @@ function ComponentInput(props: Props) {
330342 onChange = { setFieldValue }
331343 disabled = { disabled }
332344 readOnly = { readOnly }
345+ rows = { 8 }
333346 />
334347 </ InputSection >
335348 ) }
0 commit comments