Skip to content

Commit

Permalink
feat: add the sponsors page (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen and LinuxSuRen committed Dec 11, 2023
1 parent 1401f2b commit a98b63c
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: pnpm install && pnpm run build
command: pnpm run dev
36 changes: 36 additions & 0 deletions src/assets/sponsors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[{
"name": "黄英男",
"source": "小宇宙",
"date": "2023-12-9",
"item": "2元"
}, {
"name": "Rick",
"source": "爱发电",
"date": "2022-02-14",
"item": "5元"
}, {
"name": "wey-gu",
"source": "爱发电",
"date": "2022-02-14",
"item": "10元"
}, {
"name": "siwei",
"source": "爱发电",
"date": "2022-02-14",
"item": "15元"
}, {
"name": "siwei",
"source": "微信",
"date": "2023-10-25",
"item": "21元"
}, {
"name": "Rick",
"source": "微信",
"date": "2023-10-25",
"item": "23元"
}, {
"name": "majingh",
"source": "微信",
"date": "2023-10-25",
"item": "23元"
}]
4 changes: 3 additions & 1 deletion src/components/app-footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
Made by
<a href="https://github.com/sxzz" target="_blank">三咲智子</a> with ❤️
</p>

<p>
<a href="/sponsors" target="_blank">Our Sponsors</a>
</p>
<p>
<a href="https://github.com/opensource-f2f" target="_blank">开源面对面</a>
&copy; 2022
Expand Down
28 changes: 28 additions & 0 deletions src/components/sponsors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script setup lang="ts">
import sponsors from '../assets/sponsors.json'
sponsors.sort((a, b) => {
return Date.parse(b.date) - Date.parse(a.date)
})
</script>

<template>
<div style="align-self: center">
<div>Sponsor list</div>

<table style="width: 600px">
<tr>
<td>捐赠人</td>
<td>时间</td>
<td>捐赠物</td>
<td>渠道</td>
</tr>
<tr v-for="sponsor in sponsors" :key="sponsor.name">
<td>{{ sponsor.name }}</td>
<td>{{ sponsor.date }}</td>
<td>{{ sponsor.item }}</td>
<td>{{ sponsor.source }}</td>
</tr>
</table>
</div>
</template>
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const routes: RouteRecordRaw[] = [
path: '/404',
component: () => import('./components/not-found.vue'),
},
{
name: 'Sponsors',
path: '/sponsors',
component: () => import('./components/sponsors.vue'),
},
]

for (const { id } of getAllEpisode()) {
Expand Down
1 change: 1 addition & 0 deletions src/typings/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ declare module '@vue/runtime-core' {
PersonList: typeof import('./../components/person-list.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Sponsors: typeof import('./../components/sponsors.vue')['default']
}
}

1 comment on commit a98b63c

@vercel
Copy link

@vercel vercel bot commented on a98b63c Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.