@@ -16,14 +16,7 @@ type Props = {
16
16
17
17
export const FrontPageAreaNavigation = ( { content } : Props ) => {
18
18
const { data } = content ;
19
- const {
20
- areasHeader,
21
- areasRefs = [ ] ,
22
- situationsRefs = [ ] ,
23
- frontPageNestedRefs = [ ] ,
24
- navigationRefs = [ ] ,
25
- audience,
26
- } = data ;
19
+ const { areasHeader, navigationRefs = [ ] , audience } = data ;
27
20
28
21
const getCardType = ( audience : Audience ) => {
29
22
if ( audience === Audience . EMPLOYER ) {
@@ -52,12 +45,6 @@ export const FrontPageAreaNavigation = ({ content }: Props) => {
52
45
53
46
const cardType = getCardType ( getAudience ( audience ) ) ;
54
47
55
- const numberOfCards =
56
- areasRefs . length +
57
- frontPageNestedRefs . length +
58
- situationsRefs . length +
59
- navigationRefs . length ;
60
-
61
48
return (
62
49
< div
63
50
className = { classNames ( style . wrapper , style [ getAudience ( audience ) ] ) }
@@ -74,49 +61,11 @@ export const FrontPageAreaNavigation = ({ content }: Props) => {
74
61
< ul
75
62
className = { classNames (
76
63
style . cards ,
77
- numberOfCards === 2 ? style . twocols : style . threecols
64
+ navigationRefs . length === 2
65
+ ? style . twocols
66
+ : style . threecols
78
67
) }
79
68
>
80
- { areasRefs . map ( ( areaContent ) => (
81
- < li key = { areaContent . _id } >
82
- < AreaCard
83
- path = { areaContent . _path }
84
- title = { areaContent . data . header }
85
- area = { areaContent . data . area }
86
- linkGroup = { areasHeader }
87
- />
88
- </ li >
89
- ) ) }
90
- { frontPageNestedRefs . map ( ( content ) => (
91
- < li key = { content . _id } >
92
- < FrontPageCard
93
- illustration = { content . data ?. illustration }
94
- path = { content . _path }
95
- title = {
96
- content . data ?. title || content . displayName
97
- }
98
- type = { cardType }
99
- />
100
- </ li >
101
- ) ) }
102
- { situationsRefs . map ( ( situationPage ) => {
103
- return (
104
- < li key = { situationPage . _id } >
105
- < FrontPageCard
106
- illustration = {
107
- situationPage . data ?. illustration
108
- }
109
- path = { situationPage . _path }
110
- title = {
111
- situationPage . data ?. title ||
112
- situationPage . displayName
113
- }
114
- type = { cardType }
115
- />
116
- </ li >
117
- ) ;
118
- } ) }
119
-
120
69
{ navigationRefs . map ( ( page ) => {
121
70
if ( page . type === ContentType . AreaPage ) {
122
71
return (
0 commit comments