mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
exclude by rank (#132)
* exclude by rank * Add a description of the ranks
This commit is contained in:
parent
3217ae3827
commit
6fa963b76e
2 changed files with 13 additions and 0 deletions
|
|
@ -140,6 +140,13 @@ If you want to specify multiple ranks.
|
||||||
https://github-profile-trophy.vercel.app/?username=ryo-ma&rank=S,AAA
|
https://github-profile-trophy.vercel.app/?username=ryo-ma&rank=S,AAA
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also exclude ranks.
|
||||||
|
|
||||||
|
```
|
||||||
|
https://github-profile-trophy.vercel.app/?username=ryo-ma&rank=-C,-B
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Specify the maximum row & column size
|
## Specify the maximum row & column size
|
||||||
|
|
||||||
You can specify the maximum row and column size.
|
You can specify the maximum row and column size.
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,12 @@ export class TrophyList {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
filterByRanks(ranks: Array<string>) {
|
filterByRanks(ranks: Array<string>) {
|
||||||
|
if (ranks.filter((rank) => rank.includes("-")).length !== 0) {
|
||||||
|
this.trophies = this.trophies.filter((trophy) =>
|
||||||
|
!ranks.map(rank => rank.substring(1)).includes(trophy.rank)
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.trophies = this.trophies.filter((trophy) =>
|
this.trophies = this.trophies.filter((trophy) =>
|
||||||
ranks.includes(trophy.rank)
|
ranks.includes(trophy.rank)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue