51 Commits

Author SHA1 Message Date
c9258b16d8 chore(deps): update actions/setup-node action to v5
All checks were successful
Check / Lint and Check (pull_request) Successful in 1m0s
Check / Lint and Check (push) Successful in 25s
2025-09-06 00:00:50 +00:00
f27c23cde4 Update event-dates.json (#13)
All checks were successful
Check / Lint and Check (push) Successful in 28s
Changed cut-off to 23:00

Reviewed-on: #13
Co-authored-by: harry <harry@noreply-git@schulze.network>
Co-committed-by: harry <harry@noreply-git@schulze.network>
2025-09-01 12:50:58 +02:00
b24c7a2169 fix(deps): update dependency lucide-react to ^0.542.0
All checks were successful
Check / Lint and Check (push) Successful in 25s
2025-08-30 05:00:44 +00:00
ded9a26818 chore(deps): update dependency @types/node to v22.18.0
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-08-30 04:00:53 +00:00
48e39f5add fix(deps): update nextjs monorepo to v15.5.2
All checks were successful
Check / Lint and Check (push) Successful in 27s
2025-08-30 03:00:52 +00:00
e16ad7619b fix(deps): update dependency postcss-preset-env to v10.3.1
All checks were successful
Check / Lint and Check (push) Successful in 24s
2025-08-30 02:00:54 +00:00
7f61fd8ba1 fix(deps): update dependency zod to v4.1.5
All checks were successful
Check / Lint and Check (push) Successful in 2m54s
2025-08-30 01:00:51 +00:00
313548166d chore(deps): update react monorepo
All checks were successful
Check / Lint and Check (push) Successful in 43s
2025-08-30 00:00:34 +00:00
c2dbbb0df1 fix(deps): update dependency zod to v4.1.1
All checks were successful
Check / Lint and Check (push) Successful in 30s
2025-08-24 07:00:44 +00:00
d136e4463b fix(deps): update dependency zod to v4.1.0
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-08-23 08:01:01 +00:00
c81cbdc026 fix(deps): update nextjs monorepo to v15.5.0
All checks were successful
Check / Lint and Check (push) Successful in 28s
2025-08-23 07:00:58 +00:00
9f2d56332b fix(deps): update dependency react-day-picker to v9.9.0
All checks were successful
Check / Lint and Check (push) Successful in 27s
2025-08-23 06:00:53 +00:00
1764e96d64 fix(deps): update dependency postcss-preset-env to v10.3.0
All checks were successful
Check / Lint and Check (push) Successful in 30s
2025-08-23 05:00:50 +00:00
9e8adcd34e fix(deps): update dependency lucide-react to ^0.541.0
All checks were successful
Check / Lint and Check (push) Successful in 29s
2025-08-23 04:00:51 +00:00
eaebac6c2f chore(deps): update pnpm to v10.15.0
All checks were successful
Check / Lint and Check (push) Successful in 32s
2025-08-23 03:00:42 +00:00
697edf5372 chore(deps): update dependency eslint to v9.34.0
All checks were successful
Check / Lint and Check (push) Successful in 29s
2025-08-23 02:00:57 +00:00
f45c18eb30 fix(deps): update dependency cssnano to v7.1.1
All checks were successful
Check / Lint and Check (push) Successful in 2m16s
2025-08-23 01:01:00 +00:00
007b435306 chore(deps): update dependency @types/react to v19.1.11
All checks were successful
Check / Lint and Check (push) Successful in 37s
2025-08-23 00:00:43 +00:00
9571e08478 fix(deps): update react monorepo
All checks were successful
Check / Lint and Check (push) Successful in 1m27s
2025-08-16 11:01:53 +00:00
206d725d61 fix(deps): update nextjs monorepo to v15.4.6
All checks were successful
Check / Lint and Check (push) Successful in 1m5s
2025-08-16 10:30:49 +00:00
d998f2b751 fix(deps): update radix-ui-primitives monorepo
All checks were successful
Check / Lint and Check (push) Successful in 55s
2025-08-16 04:01:43 +00:00
21c73ba8cf chore(deps): update tailwindcss monorepo to v4.1.12
All checks were successful
Check / Lint and Check (push) Successful in 50s
2025-08-16 03:01:23 +00:00
a4ba63f708 chore(deps): update dependency turbo to v2.5.6
All checks were successful
Check / Lint and Check (push) Successful in 51s
2025-08-16 02:01:27 +00:00
6b2fc6b859 chore(deps): update dependency @types/node to v22.17.2
All checks were successful
Check / Lint and Check (push) Successful in 1m3s
2025-08-16 01:01:37 +00:00
f3d85c5214 chore(deps): update actions/checkout digest to 08eba0b
All checks were successful
Check / Lint and Check (push) Successful in 3m28s
2025-08-16 00:00:52 +00:00
7b9b422c64 fix(deps): update dependency zod to v4.0.17
All checks were successful
Check / Lint and Check (push) Successful in 44s
2025-08-09 18:01:17 +00:00
0f48d29deb fix(deps): update dependency lucide-react to ^0.539.0
All checks were successful
Check / Lint and Check (push) Successful in 44s
2025-08-09 03:02:17 +00:00
9ad256fce6 chore(deps): update dependency eslint to v9.33.0
All checks were successful
Check / Lint and Check (push) Successful in 49s
2025-08-09 02:02:08 +00:00
53e9b1275d fix(deps): update dependency zod to v4.0.16
All checks were successful
Check / Lint and Check (push) Successful in 48s
2025-08-09 01:01:37 +00:00
f9b641fa88 chore(deps): update dependency @types/node to v22.17.1
All checks were successful
Check / Lint and Check (push) Successful in 49s
2025-08-09 00:01:16 +00:00
84a1e4b6a6 chore(deps): update dependency eslint-config-next to v15.4.5
All checks were successful
Check / Lint and Check (push) Successful in 48s
2025-08-05 14:01:07 +00:00
cb8abc71dd fix(deps): update nextjs monorepo to v15.4.5
All checks were successful
Check / Lint and Check (push) Successful in 41s
2025-08-05 13:01:09 +00:00
f39c897e7a fix(deps): update dependency react-hook-form to v7.62.0
All checks were successful
Check / Lint and Check (push) Successful in 52s
2025-08-02 06:02:18 +00:00
a8aededdb2 fix(deps): update dependency lucide-react to ^0.536.0
All checks were successful
Check / Lint and Check (push) Successful in 54s
2025-08-02 05:02:15 +00:00
251f94c6bc chore(deps): update pnpm to v10.14.0
All checks were successful
Check / Lint and Check (push) Successful in 46s
2025-08-02 04:02:10 +00:00
3353fd353e chore(deps): update dependency typescript to v5.9.2
All checks were successful
Check / Lint and Check (push) Successful in 57s
2025-08-02 03:04:49 +00:00
3ea909f9b9 chore(deps): update dependency @types/node to v22.17.0
All checks were successful
Check / Lint and Check (push) Successful in 58s
2025-08-02 02:11:43 +00:00
579bc0366d fix(deps): update dependency zod to v4.0.14
All checks were successful
Check / Lint and Check (push) Successful in 52s
2025-08-02 01:01:38 +00:00
6776b44704 fix(deps): update dependency @hookform/resolvers to v5.2.1
All checks were successful
Check / Lint and Check (push) Successful in 55s
2025-08-02 00:01:11 +00:00
5a33344ed9 fix(deps): update dependency lucide-react to ^0.526.0
All checks were successful
Check / Lint and Check (push) Successful in 42s
2025-07-26 20:01:19 +00:00
2a371cbaaf fix(deps): update dependency react-day-picker to v9.8.1
All checks were successful
Check / Lint and Check (push) Successful in 56s
2025-07-26 14:01:12 +00:00
17a8e8b422 fix(deps): update dependency react-hook-form to v7.61.1
All checks were successful
Check / Lint and Check (push) Successful in 54s
2025-07-26 03:01:52 +00:00
f844b9da61 fix(deps): update dependency @hookform/resolvers to v5.2.0
All checks were successful
Check / Lint and Check (push) Successful in 49s
2025-07-26 02:01:49 +00:00
aec2d14a90 chore(deps): update dependency eslint to v9.32.0
All checks were successful
Check / Lint and Check (push) Successful in 46s
2025-07-26 01:01:50 +00:00
91f2a8e316 fix(deps): update dependency zod to v4.0.10
All checks were successful
Check / Lint and Check (push) Successful in 1m23s
2025-07-26 00:01:08 +00:00
a6245ea2f4 chore(deps): update dependency turbo to v2.5.5
All checks were successful
Check / Lint and Check (push) Successful in 52s
2025-07-19 02:01:14 +00:00
69d435b8e2 chore(deps): update dependency @types/node to v22.16.5
All checks were successful
Check / Lint and Check (push) Successful in 58s
2025-07-19 01:01:29 +00:00
5f206b8149 chore(deps): update dependency eslint-config-prettier to v10.1.8
All checks were successful
Check / Lint and Check (push) Successful in 53s
2025-07-19 00:01:09 +00:00
bd2ddd9bb6 fix misc issues, upgrade
All checks were successful
Check / Lint and Check (push) Successful in 1m38s
2025-07-15 17:33:11 +02:00
358dc77e5a disable sign-up on event day
Some checks failed
Check / Lint and Check (push) Failing after 30s
2025-07-15 16:28:02 +02:00
1108a66378 nextjs upgrade 2025-07-15 15:12:17 +02:00
10 changed files with 1591 additions and 1253 deletions

View File

@@ -13,13 +13,13 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4 uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with: with:
node-version: 22 node-version: 22
cache: "pnpm" cache: "pnpm"

44
EVENT_DATES_GUIDE.md Normal file
View File

@@ -0,0 +1,44 @@
# Event Dates Management Guide
## How to Block Sign-ups on Event Days
The sign-up form automatically closes at 3pm on specified event dates to prevent last-minute registrations.
### Managing Event Dates
1. Open the `event-dates.json` file in the project root
2. Add or remove dates in the `eventDates` array
3. Use the format `YYYY-MM-DD` (e.g., "2024-12-25" for December 25, 2024)
### Example Configuration
```json
{
"eventDates": ["2025-09-05", "1999-01-01"],
"cutoffTime": "15:00",
"message": "Sign-ups are closed for today's event. Please come back tomorrow."
}
```
### Important Notes
- The cutoff time is set to 3pm (15:00) by default
- Sign-ups will automatically reopen at midnight after an event day
- Users will see a friendly message when sign-ups are closed
- The time zone follows the server's local time
### Adding New Event Dates
Simply add a new date to the array:
```json
"eventDates": [
"2024-12-25",
"2024-12-31",
"2025-01-15",
"2025-02-14",
"2025-03-20" // <- New date added
]
```
Remember to save the file after making changes!

View File

@@ -14,6 +14,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { signupFormSubmit } from "@/lib/actions"; import { signupFormSubmit } from "@/lib/actions";
import { useState } from "react"; import { useState } from "react";
import { isSignupBlocked } from "@/lib/signup-time-check";
export const signupFormSchema = z.object({ export const signupFormSchema = z.object({
name: z.string().min(2, { error: "Name is required" }).max(50, { error: "Name is too long" }), name: z.string().min(2, { error: "Name is required" }).max(50, { error: "Name is too long" }),
@@ -26,6 +27,8 @@ export const oldestDate = new Date(new Date().setFullYear(new Date().getFullYear
export default function SignUp() { export default function SignUp() {
const [submitted, setSubmitted] = useState(false); const [submitted, setSubmitted] = useState(false);
const [response, setResponse] = useState<string | null>(null); const [response, setResponse] = useState<string | null>(null);
const signupStatus = isSignupBlocked();
const form = useForm<z.infer<typeof signupFormSchema>>({ const form = useForm<z.infer<typeof signupFormSchema>>({
resolver: zodResolver(signupFormSchema), resolver: zodResolver(signupFormSchema),
defaultValues: { defaultValues: {
@@ -35,6 +38,12 @@ export default function SignUp() {
}, },
}); });
async function onSubmit(values: z.infer<typeof signupFormSchema>) { async function onSubmit(values: z.infer<typeof signupFormSchema>) {
// Double-check signup isn't blocked before submitting
const currentStatus = isSignupBlocked();
if (currentStatus.blocked) {
setResponse(currentStatus.message || "Sign-ups are currently closed.");
return;
}
setSubmitted(true); setSubmitted(true);
setResponse(await signupFormSubmit(values)); setResponse(await signupFormSubmit(values));
} }
@@ -109,12 +118,22 @@ export default function SignUp() {
</FormItem> </FormItem>
)} )}
/> />
<Button type="submit" disabled={submitted}> <Button type="submit" disabled={submitted || signupStatus.blocked}>
Submit Submit
</Button> </Button>
</form> </form>
</Form> </Form>
); );
} }
// If signup is blocked, show the message
if (signupStatus.blocked && !response) {
return (
<div className="rounded-lg border bg-orange-50 p-6 text-center">
<p className="text-lg font-semibold text-orange-900 mb-2">Sign-ups Temporarily Closed</p>
<p className="text-orange-800">{signupStatus.message}</p>
</div>
);
}
return response ?? SignupForm(); return response ?? SignupForm();
} }

View File

@@ -2,23 +2,17 @@ import * as React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {} function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
const Input = React.forwardRef<HTMLInputElement, InputProps>( <input
({ className, type, ...props }, ref) => { type={type}
return ( data-slot="input"
<input className={cn(
type={type} "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className={cn( className
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", )}
className {...props}
)} />
ref={ref} );
{...props} }
/>
);
}
);
Input.displayName = "Input";
export { Input }; export { Input };

