Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
d87b93d
(SP: 1) [Shop] Fix checkout redirect 404 by removing duplicate locale…
liudmylasovetovs Jan 22, 2026
6d4398f
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 22, 2026
e5e9b0e
(SP: 1) [Shop] Fix locale cart page and orderid page
liudmylasovetovs Jan 22, 2026
2c76b66
(SP: 1) [Frontend] Changin hero headline on shop main page
liudmylasovetovs Jan 23, 2026
4d20881
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 23, 2026
2ae7774
(SP: 1) [Frontend] Fix styles shop home page, buttons
liudmylasovetovs Jan 24, 2026
368850a
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 24, 2026
3bbfab2
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 24, 2026
f0f5d6a
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 28, 2026
e369d3e
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 29, 2026
5676416
(SP:2) [BD][Backend]add monobank scaffolding (db constraints, env gat…
liudmylasovetovs Jan 29, 2026
c197c00
(SP:1) [shop/monobank]: UAH-only checkout invariants, fail-closed PSP…
liudmylasovetovs Jan 29, 2026
306422e
(SP:2) [Backend] Monobank DB foundations + invariants + B3 verificati…
liudmylasovetovs Jan 29, 2026
5b7ec1b
(SP: 3) [Shop API] Monobank: env contract + flags gating + URL base h…
liudmylasovetovs Jan 30, 2026
daf779c
(SP: 2) [Backend] Monobank PSP adapter: API methods + contract tests
liudmylasovetovs Jan 30, 2026
dd793d0
move: shop tests to folder shop
liudmylasovetovs Jan 30, 2026
c6b0f7d
(SP: 3) [backend | monobank] webhook apply exactly-once (persist-firs…
liudmylasovetovs Jan 30, 2026
6a0a365
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 30, 2026
e43c3f0
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 31, 2026
c0a17fd
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 31, 2026
c946150
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Jan 31, 2026
f2c7ff6
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 1, 2026
5005927
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 1, 2026
120cfcd
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 1, 2026
82586dc
(SP 1) [FIX] conflicts in router and schema
liudmylasovetovs Feb 1, 2026
a6689f0
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 2, 2026
094bda2
(SP 1) [FIX] remove duplicates and conflicts
liudmylasovetovs Feb 2, 2026
4ee0b8e
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 2, 2026
848687c
(SP 1) [FIX] Route Monobank webhook paymentStatus transitions through…
liudmylasovetovs Feb 3, 2026
02f81e1
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 3, 2026
fe59985
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 3, 2026
b190f4a
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 3, 2026
d075229
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 4, 2026
cda1095
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 4, 2026
aa839c4
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 5, 2026
457854d
(SP 1) [Backend] Block checkout when PAYMENTS_ENABLED=false to preven…
liudmylasovetovs Feb 5, 2026
d3492d8
chore(docs): update contact email and license year
ViktorSvertoka Feb 6, 2026
625bdb4
Merge pull request #287 from DevLoversTeam/update-contact-email
ViktorSvertoka Feb 6, 2026
d6ad63b
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 6, 2026
efc5acd
chore(seo): add OG/Twitter metadata for social link previews
ViktorSvertoka Feb 7, 2026
2918760
Merge pull request #289 from DevLoversTeam/chore/og-metadata-and-soci…
ViktorSvertoka Feb 7, 2026
03796e8
Merge branch 'develop' into sl/feat/quiz
LesiaUKR Feb 7, 2026
c7f55d4
Merge branch 'develop' into sl/feat/quiz
LesiaUKR Feb 7, 2026
f39fe37
feat(quiz): add Redis cache for quiz questions
LesiaUKR Feb 7, 2026
0b02dc4
fix(quiz): improve Redis cache resilience
LesiaUKR Feb 7, 2026
cb7147c
fix(quiz): add graceful Redis error handling
LesiaUKR Feb 7, 2026
b76b9cb
fix(quiz): remove unused API route
LesiaUKR Feb 7, 2026
6f60706
fix(meta): ensure OG preview on locale home
ViktorSvertoka Feb 7, 2026
f24084e
fix(meta): add locale canonical and OG URL
ViktorSvertoka Feb 7, 2026
578e909
fix(meta): localize OG image alt text
ViktorSvertoka Feb 7, 2026
7fa64dd
Merge pull request #290 from DevLoversTeam/fix/og-preview
ViktorSvertoka Feb 7, 2026
1b2abb7
fix(quiz): wrap Redis cache reads in try/catch for graceful fallback
LesiaUKR Feb 7, 2026
5d98096
fix(meta): localize OG image alt text
ViktorSvertoka Feb 7, 2026
67a743e
fix(meta): localize text
ViktorSvertoka Feb 7, 2026
c5a91f9
Merge pull request #292 from DevLoversTeam/fix/og-preview
ViktorSvertoka Feb 7, 2026
8a4c0d4
Merge pull request #293 from DevLoversTeam/sl/feat/quiz
ViktorSvertoka Feb 7, 2026
5c2f8ec
feat(dashboard): explained terms card, layout fixes, support link
TiZorii Feb 8, 2026
7d1f9d7
Translation fix
TiZorii Feb 8, 2026
1047b46
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 8, 2026
febe4d8
feat(quiz): add guest warning before start and bot protection (#297)
LesiaUKR Feb 8, 2026
a0ae043
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 9, 2026
e4415f5
(SP 1) [Backend] strip client money fields for Monobank payloads + tests
liudmylasovetovs Feb 9, 2026
9614592
(SP: 1) [Website] Add humans.txt with team and project info (#299)
ViktorSvertoka Feb 9, 2026
3e5d0a3
(SP 1) [Backend] Wire Monobank checkout branch with deterministic err…
liudmylasovetovs Feb 9, 2026
5963489
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 9, 2026
2ca78b0
(SP: 1) [Backend] Add isolated Monobank webhook route with X-Sign ver…
liudmylasovetovs Feb 10, 2026
2c86302
(SP: 1) [Backend] hardening(monobank-refund): retry requested, servic…
liudmylasovetovs Feb 10, 2026
a49c323
(SP: 1) [Backend] add monobank unpaid cancel-payment + finalize refun…
liudmylasovetovs Feb 10, 2026
add4b83
(SP: 1) [fix] remove comments
liudmylasovetovs Feb 10, 2026
e3de26f
(SP: 1) [fix] install packages
liudmylasovetovs Feb 10, 2026
a0fa931
feat: add navigation loading states and responsive GitHub button (#301)
YNazymko12 Feb 10, 2026
d7f2abd
(SP: 1) [fix] install package-lock
liudmylasovetovs Feb 10, 2026
65cfc5a
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 10, 2026
269addf
(SP: 1) [fix] fix(p1-tests-docs): stabilize monobank tests, correct e…
liudmylasovetovs Feb 10, 2026
ee1adb2
(SP: 1) [fix] harden Monobank cancel/apply/metadata + Stripe flag fal…
liudmylasovetovs Feb 10, 2026
6e27496
(SP: 1) [fix] nitpik fix monobank and monowebhook
liudmylasovetovs Feb 10, 2026
b1543d6
(SP: 3)[Shop][Monobank] UAH-only checkout + webhook verify/apply + st…
liudmylasovetovs Feb 10, 2026
24c295c
(SP: 1) [fix] chore(monobank-webhook): defer webhook refactor/typing …
liudmylasovetovs Feb 10, 2026
40ea2ea
Merge branch 'develop' of https://github.com/DevLoversTeam/devlovers.…
liudmylasovetovs Feb 10, 2026
ae72ec7
(SP: 1) [Backend]shop(monobank): harden webhook apply outcome typing
liudmylasovetovs Feb 10, 2026
87c1314
(SP: 1) [Backend] test(shop/monobank): archive test product instead o…
liudmylasovetovs Feb 10, 2026
b9a58a6
(SP: 1) [Backend] harden monobank webhook atomic updates, audit trail…
liudmylasovetovs Feb 11, 2026
dd79c1b
Merge pull request #305 from DevLoversTeam/lso/feat/shop
ViktorSvertoka Feb 11, 2026
be5f4f2
feat(monitoring): add Sentry integration for production error tracking
ViktorSvertoka Feb 11, 2026
de2a17a
feat(leaderboard): add user avatars to table rows with DiceBear fallback
TiZorii Feb 11, 2026
05d9429
fix(sentry): align client config and package version
ViktorSvertoka Feb 11, 2026
5fbff7f
Merge pull request #307 from DevLoversTeam/feature/sentry
ViktorSvertoka Feb 11, 2026
69a6c26
fix(leaderboard): userId seed, key reset, canonical classes
TiZorii Feb 11, 2026
6b6d16b
Merge pull request #308 from DevLoversTeam/feat/user-avatars-leaderboard
ViktorSvertoka Feb 11, 2026
e638d1c
feat(ci): add Safe-chain security check to GitHub Actions
ViktorSvertoka Feb 11, 2026
a363a4f
fix(ci): fix npm cache path and add minimal permissions for security …
ViktorSvertoka Feb 11, 2026
10b8113
fix(ci): add APP_ENV and NODE_ENV for Next.js build in Security workflow
ViktorSvertoka Feb 11, 2026
f3d163f
fix(ci): pin Safe-chain version and add workflow permissions
ViktorSvertoka Feb 11, 2026
40b6747
fix(ci): add packages
ViktorSvertoka Feb 11, 2026
87ba6da
fix(ci): sync package-lock.json with dependencies
ViktorSvertoka Feb 11, 2026
cd401cc
fix(ci): install devDependencies for Next.js build stability
ViktorSvertoka Feb 11, 2026
2f8a0ca
fix(ci): update env.example
ViktorSvertoka Feb 11, 2026
63be1f6
fix(auth): lazy-load oauth env per provider
ViktorSvertoka Feb 11, 2026
39c67a6
fix(build): avoid env-related auth/db crashes during next build
ViktorSvertoka Feb 11, 2026
d683572
fix(build): avoid env-related auth/db
ViktorSvertoka Feb 11, 2026
bc46571
ci(security): focus Safe Chain workflow on dependency malware scanning
ViktorSvertoka Feb 11, 2026
fb4e896
ci(security): replace invalid safe-chain verify command with shim check
ViktorSvertoka Feb 11, 2026
5ae1b1a
ci(security): add safe-chain bin/shims to GITHUB_PATH for CI steps
ViktorSvertoka Feb 11, 2026
b8887b4
ci(security): use npm-installed safe-chain with setup-ci and shim val…
ViktorSvertoka Feb 11, 2026
c8df7fd
Merge pull request #310 from DevLoversTeam/feat/ci-security
ViktorSvertoka Feb 11, 2026
eed6beb
revert(auth,db): rollback oauth/db env changes to restore auth flow
ViktorSvertoka Feb 11, 2026
72e54d5
Merge pull request #311 from DevLoversTeam/fix/auth
ViktorSvertoka Feb 11, 2026
954ebf2
fix(proxy): handle missing locale correctly for /dashboard redirects
ViktorSvertoka Feb 11, 2026
44ba764
Merge pull request #313 from DevLoversTeam/fix/dev-oauth-dashboard-lo…
ViktorSvertoka Feb 11, 2026
7e5d089
refs(files): Update Home title and use subtitle for OG metadata
ViktorSvertoka Feb 11, 2026
2665fb5
Merge pull request #314 from DevLoversTeam/fix/home-title-and-og-subt…
ViktorSvertoka Feb 12, 2026
6d20f6e
chore(release): prepare v0.5.7
ViktorSvertoka Feb 12, 2026
c12e49b
Merge branch 'main' into develop
ViktorSvertoka Feb 12, 2026
70e122b
fix(quiz): add category style for quiz header icon
ViktorSvertoka Feb 12, 2026
363d02f
fix(quiz): guard optional iconClassName
ViktorSvertoka Feb 12, 2026
b3c85fa
fix(types): add UserLastAttempt
ViktorSvertoka Feb 12, 2026
397b05d
fix(types): add quiz review types
ViktorSvertoka Feb 12, 2026
990d048
fix(types): export quiz attempt types in queries
ViktorSvertoka Feb 12, 2026
45ae69f
fix(quiz): add attempt review cache helpers
ViktorSvertoka Feb 12, 2026
8b22bd8
fix(types): allow string percentage from db
ViktorSvertoka Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Security Check

permissions:
contents: read

on:
pull_request:
push:
branches: [main, develop]

jobs:
safe-chain:
runs-on: ubuntu-latest

defaults:
run:
working-directory: frontend

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install Safe-chain
run: npm install -g @aikidosec/safe-chain@1.4.2

- name: Setup Safe-chain for CI
run: safe-chain setup-ci

- name: Add Safe-chain to PATH
run: |
echo "$HOME/.safe-chain/bin" >> "$GITHUB_PATH"
echo "$HOME/.safe-chain/shims" >> "$GITHUB_PATH"

- name: Verify Safe-chain is active
run: |
set -euo pipefail
command -v safe-chain
safe-chain --version
NPM_BIN="$(command -v npm)"
echo "npm path: ${NPM_BIN}"
case "${NPM_BIN}" in
*".safe-chain/shims/"*) ;;
*)
echo "Safe-chain npm shim is not active"
exit 1
;;
esac

- name: Install dependencies
run: npm ci --include=dev
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

- Fixed inconsistent scroll behavior when navigating Q&A pages
- Improved UX predictability across desktop and mobile devices

## [0.5.7] - 2026-02-12

### Added

- Monitoring & observability:
- Production error and performance monitoring via Sentry
- Global error boundary and release tracking
- Security & CI:
- Safe-chain dependency malware protection in GitHub Actions
- Automated dependency validation on push and pull requests
- SEO & social metadata:
- Full Open Graph and Twitter Card support
- Localized OG metadata and alt text
- Canonical URL handling via metadataBase
- Quiz platform improvements:
- Redis caching for quiz questions to reduce database load
- Guest warning with Login / Sign up / Continue as guest options
- Bot protection: single verification per question attempt
- Shop enhancements:
- Monobank payment integration (UAH-only, feature-gated)
- Secure webhook processing with signature validation and idempotency
- Admin refund and cancel endpoints
- Platform transparency:
- Added `/public/humans.txt` with team, mission, and technology stack

### Changed

- Navigation & UX:
- Added global page transition loading indicators
- Context-aware header behavior for Blog and Shop
- Improved mobile menu interactions and auto-close behavior
- Leaderboard:
- User avatars with DiceBear fallback for missing images
- Home & SEO:
- Home title standardized to "DevLovers"
- Subtitle used for OG/Twitter previews
- Authentication & routing:
- Improved locale detection and dashboard redirect handling
- OAuth and database configuration stability improvements

### Fixed

- Fixed missing locale handling for `/dashboard` redirects
- Restored authentication flow after environment configuration issues
- Improved handling of missing or invalid avatar data
- Fixed OG preview URL resolution issues
- Improved reliability of environment configuration and credentials

### Performance

- Reduced database load for quiz pages via Redis caching
- Improved frontend loading experience during navigation
2 changes: 1 addition & 1 deletion frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ TRUST_FORWARDED_HEADERS=0
# emergency switch
RATE_LIMIT_DISABLED=0

GROQ_API_KEY=
GROQ_API_KEY=
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== Check trailing newline in frontend/.env.example ==="
if [ -f "frontend/.env.example" ]; then
  # Check if file ends with newline
  if [ -n "$(tail -c 1 frontend/.env.example)" ]; then
    echo "Missing trailing newline: YES"
  else
    echo "Missing trailing newline: NO"
  fi
  echo "Last 5 lines of file:"
  tail -5 frontend/.env.example | cat -A
fi

echo ""
echo "=== Env vars in frontend/.env.example ==="
if [ -f "frontend/.env.example" ]; then
  grep -oP '^[A-Z_]+' frontend/.env.example | sort -u
fi

echo ""
echo "=== Search for env vars in frontend code (env/ directory) ==="
find frontend -path '*/env/*' -type f | head -10

echo ""
echo "=== Env vars referenced in frontend/lib/env/ or similar ==="
find frontend -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" | xargs grep -h 'process\.env\.' 2>/dev/null | grep -oP 'process\.env\.\K[A-Z_]+' | sort -u

Repository: DevLoversTeam/devlovers.net

Length of output: 3238


Add trailing newline and update .env.example with missing environment variables.

Two issues:

  1. Trailing newline: The file is missing a final newline. Add one after line 105.

  2. Missing environment variables: Several env vars referenced in the codebase are not documented in .env.example, making it harder for developers to discover required configuration. Add placeholders for:

    • Monobank: MONO_WEBHOOK_MODE, MONO_REFUND_ENABLED, MONO_PUBLIC_KEY, MONO_API_BASE, MONO_MERCHANT_TOKEN, MONO_INVOICE_TIMEOUT_MS, MONO_WEBHOOK_CLAIM_TTL_MS
    • Shop: SHOP_STATUS_TOKEN_SECRET, SHOP_BASE_URL
    • Monitoring: NEXT_PUBLIC_SENTRY_DSN, LOG_LEVEL
    • Payments: STRIPE_PAYMENTS_ENABLED, STRIPE_WEBHOOK_INSTANCE_ID, WEBHOOK_INSTANCE_ID
    • Other: GITHUB_TOKEN, GITHUB_SPONSORS_TOKEN, LINKEDIN_FOLLOWER_COUNT, DATABASE_URL_LOCAL, NEXT_PUBLIC_ENABLE_ADMIN
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 105-105: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🤖 Prompt for AI Agents
In `@frontend/.env.example` at line 105, Add a trailing newline at the end of
.env.example and append placeholder entries for the missing environment
variables so developers can discover required configuration; specifically add
lines for MONO_WEBHOOK_MODE, MONO_REFUND_ENABLED, MONO_PUBLIC_KEY,
MONO_API_BASE, MONO_MERCHANT_TOKEN, MONO_INVOICE_TIMEOUT_MS,
MONO_WEBHOOK_CLAIM_TTL_MS, SHOP_STATUS_TOKEN_SECRET, SHOP_BASE_URL,
NEXT_PUBLIC_SENTRY_DSN, LOG_LEVEL, STRIPE_PAYMENTS_ENABLED,
STRIPE_WEBHOOK_INSTANCE_ID, WEBHOOK_INSTANCE_ID, GITHUB_TOKEN,
GITHUB_SPONSORS_TOKEN, LINKEDIN_FOLLOWER_COUNT, DATABASE_URL_LOCAL, and
NEXT_PUBLIC_ENABLE_ADMIN (each as empty placeholders), and ensure the file ends
with a single final newline character.

3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ next-env.d.ts
CLAUDE.md
_dev-notes/
.claude

# Sentry Config File
.env.sentry-build-plugin
6 changes: 1 addition & 5 deletions frontend/app/[locale]/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getTranslations } from 'next-intl/server';

import { PostAuthQuizSync } from '@/components/auth/PostAuthQuizSync';
import { QuizResultsSection } from '@/components/dashboard/QuizResultsSection';
import { ExplainedTermsCard } from '@/components/dashboard/ExplainedTermsCard';
import { ProfileCard } from '@/components/dashboard/ProfileCard';
import { QuizSavedBanner } from '@/components/dashboard/QuizSavedBanner';
Expand Down Expand Up @@ -111,12 +110,9 @@ export default async function DashboardPage({
<div className="grid gap-8 md:grid-cols-2">
<ProfileCard user={userForDisplay} locale={locale} />
<StatsCard stats={stats} />
</div>
<div className="mt-8">
<ExplainedTermsCard />
</div>
<div className="mt-8">
<QuizResultsSection attempts={lastAttempts} locale={locale} />
<ExplainedTermsCard />
</div>
</main>
</DynamicGridBackground>
Expand Down
6 changes: 4 additions & 2 deletions frontend/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export async function generateMetadata({
};
const ogLocale = localeMap[locale] ?? 'en_US';

const ogTitle = t('subtitle');

return {
title: t('title'),
description: t('description'),
Expand All @@ -31,7 +33,7 @@ export async function generateMetadata({
},
},
openGraph: {
title: t('title'),
title: ogTitle,
description: t('description'),
url: canonicalUrl,
siteName: 'DevLovers',
Expand All @@ -48,7 +50,7 @@ export async function generateMetadata({
},
twitter: {
card: 'summary_large_image',
title: t('title'),
title: ogTitle,
description: t('description'),
images: ['/og.png'],
},
Expand Down
22 changes: 13 additions & 9 deletions frontend/app/[locale]/quiz/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Metadata } from 'next';
import Image from 'next/image';
import { notFound } from 'next/navigation';
import { getTranslations } from 'next-intl/server';
import Image from 'next/image';

import { QuizContainer } from '@/components/quiz/QuizContainer';
import { categoryTabStyles } from '@/data/categoryStyles';
import { cn } from '@/lib/utils';

import { QuizContainer } from '@/components/quiz/QuizContainer';
import { stripCorrectAnswers } from '@/db/queries/quiz';
import { getQuizBySlug, getQuizQuestionsRandomized } from '@/db/queries/quiz';
import { getCurrentUser } from '@/lib/auth';
Expand Down Expand Up @@ -53,10 +52,9 @@ export default async function QuizPage({
notFound();
}

const categoryStyle =
quiz.categorySlug && quiz.categorySlug in categoryTabStyles
? categoryTabStyles[quiz.categorySlug as keyof typeof categoryTabStyles]
: null;
const categoryStyle = quiz.categorySlug
? categoryTabStyles[quiz.categorySlug as keyof typeof categoryTabStyles]
: null;

const parsedSeed = seedParam ? Number.parseInt(seedParam, 10) : Number.NaN;
const seed = Number.isFinite(parsedSeed)
Expand Down Expand Up @@ -84,9 +82,15 @@ export default async function QuizPage({
<span className="relative h-8 w-8 shrink-0 sm:h-10 sm:w-10">
<Image
src={categoryStyle.icon}
alt=""
alt={quiz.categoryName ?? quiz.categorySlug ?? 'Category'}
fill
className={cn('object-contain', 'iconClassName' in categoryStyle && categoryStyle.iconClassName)}
sizes="(min-width: 640px) 40px, 32px"
className={cn(
'object-contain',
'iconClassName' in categoryStyle
? categoryStyle.iconClassName
: undefined
)}
/>
</span>
)}
Expand Down
11 changes: 4 additions & 7 deletions frontend/app/[locale]/shop/orders/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ export const metadata: Metadata = {
export const dynamic = 'force-dynamic';

type OrderCurrency = (typeof orders.$inferSelect)['currency'];
type OrderPaymentStatus = (typeof orders.$inferSelect)['paymentStatus'];
type OrderPaymentProvider = (typeof orders.$inferSelect)['paymentProvider'];

type OrderDetail = {
id: string;
userId: string | null;
totalAmount: string;
currency: OrderCurrency;
paymentStatus:
| 'pending'
| 'requires_payment'
| 'paid'
| 'failed'
| 'refunded';
paymentProvider: string;
paymentStatus: OrderPaymentStatus;
paymentProvider: OrderPaymentProvider;
paymentIntentId: string | null;
stockRestored: boolean;
restockedAt: string | null;
Expand Down
Loading