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