Skip to content

Feature/refactor calendar#71

Merged
Thomasbenissan merged 9 commits intomainfrom
feature/refactor-calendar
Mar 24, 2026
Merged

Feature/refactor calendar#71
Thomasbenissan merged 9 commits intomainfrom
feature/refactor-calendar

Conversation

@calebj04
Copy link
Copy Markdown
Contributor

Fix dark mode.
Split CareerDev.tsx into several components to make codebase neater and easier to work with.
Fixed image upload backend by restricting uploading to admin and viewing to authenticated users. (Achieved this by creating policies for the article bucket in supabase).

@Thomasbenissan
Copy link
Copy Markdown
Collaborator

Hey Caleb, nice refactor. Splitting the 900-line monolith into focused components looks great and is so much more readable, and unifying create/edit into a single ArticleModal is clean. Pushed fixes for the following issues directly to the branch:

  1. Signed URL stored in DB expired after 60 seconds (fixed)
    uploadArticleImage was generating a signed URL with 60-second expiry and saving it to the article record. After a minute, every article image in the DB was a dead link. Changed it to store the storage path instead. The /api/career-dev-articles GET route now generates fresh signed URLs (1 hour) at read-time, matching how the documents feature works.

  2. images.domains is deprecated (fixed)
    Replaced with remotePatterns in next.config.js. Also added **.supabase.co so signed URLs from Supabase storage work with next/image.

  3. Typo: MiniCalender.tsx renamed to MiniCalendar.tsx (fixed)

  4. Added article bucket to seed.sql (fixed)
    The bucket wasn't in the seed, so local dev setups wouldn't have it. Added it alongside avatars and files.

  5. Added "use client" to all new component files (fixed)
    ArticleDetailsModal, ArticleModal, MediaCard, and MiniCalendar all use hooks but were missing the directive. They worked because CareerDev.tsx is a client component, but they should be explicit.

Note: You'll need to make sure the article bucket in the shared Supabase project has the correct RLS policies (upload restricted to admin, viewing restricted to authenticated users). Those policies don't live in the codebase.

Again most of those were minor fixes so all in all looks good!

@Thomasbenissan Thomasbenissan merged commit 715811d into main Mar 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants