@@ -46,6 +46,7 @@ d.Node landingPageNode({
46
46
title: 'Trending packages' ,
47
47
info: d.text ('Top trending packages in the last 30 days' ),
48
48
content: miniListNode ('most-trending' , trendingPackages! ),
49
+ viewAllUrl: urls.listingByTrending (),
49
50
viewAllEvent: 'landing-trending-view-all' ,
50
51
viewAllTitle: 'Search trending packages' ,
51
52
)
@@ -123,12 +124,12 @@ d.Node _block({
123
124
required String title,
124
125
required d.Node info,
125
126
required d.Node content,
126
- String ? viewAllUrl,
127
+ required String viewAllUrl,
127
128
required String viewAllEvent,
128
129
String viewAllLabel = 'View all' ,
129
130
required String viewAllTitle,
130
131
}) {
131
- final isExternalUrl = viewAllUrl != null && ! viewAllUrl.startsWith ('/' );
132
+ final isExternalUrl = ! viewAllUrl.startsWith ('/' );
132
133
return d.div (
133
134
classes: ['home-block' , 'home-block-$shortId ' ],
134
135
children: [
@@ -145,19 +146,18 @@ d.Node _block({
145
146
d.h1 (classes: ['home-block-title' ], text: title),
146
147
d.p (classes: ['home-block-context-info' ], child: info),
147
148
content,
148
- if (viewAllUrl != null )
149
- d.div (
150
- classes: ['home-block-view-all' ],
151
- child: d.a (
152
- classes: ['home-block-view-all-link' ],
153
- href: viewAllUrl,
154
- target: isExternalUrl ? '_blank' : null ,
155
- rel: isExternalUrl ? 'noopener nofollow' : 'nofollow' ,
156
- text: viewAllLabel,
157
- title: viewAllTitle,
158
- attributes: {'data-ga-click-event' : viewAllEvent},
159
- ),
149
+ d.div (
150
+ classes: ['home-block-view-all' ],
151
+ child: d.a (
152
+ classes: ['home-block-view-all-link' ],
153
+ href: viewAllUrl,
154
+ target: isExternalUrl ? '_blank' : null ,
155
+ rel: isExternalUrl ? 'noopener nofollow' : 'nofollow' ,
156
+ text: viewAllLabel,
157
+ title: viewAllTitle,
158
+ attributes: {'data-ga-click-event' : viewAllEvent},
160
159
),
160
+ ),
161
161
],
162
162
),
163
163
// image: after content
0 commit comments