diff --git a/.github/workflows/generateCheck.sh b/.github/workflows/generateCheck.sh
new file mode 100755
index 00000000..0f98e9cb
--- /dev/null
+++ b/.github/workflows/generateCheck.sh
@@ -0,0 +1,14 @@
+if [ $status == 0 ]; then
+ echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY
+ echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY
+ exit 0
+else
+ echo "## Formatting Check Failed 😅" >>$GITHUB_STEP_SUMMARY
+ echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY
+ echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY
+ for file in $files; do
+ echo "- $file" >>$GITHUB_STEP_SUMMARY
+ echo "::error file=$file::$file not formatted correctly"
+ done
+ exit 1
+fi
diff --git a/.github/workflows/prettierCheck.yml b/.github/workflows/prettierCheck.yml
new file mode 100644
index 00000000..e642ea75
--- /dev/null
+++ b/.github/workflows/prettierCheck.yml
@@ -0,0 +1,24 @@
+name: Formatting Check
+run-name: Running formatting check
+on: [push]
+jobs:
+ check-formatting:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ cache: 'npm'
+ - name: Run npm install
+ run: |
+ mv package.json package.json.bak
+ npm i --no-save prettier prettier-plugin-tailwindcss
+ mv package.json.bak package.json
+ - name: Run prettier
+ run: |
+ files=`npx prettier . -l` || st=$? && st=$?
+ echo status=`echo $st`>>"$GITHUB_ENV"
+ echo files=`echo $files`>> "$GITHUB_ENV"
+ - name: generate errors/summary
+ run: .github/workflows/generateCheck.sh
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..01f86141
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+src/server/db/migrations/*
diff --git a/package-lock.json b/package-lock.json
index 2a5f0c36..708e29ac 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -63,7 +63,7 @@
"jest": "^29.7.0",
"lint-staged": "^12.4.0",
"postcss": "^8.4.27",
- "prettier": "^3.0.0",
+ "prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.1",
"tailwindcss": "^3.3.3",
"ts-jest": "^29.1.1",
@@ -9823,9 +9823,9 @@
}
},
"node_modules/prettier": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
- "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
+ "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
diff --git a/package.json b/package.json
index e6fb51ae..3deca13e 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,7 @@
"jest": "^29.7.0",
"lint-staged": "^12.4.0",
"postcss": "^8.4.27",
- "prettier": "^3.0.0",
+ "prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.1",
"tailwindcss": "^3.3.3",
"ts-jest": "^29.1.1",
diff --git a/src/app/event/[id]/page.tsx b/src/app/event/[id]/page.tsx
index cdaf902c..405c6452 100644
--- a/src/app/event/[id]/page.tsx
+++ b/src/app/event/[id]/page.tsx
@@ -23,12 +23,16 @@ export default async function EventsPage({ params }: Params) {
const { club, ...event } = res;
- const isRegistered = (session && await db.query.userMetadataToEvents.findFirst({
- where: (userMetadataToEvents) => and(
- eq(userMetadataToEvents.eventId, event.id),
- eq(userMetadataToEvents.userId, session.user.id)
- )
- }) !== undefined) || false;
+ const isRegistered =
+ (session &&
+ (await db.query.userMetadataToEvents.findFirst({
+ where: (userMetadataToEvents) =>
+ and(
+ eq(userMetadataToEvents.eventId, event.id),
+ eq(userMetadataToEvents.userId, session.user.id),
+ ),
+ })) !== undefined) ||
+ false;
const clubDescription = ['Club', 'Location', 'Multi-Day'];
const clubDetails = [club.name, event.location, 'No'];
@@ -52,7 +56,10 @@ export default async function EventsPage({ params }: Params) {
List view
+List view
{Grid view
+Grid view