Skip to content

Conversation

@var-bin
Copy link
Contributor

@var-bin var-bin commented Oct 16, 2025

List of changes

  • implement showing "Draft" badge

@var-bin var-bin self-assigned this Oct 16, 2025
@var-bin var-bin added enhancement New feature or request Blog Changes related to the Blog and Blog Item pages labels Oct 16, 2025
@var-bin var-bin requested a review from Copilot October 16, 2025 09:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements functionality to display draft blog posts in non-production environments and adds a "Draft" badge to distinguish them from published content. The changes ensure that draft posts are only visible in preview mode while maintaining production behavior of showing only published posts.

Key Changes

  • Added publicationState query parameter to Strapi API calls to fetch draft posts in non-production environments
  • Implemented logic to determine publication state based on publishedAt field and display appropriate dates
  • Added visual "Draft" badge UI component in both blog list and detail pages

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/api.blog.ts Added publication state filtering and logic to determine draft status based on publishedAt field
stories/mocks/page-data.ts Updated mock data with type annotations and added publicationState/createdAt fields
pages/blog/[blogId].page.tsx Added Draft badge component to blog detail page
models/strapi.model.ts Extended BlogItem interfaces to include createdAt and publicationState fields
components/blog/BlogSection.tsx Added Draft badge component to blog list items

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 16, 2025

Deploying next-varbintechcom with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa7ff09
Status: ✅  Deploy successful!
Preview URL: https://a2cf2d6a.next-varbintechcom.pages.dev
Branch Preview URL: https://feature-new-article-blog.next-varbintechcom.pages.dev

View logs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@var-bin var-bin merged commit a1857c2 into main Oct 16, 2025
2 checks passed
@var-bin var-bin deleted the feature/new-article-blog branch October 16, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blog Changes related to the Blog and Blog Item pages enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant