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

fix: center filter alignment on large screens #3629

Closed

Conversation

KishanInnovates
Copy link
Contributor

@KishanInnovates KishanInnovates commented Jan 30, 2025

Problem

  • The filter component was aligned to the left on large screens (lg:justify-start).

Solution

  • Changed lg:justify-start to lg:justify-center to properly center it.

Issue Link

Summary by CodeRabbit

  • Style
    • Improved code formatting and consistency
    • Replaced single quotes with double quotes in JSX attributes
    • Added commas for better syntax in object and array declarations

Copy link
Contributor

coderabbitai bot commented Jan 30, 2025

Walkthrough

The pull request introduces minor formatting and consistency changes to the pages/blog/index.tsx file. The modifications primarily focus on adding commas to object properties and array elements, replacing single quotes with double quotes for JSX attributes, and adjusting indentation and spacing. These changes do not alter the component's functionality or logical flow, maintaining the existing behavior of the blog index page.

Changes

File Change Summary
pages/blog/index.tsx - Added commas to navItems, toFilter array, and clearFilters options object
- Replaced single quotes with double quotes in JSX attributes
- Adjusted indentation and spacing of JSX elements

Assessment against linked issues

Objective Addressed Explanation
Center filter on large screens [#3626] No changes related to filter alignment or justification were made

Possibly related PRs

Suggested labels

ready-to-merge, bounty

Suggested reviewers

  • derberg
  • magicmatatjahu
  • devilkiller-ag
  • sambhavgupta0705
  • asyncapi-bot-eve
  • Mayaleeeee
  • anshgoyalevil

Poem

🐰 Commas dance, quotes align with grace,
Code's rhythm finds its perfect space.
Formatting's magic, subtle and neat,
A rabbit's touch makes syntax complete!
Hop, hop, hooray for clean design! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4c517a4
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/679b70e4ff7fb70008f8ee46
😎 Deploy Preview https://deploy-preview-3629--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Jan 30, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 46
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3629--asyncapi-website.netlify.app/

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
pages/blog/index.tsx (2)

100-107: Enhance RSS feed image accessibility.

The RSS feed image could benefit from improved accessibility attributes:

 <img
   className='ml-1 text-primary-500 hover:text-primary-300'
   style={{ display: 'inline' }}
   src='/img/logos/rss.svg'
   alt='RSS feed'
+  role='img'
+  aria-label='RSS Feed Icon'
   height='18px'
   width='18px'
 />
🧰 Tools
🪛 ESLint

[error] 101-101: Replace "ml-1·text-primary-500·hover:text-primary-300" with 'ml-1·text-primary-500·hover:text-primary-300'

(prettier/prettier)


[error] 101-101: Unexpected usage of doublequote.

(jsx-quotes)


[error] 103-103: Replace "/img/logos/rss.svg" with '/img/logos/rss.svg'

(prettier/prettier)


[error] 103-103: Unexpected usage of doublequote.

(jsx-quotes)


[error] 104-104: Replace "RSS·feed" with 'RSS·feed'

(prettier/prettier)


[error] 104-104: Unexpected usage of doublequote.

(jsx-quotes)


[error] 105-105: Replace "18px" with '18px'

(prettier/prettier)


[error] 105-105: Unexpected usage of doublequote.

(jsx-quotes)


[error] 106-106: Replace "18px" with '18px'

(prettier/prettier)


[error] 106-106: Unexpected usage of doublequote.

(jsx-quotes)


145-151: Improve loading state accessibility.

Consider enhancing the loader with ARIA attributes for better accessibility:

 <div className='h-screen w-full'>
   <Loader
     loaderText='Loading Blogs'
     className='mx-auto my-60'
     pulsating
+    role='status'
+    aria-live='polite'
   />
 </div>
🧰 Tools
🪛 ESLint

[error] 145-145: Replace "h-screen·w-full" with 'h-screen·w-full'

(prettier/prettier)


[error] 145-145: Unexpected usage of doublequote.

(jsx-quotes)


[error] 146-150: Replace ⏎··················loaderText="Loading·Blogs"⏎··················className="mx-auto·my-60"⏎··················pulsating⏎··············· with ·loaderText='Loading·Blogs'·className='mx-auto·my-60'·pulsating

(prettier/prettier)


[error] 147-147: Unexpected usage of doublequote.

(jsx-quotes)


[error] 148-148: Unexpected usage of doublequote.

(jsx-quotes)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bca2a91 and 4c517a4.

📒 Files selected for processing (1)
  • pages/blog/index.tsx (2 hunks)
🧰 Additional context used
🪛 ESLint
pages/blog/index.tsx

[error] 35-35: Delete ,

(prettier/prettier)


[error] 35-35: Unexpected trailing comma.

(comma-dangle)


[error] 42-42: Delete ,

(prettier/prettier)


[error] 42-42: Unexpected trailing comma.

(comma-dangle)


[error] 46-46: Delete ,

(prettier/prettier)


[error] 46-46: Unexpected trailing comma.

(comma-dangle)


[error] 49-49: Delete ,

(prettier/prettier)


[error] 49-49: Unexpected trailing comma.

(comma-dangle)


[error] 50-50: Delete ,

(prettier/prettier)


[error] 50-50: Unexpected trailing comma.

(comma-dangle)


[error] 54-54: Delete ,

(prettier/prettier)


[error] 54-54: Unexpected trailing comma.

(comma-dangle)


[error] 67-67: Replace "Blog" with 'Blog'

(prettier/prettier)


[error] 67-67: Unexpected usage of doublequote.

(jsx-quotes)


[error] 68-71: Replace ⏎········className="relative·px-4·pb-20·pt-8·sm:px-6·lg:px-8·lg:pb-28·lg:pt-12"⏎········id="main-content"⏎······ with ·className='relative·px-4·pb-20·pt-8·sm:px-6·lg:px-8·lg:pb-28·lg:pt-12'·id='main-content'

(prettier/prettier)


[error] 69-69: Unexpected usage of doublequote.

(jsx-quotes)


[error] 70-70: Unexpected usage of doublequote.

(jsx-quotes)


[error] 72-72: Replace "absolute·inset-0" with 'absolute·inset-0'

(prettier/prettier)


[error] 72-72: Unexpected usage of doublequote.

(jsx-quotes)


[error] 73-73: Replace "h-1/3·bg-white·sm:h-2/3" with 'h-1/3·bg-white·sm:h-2/3'

(prettier/prettier)


[error] 73-73: Unexpected usage of doublequote.

(jsx-quotes)


[error] 75-75: Replace "relative·mx-auto·max-w-7xl" with 'relative·mx-auto·max-w-7xl'

(prettier/prettier)


[error] 75-75: Unexpected usage of doublequote.

(jsx-quotes)


[error] 76-76: Replace "text-center" with 'text-center'

(prettier/prettier)


[error] 76-76: Unexpected usage of doublequote.

(jsx-quotes)


[error] 80-80: Replace "mx-auto·mt-3·max-w-2xl·sm:mt-4" with 'mx-auto·mt-3·max-w-2xl·sm:mt-4'

(prettier/prettier)


[error] 80-80: Unexpected usage of doublequote.

(jsx-quotes)


[error] 83-86: Replace ⏎··············typeStyle={ParagraphTypeStyle.md}⏎··············className="mx-auto·mt-4·max-w-2xl"⏎············ with ·typeStyle={ParagraphTypeStyle.md}·className='mx-auto·mt-4·max-w-2xl'

(prettier/prettier)


[error] 85-85: Unexpected usage of doublequote.

(jsx-quotes)


[error] 88-91: Replace ⏎················href="https://github.com/asyncapi/website/issues/new?template=blog.md"⏎················target="_blank"⏎·············· with ·href='https://github.com/asyncapi/website/issues/new?template=blog.md'·target='_blank'

(prettier/prettier)


[error] 89-89: Unexpected usage of doublequote.

(jsx-quotes)


[error] 90-90: Unexpected usage of doublequote.

(jsx-quotes)


[error] 95-98: Replace ⏎··············typeStyle={ParagraphTypeStyle.md}⏎··············className="mx-auto·mt-1·max-w-2xl"⏎············ with ·typeStyle={ParagraphTypeStyle.md}·className='mx-auto·mt-1·max-w-2xl'

(prettier/prettier)


[error] 97-97: Unexpected usage of doublequote.

(jsx-quotes)


[error] 101-101: Replace "ml-1·text-primary-500·hover:text-primary-300" with 'ml-1·text-primary-500·hover:text-primary-300'

(prettier/prettier)


[error] 101-101: Unexpected usage of doublequote.

(jsx-quotes)


[error] 103-103: Replace "/img/logos/rss.svg" with '/img/logos/rss.svg'

(prettier/prettier)


[error] 103-103: Unexpected usage of doublequote.

(jsx-quotes)


[error] 104-104: Replace "RSS·feed" with 'RSS·feed'

(prettier/prettier)


[error] 104-104: Unexpected usage of doublequote.

(jsx-quotes)


[error] 105-105: Replace "18px" with '18px'

(prettier/prettier)


[error] 105-105: Unexpected usage of doublequote.

(jsx-quotes)


[error] 106-106: Replace "18px" with '18px'

(prettier/prettier)


[error] 106-106: Unexpected usage of doublequote.

(jsx-quotes)


[error] 108-108: Replace "/rss.xml" with '/rss.xml'

(prettier/prettier)


[error] 108-108: Unexpected usage of doublequote.

(jsx-quotes)


[error] 111-111: Replace "mx:64·mt-12·md:flex·md:justify-center·lg:justify-center" with 'mx:64·mt-12·md:flex·md:justify-center·lg:justify-center'

(prettier/prettier)


[error] 111-111: Unexpected usage of doublequote.

(jsx-quotes)


[error] 115-115: Replace "md:·mx-px·mt-1·w-full·md:mt-0·md:w-1/5·md:text-sm" with 'md:·mx-px·mt-1·w-full·md:mt-0·md:w-1/5·md:text-sm'

(prettier/prettier)


[error] 115-115: Unexpected usage of doublequote.

(jsx-quotes)


[error] 120-120: Replace "button" with 'button'

(prettier/prettier)


[error] 120-120: Unexpected usage of doublequote.

(jsx-quotes)


[error] 121-121: Replace "bg-none·text-md·mt-1·rounded-md·border·border-gray-200·px-4·py-2·font-semibold·tracking-heading·text-gray-800·shadow-none·transition-all·duration-500·ease-in-out·hover:text-gray-700·md:mt-0·md:py-0" with 'bg-none·text-md·mt-1·rounded-md·border·border-gray-200·px-4·py-2·font-semibold·tracking-heading·text-gray-800·shadow-none·transition-all·duration-500·ease-in-out·hover:text-gray-700·md:mt-0·md:py-0'

(prettier/prettier)


[error] 121-121: Unexpected usage of doublequote.

(jsx-quotes)


[error] 124-124: Replace "inline-block" with 'inline-block'

(prettier/prettier)


[error] 124-124: Unexpected usage of doublequote.

(jsx-quotes)


[error] 130-130: Replace "mt-16·flex·flex-col·items-center·justify-center" with 'mt-16·flex·flex-col·items-center·justify-center'

(prettier/prettier)


[error] 130-130: Unexpected usage of doublequote.

(jsx-quotes)


[error] 132-134: Replace "mx-auto·mt-3·max-w-2xl·text-xl·leading-7·text-gray-500">⏎··················No·post·matches·your·filter⏎················ with 'mx-auto·mt-3·max-w-2xl·text-xl·leading-7·text-gray-500'>No·post·matches·your·filter

(prettier/prettier)


[error] 132-132: Unexpected usage of doublequote.

(jsx-quotes)


[error] 138-138: Replace "mx-auto·mt-12·grid·max-w-lg·gap-5·lg:max-w-none·lg:grid-cols-3" with 'mx-auto·mt-12·grid·max-w-lg·gap-5·lg:max-w-none·lg:grid-cols-3'

(prettier/prettier)


[error] 138-138: Unexpected usage of doublequote.

(jsx-quotes)


[error] 145-145: Replace "h-screen·w-full" with 'h-screen·w-full'

(prettier/prettier)


[error] 145-145: Unexpected usage of doublequote.

(jsx-quotes)


[error] 146-150: Replace ⏎··················loaderText="Loading·Blogs"⏎··················className="mx-auto·my-60"⏎··················pulsating⏎··············· with ·loaderText='Loading·Blogs'·className='mx-auto·my-60'·pulsating

(prettier/prettier)


[error] 147-147: Unexpected usage of doublequote.

(jsx-quotes)


[error] 148-148: Unexpected usage of doublequote.

(jsx-quotes)

⏰ Context from checks skipped due to timeout of 180000ms (3)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
🔇 Additional comments (1)
pages/blog/index.tsx (1)

111-111: Filter alignment change looks good!

The change from lg:justify-start to lg:justify-center successfully addresses the alignment issue on large screens, meeting the PR objective.

🧰 Tools
🪛 ESLint

[error] 111-111: Replace "mx:64·mt-12·md:flex·md:justify-center·lg:justify-center" with 'mx:64·mt-12·md:flex·md:justify-center·lg:justify-center'

(prettier/prettier)


[error] 111-111: Unexpected usage of doublequote.

(jsx-quotes)

@@ -32,26 +32,26 @@ export default function BlogIndexPage() {

return i2Date.getTime() - i1Date.getTime();
})
: []
: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix code style issues flagged by ESLint.

  1. Remove trailing commas as they're disallowed by the project's ESLint configuration:
- navItems ? navItems.sort(...) : [],
+ navItems ? navItems.sort(...) : []

Similar fixes needed for other trailing commas.

  1. Use single quotes consistently in JSX attributes:
- <GenericLayout title="Blog" description={description} image={image} wide>
+ <GenericLayout title='Blog' description={description} image={image} wide>

Similar fixes needed for other JSX attributes.

Also applies to: 42-42, 46-46, 49-49, 50-50, 54-54, 67-150

🧰 Tools
🪛 ESLint

[error] 35-35: Delete ,

(prettier/prettier)


[error] 35-35: Unexpected trailing comma.

(comma-dangle)

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.

[BUG] Filter Alignment Issue on Large Screen
2 participants