File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 &--name {
2323 background : hsl (var (--hsl-b2 ));
2424 }
25+
26+ &--voted {
27+ background : hsl (var (--hsl-h1 ));
28+ color : hsl (var (--hsl-b5 ));
29+ }
2530 }
2631}
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ export default class Controller {
7272 return this . beatmaps . get ( this . currentBeatmap . mode ) ?? [ ] ;
7373 }
7474
75+ @computed
76+ get currentUserTagIds ( ) {
77+ return new Set ( this . currentBeatmap . current_user_tag_ids ) ;
78+ }
79+
7580 @computed
7681 get relatedTags ( ) {
7782 const map = new Map < number , TagJson > ( ) ;
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ export default class Info extends React.Component<Props> {
195195 </ h3 >
196196 < div className = 'beatmapset-info__tags' >
197197 { this . controller . tags . userTags . map ( ( tag ) => (
198- < UserTag key = { tag . name } tag = { tag } />
198+ < UserTag key = { tag . name } tag = { tag } voted = { this . controller . currentUserTagIds . has ( tag . id ) } />
199199 ) ) }
200200 </ div >
201201 </ div >
Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ import { TagJsonWithCount } from 'interfaces/tag-json';
55import { route } from 'laroute' ;
66import * as React from 'react' ;
77import { makeSearchQueryOption } from 'utils/beatmapset-helper' ;
8+ import { classWithModifiers } from 'utils/css' ;
89
910interface Props {
1011 tag : TagJsonWithCount ;
12+ voted : boolean ;
1113}
1214
1315export default class UserTag extends React . PureComponent < Props > {
16+ static defaultProps = {
17+ voted : false ,
18+ } ;
19+
1420 private readonly category ;
1521 private readonly name ;
1622
@@ -35,7 +41,9 @@ export default class UserTag extends React.PureComponent<Props> {
3541 >
3642 < span className = 'user-tag__item user-tag__item--category' > { this . category } </ span >
3743 < span className = 'user-tag__item user-tag__item--name' > { this . name } </ span >
38- < span className = 'user-tag__item user-tag__item--count' > { this . props . tag . count } </ span >
44+ < span className = { classWithModifiers ( 'user-tag__item' , 'count' , { voted : this . props . voted } ) } >
45+ { this . props . tag . count }
46+ </ span >
3947 </ a >
4048 ) ;
4149 }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ interface BeatmapFailTimesArray {
1414interface BeatmapJsonAvailableIncludes {
1515 beatmapset : BeatmapsetJson | null ;
1616 checksum : string | null ;
17+ current_user_tag_ids : number [ ] ;
1718 failtimes : BeatmapFailTimesArray ;
1819 max_combo : number ;
1920 owners : BeatmapOwnerJson [ ] ;
You can’t perform that action at this time.
0 commit comments