Skip to content

Commit eb64742

Browse files
authored
1658 change membership renewal (#1665)
* update some bits * edit email template, db schema, cron job * fix date and typo
1 parent 42b3cf7 commit eb64742

32 files changed

Lines changed: 3893 additions & 741 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ pnpm i <dep_name> -E
3030

3131
# Update all packages
3232
pnpm upgrade -L
33+
34+
# Database migration
35+
pnpm drizzle-kit pull
36+
pnpm drizzle-kit generate
37+
pnpm drizzle-kit migrate
3338
```
3439

3540
## Planned Features

declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "*.css"

pnpm-lock.yaml

Lines changed: 3304 additions & 687 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/about/clients.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import clients from "data/clients.json"
1+
import clients from "@/data/clients.json"
22

33
import { type ImageProps } from "~/lib/types"
44

src/app/about/committee.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import committee from "data/committee.json"
1+
import committee from "@/data/committee.json"
22
import Image from "next/image"
33
import * as React from "react"
44
import { siGithub } from "simple-icons"

src/app/about/sponsors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sponsors from "data/sponsors.json"
1+
import sponsors from "@/data/sponsors.json"
22

33
import { type ImageProps } from "~/lib/types"
44

src/app/create-account/loading.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const Loading = () => {
3737
<h2 className="font-semibold leading-none tracking-tight">Payment</h2>
3838
<div className="text-sm text-muted-foreground">
3939
<p>
40-
Become a paying member of Coders for Causes for just $5 a year (ends on 31st Dec{" "}
41-
{new Date().getFullYear()}). There are many benefits to becoming a member which include:
40+
Become a paying member of Coders for Causes for just $5 a year (ends one year from now). There are many
41+
benefits to becoming a member which include:
4242
</p>
4343
<ul className="list-inside list-disc">
4444
<li>discounts to paid events such as industry nights</li>

src/app/create-account/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ export default function CreateAccount() {
609609
<h2 className="font-semibold leading-none tracking-tight">Payment</h2>
610610
<div className="text-sm text-muted-foreground">
611611
<p>
612-
Become a paying member of Coders for Causes for just $5 a year (ends on 31st Dec{" "}
613-
{new Date().getFullYear()}). There are many benefits to becoming a member which include:
612+
Become a paying member of Coders for Causes for just $5 a year (ends one year from now). There are many
613+
benefits to becoming a member which include:
614614
</p>
615615
<ul className="list-inside list-disc">
616616
<li>discounts to paid events such as industry nights</li>

src/app/create-account/payment.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ const PaymentBlock = () => {
1515
<h2 className="font-semibold leading-none tracking-tight">Payment</h2>
1616
<div className="text-sm text-muted-foreground">
1717
<p>
18-
Become a paying member of Coders for Causes for just $5 a year (ends on 31st Dec{" "}
19-
{new Date().getFullYear()}
20-
). There are many benefits to becoming a member which include:
18+
Become a paying member of Coders for Causes for just $5 a year (ends one year from now). There are many
19+
benefits to becoming a member which include:
2120
</p>
2221
<ul className="list-inside list-disc">
2322
<li>discounts to paid events such as industry nights</li>

src/app/dashboard/admin/@users/table.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,24 @@ const columns = (updateRole: ({ id, role }: UpdateUserRoleFunctionProps) => void
169169
cell: (cell) => <span className="text-xs">{cell.getValue<React.ReactNode>()}</span>,
170170
accessorFn: (user) => format(user.createdAt, "Pp", { locale: enAU }),
171171
},
172+
{
173+
id: "Membership expiry",
174+
header: "Membership expiry",
175+
cell: ({ row }) => {
176+
const user = row.original
177+
if (!user.membership_expiry) {
178+
return
179+
}
180+
const isExpired = new Date(user.membership_expiry) < new Date()
181+
return (
182+
<span className={`text-xs ${isExpired ? "text-destructive" : "text-foreground"}`}>
183+
{format(user.membership_expiry, "Pp", { locale: enAU })}
184+
</span>
185+
)
186+
},
187+
accessorFn: (user) =>
188+
user.membership_expiry ? format(user.membership_expiry, "Pp", { locale: enAU }) : "No membership",
189+
},
172190
{
173191
header: "Socials",
174192
cell: ({ row }) => {

0 commit comments

Comments
 (0)