@@ -41,7 +41,7 @@ import useAuth from '#hooks/domain/useAuth';
4141import useTranslation from '#hooks/useTranslation' ;
4242import { getUserName } from '#utils/domain/user' ;
4343import { numericIdSelector } from '#utils/selectors' ;
44- import { getPercentage } from '#utils/common' ;
44+ import { getPercentage , joinList } from '#utils/common' ;
4545import useFilterState from '#hooks/useFilterState' ;
4646import { resolveToString } from '#utils/translation' ;
4747import { useRequest , type GoApiResponse } from '#utils/restRequest' ;
@@ -125,7 +125,7 @@ export function Component() {
125125 } ) ;
126126 } , [ handleFullScreenChange ] ) ;
127127
128- const infoBarElements = ! pending && aggregatedAppealResponse && (
128+ const keyFigures = ! pending && aggregatedAppealResponse && (
129129 < >
130130 < KeyFigure
131131 icon = { < DrefIcon /> }
@@ -202,22 +202,30 @@ export function Component() {
202202 ) ;
203203
204204 return (
205- < >
206- { isAuthenticated && (
207- < div >
205+ < Page
206+ title = { strings . homeTitle }
207+ className = { styles . home }
208+ heading = { strings . homeHeading }
209+ description = { strings . homeDescription }
210+ mainSectionClassName = { styles . content }
211+ infoContainerClassName = { styles . keyFigureList }
212+ info = { (
213+ < >
214+ { pending && < BlockLoading /> }
215+ { ! pending && keyFigures }
216+ </ >
217+ ) }
218+ beforeHeaderContent = { isAuthenticated && (
219+ < >
208220 < PageHeader
209221 heading = { resolveToString (
210222 strings . homeUserNameHeading ,
211- {
212- userName : getUserName ( userResponse ) ,
213- } ,
223+ { userName : getUserName ( userResponse ) } ,
214224 ) }
215225 />
216- < PageContainer
217- contentClassName = { styles . greetingCard }
218- >
226+ < PageContainer contentClassName = { styles . userDashContent } >
219227 < Container
220- className = { styles . operationsCard }
228+ className = { styles . operationsFollowing }
221229 heading = { strings . homeOperationFollowingHeading }
222230 withHeaderBorder
223231 footerActions = { (
@@ -228,6 +236,8 @@ export function Component() {
228236 onActivePageChange = { setPage }
229237 />
230238 ) }
239+ withInternalPadding
240+ contentViewType = "vertical"
231241 >
232242 < List
233243 className = { styles . operationsList }
@@ -241,25 +251,31 @@ export function Component() {
241251 />
242252 </ Container >
243253 < Container
244- className = { styles . operationsCard }
254+ className = { styles . quickLinks }
245255 heading = { strings . homeQuickLinksTitle }
246- childrenContainerClassName = { styles . quickCard }
256+ withInternalPadding
257+ withHeaderBorder
258+ contentViewType = "vertical"
247259 >
248260 < TextOutput
249261 label = { strings . homeYourCountryLabel }
250- valueClassName = { styles . regionCountryLinkContainer }
251- value = { userCountries ?. map ( ( country ) => (
252- < Link
253- to = "countriesLayout"
254- urlParams = { {
255- countryId : country . country ,
256- } }
257- key = { country . country }
258- withLinkIcon
259- >
260- { country . country_name }
261- </ Link >
262- ) ) }
262+ value = { userCountries && (
263+ joinList (
264+ userCountries . map ( ( country ) => (
265+ < Link
266+ to = "countriesLayout"
267+ urlParams = { {
268+ countryId : country . country ,
269+ } }
270+ key = { country . country }
271+ withUnderline
272+ >
273+ { country . country_name }
274+ </ Link >
275+ ) ) ,
276+ ', ' ,
277+ )
278+ ) }
263279 strongValue
264280 />
265281 < TextOutput
@@ -276,19 +292,21 @@ export function Component() {
276292 />
277293 < TextOutput
278294 label = { strings . homeYourRegionLabel }
279- valueClassName = { styles . regionCountryLinkContainer }
280- value = { userRegions ?. map ( ( region ) => (
281- < Link
282- key = { region . region }
283- to = "regionsLayout"
284- withLinkIcon
285- urlParams = { {
286- regionId : region . region ,
287- } }
288- >
289- { region . region_details . name }
290- </ Link >
291- ) ) }
295+ value = { userRegions && (
296+ joinList (
297+ userRegions . map ( ( region ) => (
298+ < Link
299+ key = { region . region }
300+ to = "regionsLayout"
301+ urlParams = { { regionId : region . region } }
302+ withUnderline
303+ >
304+ { region . region_details . name }
305+ </ Link >
306+ ) ) ,
307+ ', ' ,
308+ )
309+ ) }
292310 strongValue
293311 />
294312 < TextOutput
@@ -305,61 +323,47 @@ export function Component() {
305323 />
306324 </ Container >
307325 </ PageContainer >
308- </ div >
326+ </ >
309327 ) }
310- < Page
311- title = { strings . homeTitle }
312- className = { styles . home }
313- heading = { strings . homeHeading }
314- description = { strings . homeDescription }
315- mainSectionClassName = { styles . content }
316- infoContainerClassName = { styles . keyFigureList }
317- info = { (
318- < >
319- { pending && < BlockLoading /> }
320- { infoBarElements }
321- </ >
322- ) }
328+ >
329+ < HighlightedOperations variant = "global" />
330+ < ActiveOperationMap
331+ variant = "global"
332+ onPresentationModeButtonClick = { handleFullScreenToggleClick }
333+ bbox = { undefined }
334+ />
335+ < AppealsTable variant = "global" />
336+ < AppealsOverYearsChart />
337+ < div
338+ className = { _cs ( presentationMode && styles . presentationMode ) }
339+ ref = { containerRef }
323340 >
324- < HighlightedOperations variant = "global" />
325- < ActiveOperationMap
326- variant = "global"
327- onPresentationModeButtonClick = { handleFullScreenToggleClick }
328- bbox = { undefined }
329- />
330- < AppealsTable variant = "global" />
331- < AppealsOverYearsChart />
332- < div
333- className = { _cs ( presentationMode && styles . presentationMode ) }
334- ref = { containerRef }
335- >
336- { presentationMode && (
337- < Container
338- heading = { strings . fullScreenHeading }
339- actions = { (
340- < IconButton
341- name = { undefined }
342- onClick = { handleFullScreenToggleClick }
343- title = { strings . homeIconButtonLabel }
344- variant = "secondary"
345- ariaLabel = { strings . homeIconButtonLabel }
346- >
347- < CloseLineIcon />
348- </ IconButton >
349- ) }
350- headerDescriptionContainerClassName = { styles . keyFigureList }
351- headerDescription = { infoBarElements }
352- >
353- < ActiveOperationMap
354- variant = "global"
355- bbox = { undefined }
356- presentationMode
357- />
358- </ Container >
359- ) }
360- </ div >
361- </ Page >
362- </ >
341+ { presentationMode && (
342+ < Container
343+ heading = { strings . fullScreenHeading }
344+ actions = { (
345+ < IconButton
346+ name = { undefined }
347+ onClick = { handleFullScreenToggleClick }
348+ title = { strings . homeIconButtonLabel }
349+ variant = "secondary"
350+ ariaLabel = { strings . homeIconButtonLabel }
351+ >
352+ < CloseLineIcon />
353+ </ IconButton >
354+ ) }
355+ headerDescriptionContainerClassName = { styles . keyFigureList }
356+ headerDescription = { keyFigures }
357+ >
358+ < ActiveOperationMap
359+ variant = "global"
360+ bbox = { undefined }
361+ presentationMode
362+ />
363+ </ Container >
364+ ) }
365+ </ div >
366+ </ Page >
363367 ) ;
364368}
365369
0 commit comments