7
event-dates.json Normal file
View File

@@ -0,0 +1,7 @@
{
"eventDates": ["2025-09-05", "1999-01-01"],
"cutoffTime": "23:00",
"message": "Sign-ups are closed for today's event. Please come back tomorrow.",
"internalComment": "Add event dates in YYYY-MM-DD format. Signups will be disabled after 11pm (23:00) on these dates by default."
}

View File

@@ -29,7 +29,7 @@ async function listmonk(data: listmonkData): Promise<string> {
return "An error occurred or this email is already subscribed."; return "An error occurred or this email is already subscribed.";
} }
return "Thanks for signing up! Please check your email for a confirmation."; return "Thanks for signing up! Please check your email for a confirmation.";
} catch (error) { } catch {
return "An error occurred while trying to sign up. Please try again."; return "An error occurred while trying to sign up. Please try again.";
} }
} }

23
lib/signup-time-check.ts Normal file
View File

@@ -0,0 +1,23 @@
import eventConfig from "@/event-dates.json";
export function isSignupBlocked(): { blocked: boolean; message?: string } {
const now = new Date();
const currentDate = now.toISOString().split("T")[0]; // YYYY-MM-DD format
const currentTime = now.toTimeString().slice(0, 5); // HH:MM format
// Check if today is an event date
const isEventDay = eventConfig.eventDates.includes(currentDate);
if (isEventDay) {
// Check if current time is after the cutoff time (default 15:00 / 3pm)
const cutoffTime = eventConfig.cutoffTime || "15:00";
if (currentTime >= cutoffTime) {
return {
blocked: true,
message: eventConfig.message,
};
}
}
return { blocked: false };
}

View File

@@ -9,40 +9,40 @@
"check": "next lint && npx tsc --noEmit" "check": "next lint && npx tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^5.0.0", "@hookform/resolvers": "^5.1.1",
"@radix-ui/react-label": "^2.1.2", "@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-popover": "^1.1.6", "@radix-ui/react-popover": "^1.1.14",
"@radix-ui/react-select": "^2.1.6", "@radix-ui/react-select": "^2.2.5",
"@radix-ui/react-slot": "^1.1.2", "@radix-ui/react-slot": "^1.2.3",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cssnano": "^7.0.1", "cssnano": "^7.1.0",
"date-fns": "^4.0.0", "date-fns": "^4.1.0",
"lucide-react": "^0.525.0", "lucide-react": "^0.542.0",
"next": "^15.2.1", "next": "^15.4.1",
"next-plausible": "^3.12.0", "next-plausible": "^3.12.4",
"postcss-flexbugs-fixes": "^5.0.2", "postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^10.0.0", "postcss-preset-env": "^10.2.4",
"react": "^19.0.0", "react": "^19.1.0",
"react-day-picker": "^9.5.1", "react-day-picker": "^9.8.0",
"react-dom": "^19.0.0", "react-dom": "^19.1.0",
"react-hook-form": "^7.54.2", "react-hook-form": "^7.60.0",
"tailwind-merge": "^3.0.0", "tailwind-merge": "^3.3.1",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"zod": "^4.0.0" "zod": "^4.0.5"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "4.1.11", "@tailwindcss/postcss": "4.1.12",
"@types/node": "22.16.3", "@types/node": "22.18.0",
"@types/react": "19.1.8", "@types/react": "19.1.12",
"@types/react-dom": "19.1.6", "@types/react-dom": "19.1.9",
"eslint": "9.31.0", "eslint": "9.34.0",
"eslint-config-next": "15.3.5", "eslint-config-next": "15.5.2",
"eslint-config-prettier": "10.1.5", "eslint-config-prettier": "10.1.8",
"postcss": "8.5.6", "postcss": "8.5.6",
"tailwindcss": "4.1.11", "tailwindcss": "4.1.12",
"turbo": "2.5.4", "turbo": "2.5.6",
"typescript": "5.8.3" "typescript": "5.9.2"
}, },
"packageManager": "pnpm@10.13.1" "packageManager": "pnpm@10.15.0"
} }

2651
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,6 @@
}, },
"target": "ES2023" "target": "ES2023"
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "event-dates.json"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }