This repository has been archived by the owner on Jul 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* show tag buttons * working tag filter * add tags everywhere hopefully * adjust style
- Loading branch information
1 parent
585ff14
commit da03c10
Showing
9 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
// Secret is inserted here on a pre-build script. Don't tell anyone! | ||
export const analyticsApiSecret = ''; | ||
export const analyticsApiSecret = 'undefined'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './mod-dependencies-state'; | ||
export * from './mod-categories-state'; | ||
export * from './mod-filter-state'; | ||
export * from './mod-tags-state'; | ||
export * from './mod-progress-state'; | ||
export * from './mods-state'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { selector, atom } from 'recoil'; | ||
|
||
import { remoteModList } from './mods-state'; | ||
|
||
export const modTagsSelectionState = atom<Set<string>>({ | ||
key: 'ModTagsSelection', | ||
default: new Set(), | ||
}); | ||
|
||
export const modTagsListState = selector({ | ||
key: 'ModTags', | ||
get: ({ get }) => { | ||
const mods = get(remoteModList); | ||
const tags: Set<string> = new Set<string>(); | ||
const counts: Record<string, number> = {}; | ||
|
||
if (!mods) { | ||
return []; | ||
} | ||
|
||
mods.forEach((mod) => { | ||
mod.tags.forEach((tag) => { | ||
tags.add(tag); | ||
counts[tag] = (counts[tag] ?? 0) + 1; | ||
}); | ||
}); | ||
|
||
return Array.from(tags).sort( | ||
(tagA, tagB) => (counts[tagB] ?? 0) - (counts[tagA] ?? 0) | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters