Skip to content

Commit 7b4cfaf

Browse files
authored
MBS-11525: Link to downvoted per-entity list when seeing downvotes
If the user is in a downvotes page and clicks "See all works" or whatever, they are looking for all *downvoted* works.
1 parent 7e83147 commit 7b4cfaf

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

root/components/TagEntitiesList.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ const TagEntitiesList = ({
6363
entityType: string,
6464
title: string,
6565
seeAllMessage: $Call<typeof N_ln, string, string>,
66+
showDownvoted: boolean,
6667
) => {
6768
const tags = taggedEntities[entityType];
6869

6970
if (!tags || !tags.count) {
7071
return null;
7172
}
7273

73-
const url = ENTITIES[entityType].url;
74+
const url = showDownvoted
75+
? ENTITIES[entityType].url + '?show_downvoted=1'
76+
: ENTITIES[entityType].url;
77+
7478

7579
return (
7680
<React.Fragment key={entityType}>
@@ -154,47 +158,47 @@ const TagEntitiesList = ({
154158
{buildTagEntitiesListSection('area', l('Areas'), N_ln(
155159
'See all {num} areas',
156160
'See all {num} areas',
157-
))}
161+
), showDownvoted)}
158162
{buildTagEntitiesListSection('artist', l('Artists'), N_ln(
159163
'See all {num} artists',
160164
'See all {num} artists',
161-
))}
165+
), showDownvoted)}
162166
{buildTagEntitiesListSection('event', l('Events'), N_ln(
163167
'See all {num} events',
164168
'See all {num} events',
165-
))}
169+
), showDownvoted)}
166170
{buildTagEntitiesListSection('instrument', l('Instruments'), N_ln(
167171
'See all {num} instruments',
168172
'See all {num} instruments',
169-
))}
173+
), showDownvoted)}
170174
{buildTagEntitiesListSection('label', l('Labels'), N_ln(
171175
'See all {num} labels',
172176
'See all {num} labels',
173-
))}
177+
), showDownvoted)}
174178
{buildTagEntitiesListSection('place', l('Places'), N_ln(
175179
'See all {num} places',
176180
'See all {num} places',
177-
))}
181+
), showDownvoted)}
178182
{buildTagEntitiesListSection('release_group', l('Release Groups'), N_ln(
179183
'See all {num} release groups',
180184
'See all {num} release groups',
181-
))}
185+
), showDownvoted)}
182186
{buildTagEntitiesListSection('release', l('Releases'), N_ln(
183187
'See all {num} releases',
184188
'See all {num} releases',
185-
))}
189+
), showDownvoted)}
186190
{buildTagEntitiesListSection('recording', l('Recordings'), N_ln(
187191
'See all {num} recordings',
188192
'See all {num} recordings',
189-
))}
193+
), showDownvoted)}
190194
{buildTagEntitiesListSection('series', l('Series'), N_ln(
191195
'See all {num} series',
192196
'See all {num} series',
193-
))}
197+
), showDownvoted)}
194198
{buildTagEntitiesListSection('work', l('Works'), N_ln(
195199
'See all {num} works',
196200
'See all {num} works',
197-
))}
201+
), showDownvoted)}
198202
</>
199203
);
200204
};

0 commit comments

Comments
 (0)