Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blog): reorder the default navigation items, introduce a 'Latest' component to display the most recent blog posts, 'New' flag to indicate recent posts #545

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

duyet
Copy link
Owner

@duyet duyet commented Nov 1, 2024

Summary by Sourcery

Update the blog UI by adding a 'Latest' component to showcase recent posts and a 'New' flag for recent posts in the 'YearPost' component. Enhance the navigation menu with a 'Feed' link and update the 'Thumb' component to support unoptimized images.

New Features:

  • Introduce a 'Latest' component to display the most recent blog posts on the main page.
  • Add a 'New' flag to indicate recent posts in the 'YearPost' component.

Enhancements:

  • Update the navigation menu to include a 'Feed' link and reorder the default navigation items.
  • Add an 'unoptimized' prop to the 'Thumb' component to allow for unoptimized image rendering.

Copy link
Contributor

sourcery-ai bot commented Nov 1, 2024

Reviewer's Guide by Sourcery

This PR implements several UI improvements and code quality updates across the blog application. The main changes include adding a new "Latest" posts component to the homepage, introducing a "New" flag for recent posts, and performing code cleanup with consistent formatting and type improvements.

Updated class diagram for the Post type

classDiagram
  class Post {
    +string slug
    +string title
    +Date date
    +string category
    +string category_slug
    +string[] tags
    +string[] tags_slug
    +string thumbnail
    +string author
    +string content
    +string excerpt
    +string edit_url
    +string series
    +any [key: string]
  }
  note for Post "Added 'thumbnail' attribute"
Loading

Class diagram for the new Latest component

classDiagram
  class Latest {
    +LatestProps props
    +getPosts(limit: int) Post[]
    +Latest(props: LatestProps)
  }
  class LatestProps {
    +string className
  }
  class Post {
    +string slug
    +string title
    +Date date
    +string category
    +string category_slug
    +string[] tags
    +string[] tags_slug
    +string thumbnail
    +string author
    +string content
    +string excerpt
    +string edit_url
    +string series
    +any [key: string]
  }
  Latest --> LatestProps
  Latest --> Post
  note for Latest "New component to display latest posts on homepage"
Loading

File-Level Changes

Change Details Files
Added a new Latest posts component to display recent blog entries
  • Created a new Latest component that displays the 3 most recent blog posts
  • Added thumbnail support with hover effects
  • Integrated the Latest component into the homepage
apps/blog/components/latest.tsx
apps/blog/app/page.tsx
Implemented a visual indicator for new blog posts
  • Added an IsNewPost component that shows a 'New' label for posts from the current month
  • Integrated the new indicator into the year post listing
apps/blog/components/year-post.tsx
Updated the blog post interface and navigation structure
  • Reorganized Post interface properties for better type organization
  • Added Feed to the default navigation items
  • Updated Thumb component to support unoptimized image loading
packages/interfaces/src/post.ts
packages/components/Menu.tsx
packages/components/Thumb.tsx
Code quality improvements in the post retrieval system
  • Standardized string quotes to single quotes
  • Added consistent semicolon usage
  • Improved date handling in the getPost utility
packages/libs/getPost.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:51pm
cv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:51pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:51pm

@duyet duyet changed the title chore(blog): update ui, latest post, new flag chore(blog): update ui, introduce a 'Latest' component to display the most recent blog posts, 'New' flag to indicate recent posts Nov 1, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @duyet - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider separating formatting changes (semicolons, quotes) into a separate PR from functional changes to make reviews more focused and efficient.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@duyet duyet changed the title chore(blog): update ui, introduce a 'Latest' component to display the most recent blog posts, 'New' flag to indicate recent posts chore(blog): reorder the default navigation items, introduce a 'Latest' component to display the most recent blog posts, 'New' flag to indicate recent posts Nov 1, 2024
@duyet duyet merged commit 003ac3e into master Nov 1, 2024
9 checks passed
@duyet duyet deleted the feat/ui-update branch November 1, 2024 14:53
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.

1 participant