forked from passportxyz/passport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: stamp filtering (passportxyz#766)
* add stamp filtering via GET parameter * get query string via nextjs router hook * update getStampProviderFilters function * hide hide stamps in StampSelector * add STAMP_FILTERS + getFilterName * improve getStampProviderFilters * display filterName + add link to remove * fix(app): mock next router and lint --------- Co-authored-by: schultztimothy <[email protected]>
- Loading branch information
1 parent
f62e349
commit 9301788
Showing
10 changed files
with
112 additions
and
1 deletion.
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
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export const STAMP_FILTERS: { | ||
[key: string]: { | ||
name: string; | ||
stamps: { | ||
[key: string]: string[]; | ||
}; | ||
}; | ||
} = { | ||
"bankless-academy": { | ||
name: "Bankless Academy", | ||
stamps: { | ||
Google: ["Account Name"], | ||
Ens: ["Account Name"], | ||
Poh: ["Account Name"], | ||
Twitter: ["Account Name"], | ||
Facebook: ["Account Name"], | ||
Brightid: ["Account Name"], | ||
Linkedin: ["Account Name"], | ||
Discord: ["Account Name"], | ||
}, | ||
}, | ||
}; | ||
|
||
export const getStampProviderFilters = (filter: string): any => { | ||
let stampFilters: any = false; | ||
if (Object.keys(STAMP_FILTERS).includes(filter)) { | ||
stampFilters = STAMP_FILTERS[filter].stamps; | ||
} | ||
return stampFilters; | ||
}; | ||
|
||
export const getFilterName = (filter: string): any => { | ||
let filterName: any = false; | ||
if (Object.keys(STAMP_FILTERS).includes(filter)) { | ||
filterName = STAMP_FILTERS[filter].name; | ||
} | ||
return filterName; | ||
}; |
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