Commit 5afa13d

Anna Makarova <anna@medv.io>
2023-10-11 15:21:49
Add covid-19 badge
1 parent 52bfa33
Changed files (4)
src/all-badges/covid-19/covid-19.png
Binary file
src/all-badges/covid-19/covid-19.ts
@@ -0,0 +1,12 @@
+import { BadgePresenter, Present } from '../../badges.js'
+
+export default new (class implements BadgePresenter {
+  url = new URL(import.meta.url)
+  badges = ['covid-19'] as const
+  present: Present = (data, grant) => {
+    const date = new Date(data.user.createdAt)
+    if (date.getFullYear() < 2020) {
+      grant('covid-19', 'I rolled before Covid-19: Survivor of the Great TP Shortage')
+    }
+  }
+})()
src/all-badges/index.ts
@@ -12,4 +12,5 @@ export const allBadges = [
   await import('./fix-commit/fix-commit.js'),
   await import('./chore-commit/chore-commit.js'),
   await import('./delorean/delorean.js'),
+  await import('./covid-19/covid-19.js'),
 ] as const
README.md
@@ -49,6 +49,7 @@ Check out how these badges sparkle on [my profile](https://github.com/antonmedv)
 <img src="src/all-badges/fix-commit/fix-6+.png" alt="fix-6+" width="64">
 <img src="src/all-badges/chore-commit/chore-commit.png" alt="chore-commit" width="64">
 <img src="src/all-badges/delorean/delorean.png" alt="delorean" width="64">
+<img src="src/all-badges/covid-19/covid-19.png" alt="covid-19" width="64">
 </p>
 
 But we are planning on adding much more. **Add your own badges too**!