Skip to content

Commit 60290d7

Browse files
authored
Remove View all link in Trending section (#8763)
1 parent 8d0c76e commit 60290d7

File tree

1 file changed

+14
-14
lines changed
  • app/lib/frontend/templates/views/landing

1 file changed

+14
-14
lines changed

app/lib/frontend/templates/views/landing/page.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ d.Node landingPageNode({
4848
title: 'Trending packages',
4949
info: d.text('Top trending packages in the last 30 days'),
5050
content: miniListNode('most-trending', trendingPackages!),
51-
viewAllUrl: urls.listingByTrending(),
5251
viewAllEvent: 'landing-trending-view-all',
5352
viewAllTitle: 'Search trending packages',
5453
)
@@ -126,12 +125,12 @@ d.Node _block({
126125
required String title,
127126
required d.Node info,
128127
required d.Node content,
129-
required String viewAllUrl,
128+
String? viewAllUrl,
130129
required String viewAllEvent,
131130
String viewAllLabel = 'View all',
132131
required String viewAllTitle,
133132
}) {
134-
final isExternalUrl = !viewAllUrl.startsWith('/');
133+
final isExternalUrl = viewAllUrl != null && !viewAllUrl.startsWith('/');
135134
return d.div(
136135
classes: ['home-block', 'home-block-$shortId'],
137136
children: [
@@ -148,18 +147,19 @@ d.Node _block({
148147
d.h1(classes: ['home-block-title'], text: title),
149148
d.p(classes: ['home-block-context-info'], child: info),
150149
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+
),
161162
),
162-
),
163163
],
164164
),
165165
// image: after content

0 commit comments

Comments
 (0)