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: testimonials alignment #3513

Closed

Conversation

Pulkitxm
Copy link

@Pulkitxm Pulkitxm commented Dec 23, 2024

Description

  • Improved the Testimonial component's alignment for consistent spacing and layout.
  • Fixed spacing issues to ensure the text and author sections are aligned properly across different screen sizes.
  • Adjusted flexbox properties and added responsive design tweaks for better adaptability.
  • Normalized avatar dimensions and ensured uniform padding and gap throughout the component.

Related issue(s)
Closes #3509

Summary by CodeRabbit

  • Documentation

    • Updated documentation to clarify the purpose and parameters of the Testimonial component.
  • New Features

    • Enhanced layout and styling for improved visual consistency and responsiveness of the Testimonial component.
  • Bug Fixes

    • Adjusted spacing and alignment issues within the Testimonial component.

Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

The pull request focuses on refining the Testimonial.tsx component by improving its layout, styling, and visual consistency. The changes involve restructuring the component's JSX to use flexbox for better spacing and alignment. The modifications include adjusting padding, margin, and sizing classes to create a more uniform appearance across testimonial cards, with specific attention to element positioning and readability.

Changes

File Change Summary
components/Testimonial.tsx - Updated component documentation description
- Implemented flexbox layout for <li> and <blockquote> elements
- Adjusted sizing classes for IconQuote
- Refined padding and margin classes
- Restructured footer section with improved avatar and text alignment

Assessment against linked issues

Objective Addressed Explanation
Consistent Testimonial Spacing [#3509]
Resolve Alignment Issues

Suggested Labels

ready-to-merge

Suggested Reviewers

  • derberg
  • magicmatatjahu
  • devilkiller-ag
  • akshatnema
  • sambhavgupta0705
  • Mayaleeeee
  • anshgoyalevil

Poem

🐰 In the realm of testimonial design,
Flexbox weaves its magic line,
Spacing aligned, elements bright,
A rabbit's touch makes layout just right!
Consistency dances with grace, so fine! 🌟


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 Dec 23, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 441debf
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67694fb3c2ff6200080fd5cd
😎 Deploy Preview https://deploy-preview-3513--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 Dec 23, 2024

⚡️ Lighthouse report for the changes in this PR:

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

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

@@ -12,38 +12,47 @@ interface TestimonialProps {
}

/**
* @description This component displays Testimonial component.
* @description This component displays a Testimonial card with consistent spacing and alignment.
Copy link
Member

Choose a reason for hiding this comment

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

No need to change the commen over here.

Copy link
Member

Choose a reason for hiding this comment

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

Please fix the lint errors.

Copy link

@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)
components/Testimonial.tsx (2)

32-34: Consider a single-line className assignment if project style rules mandate it.
The multiline usage of className might conflict with Prettier’s formatting rules. Converting it to a single line might be preferred if that’s the agreed-upon style.

-<li
-  className={`flex flex-col gap-6 p-6 sm:px-8 sm:py-6 md:flex-row md:gap-8 md:p-8 ${className}`}
->
+<li className={`flex flex-col gap-6 p-6 sm:px-8 sm:py-6 md:flex-row md:gap-8 md:p-8 ${className}`}>
🧰 Tools
🪛 eslint

[error] 32-34: Replace ⏎······className={flex·flex-col·gap-6·p-6·sm:px-8·sm:py-6·md:flex-row·md:gap-8·md:p-8·${className}}⏎···· with ·className={flex·flex-col·gap-6·p-6·sm:px-8·sm:py-6·md:flex-row·md:gap-8·md:p-8·${className}}

(prettier/prettier)


35-55: Use single quotes for JSX attributes to comply with lint rules.
If your project is configured to enforce single quotes for JSX markup, replace all double quotes accordingly.

Example fix for lines 35–55:

-<blockquote className="flex flex-col gap-6 text-left md:flex-grow">
+<blockquote className='flex flex-col gap-6 text-left md:flex-grow'>

-<div className="relative text-lg font-medium leading-7 text-gray-600">
+<div className='relative text-lg font-medium leading-7 text-gray-600'>

-<IconQuote className="absolute left-0 top-0 h-8 w-8 -translate-y-2 text-primary-500" />
+<IconQuote className='absolute left-0 top-0 h-8 w-8 -translate-y-2 text-primary-500' />

-<Paragraph className="relative pl-12">{text}</Paragraph>
+<Paragraph className='relative pl-12'>{text}</Paragraph>

-<footer className="flex items-center gap-4">
+<footer className='flex items-center gap-4'>

-<figure className="flex-shrink-0 rounded-full border-2 border-white">
+<figure className='flex-shrink-0 rounded-full border-2 border-white'>

-<img
-  className="w-12 h-12 rounded-full"
-  src={authorAvatar}
-  alt={authorName}
-  data-testid="Testimonial-img"
-/>
+<img
+  className='w-12 h-12 rounded-full'
+  src={authorAvatar}
+  alt={authorName}
+  data-testid='Testimonial-img'
+/>

-<p className="text-base font-bold leading-6 text-gray-900">
+<p className='text-base font-bold leading-6 text-gray-900'>

-<p className="text-sm font-medium leading-5 text-primary-500">
+<p className='text-sm font-medium leading-5 text-primary-500'>
🧰 Tools
🪛 eslint

[error] 35-35: Replace "flex·flex-col·gap-6·text-left·md:flex-grow" with 'flex·flex-col·gap-6·text-left·md:flex-grow'

(prettier/prettier)


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

(jsx-quotes)


[error] 36-36: Replace "relative·text-lg·font-medium·leading-7·text-gray-600" with 'relative·text-lg·font-medium·leading-7·text-gray-600'

(prettier/prettier)


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

(jsx-quotes)


[error] 37-37: Replace "absolute·left-0·top-0·h-8·w-8·-translate-y-2·text-primary-500" with 'absolute·left-0·top-0·h-8·w-8·-translate-y-2·text-primary-500'

(prettier/prettier)


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

(jsx-quotes)


[error] 38-38: Replace "relative·pl-12" with 'relative·pl-12'

(prettier/prettier)


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

(jsx-quotes)


[error] 40-40: Replace "flex·items-center·gap-4" with 'flex·items-center·gap-4'

(prettier/prettier)


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

(jsx-quotes)


[error] 41-41: Replace "flex-shrink-0·rounded-full·border-2·border-white" with 'flex-shrink-0·rounded-full·border-2·border-white'

(prettier/prettier)


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

(jsx-quotes)


[error] 42-47: Replace ⏎··············className="w-12·h-12·rounded-full"⏎··············src={authorAvatar}⏎··············alt={authorName}⏎··············data-testid="Testimonial-img"⏎··········· with ·className='w-12·h-12·rounded-full'·src={authorAvatar}·alt={authorName}·data-testid='Testimonial-img'

(prettier/prettier)


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

(jsx-quotes)


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

(jsx-quotes)


[error] 50-52: Replace "text-base·font-bold·leading-6·text-gray-900">⏎··············{authorName}⏎············ with 'text-base·font-bold·leading-6·text-gray-900'>{authorName}

(prettier/prettier)


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

(jsx-quotes)


[error] 53-55: Replace "text-sm·font-medium·leading-5·text-primary-500">⏎··············{authorDescription}⏎············ with 'text-sm·font-medium·leading-5·text-primary-500'>{authorDescription}

(prettier/prettier)


[error] 53-53: 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 3afcf6a and 441debf.

📒 Files selected for processing (1)
  • components/Testimonial.tsx (1 hunks)
🧰 Additional context used
🪛 eslint
components/Testimonial.tsx

[error] 29-29: Delete ,

(prettier/prettier)


[error] 29-29: Unexpected trailing comma.

(comma-dangle)


[error] 32-34: Replace ⏎······className={flex·flex-col·gap-6·p-6·sm:px-8·sm:py-6·md:flex-row·md:gap-8·md:p-8·${className}}⏎···· with ·className={flex·flex-col·gap-6·p-6·sm:px-8·sm:py-6·md:flex-row·md:gap-8·md:p-8·${className}}

(prettier/prettier)


[error] 35-35: Replace "flex·flex-col·gap-6·text-left·md:flex-grow" with 'flex·flex-col·gap-6·text-left·md:flex-grow'

(prettier/prettier)


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

(jsx-quotes)


[error] 36-36: Replace "relative·text-lg·font-medium·leading-7·text-gray-600" with 'relative·text-lg·font-medium·leading-7·text-gray-600'

(prettier/prettier)


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

(jsx-quotes)


[error] 37-37: Replace "absolute·left-0·top-0·h-8·w-8·-translate-y-2·text-primary-500" with 'absolute·left-0·top-0·h-8·w-8·-translate-y-2·text-primary-500'

(prettier/prettier)


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

(jsx-quotes)


[error] 38-38: Replace "relative·pl-12" with 'relative·pl-12'

(prettier/prettier)


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

(jsx-quotes)


[error] 40-40: Replace "flex·items-center·gap-4" with 'flex·items-center·gap-4'

(prettier/prettier)


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

(jsx-quotes)


[error] 41-41: Replace "flex-shrink-0·rounded-full·border-2·border-white" with 'flex-shrink-0·rounded-full·border-2·border-white'

(prettier/prettier)


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

(jsx-quotes)


[error] 42-47: Replace ⏎··············className="w-12·h-12·rounded-full"⏎··············src={authorAvatar}⏎··············alt={authorName}⏎··············data-testid="Testimonial-img"⏎··········· with ·className='w-12·h-12·rounded-full'·src={authorAvatar}·alt={authorName}·data-testid='Testimonial-img'

(prettier/prettier)


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

(jsx-quotes)


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

(jsx-quotes)


[error] 50-52: Replace "text-base·font-bold·leading-6·text-gray-900">⏎··············{authorName}⏎············ with 'text-base·font-bold·leading-6·text-gray-900'>{authorName}

(prettier/prettier)


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

(jsx-quotes)


[error] 53-55: Replace "text-sm·font-medium·leading-5·text-primary-500">⏎··············{authorDescription}⏎············ with 'text-sm·font-medium·leading-5·text-primary-500'>{authorDescription}

(prettier/prettier)


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

(jsx-quotes)

🔇 Additional comments (1)
components/Testimonial.tsx (1)

15-22: Documentation updates look good!
The revised description is more accurate and clear in communicating the improved layout and spacing.

*/
export default function Testimonial({
className = '',
text,
authorName,
authorDescription,
authorAvatar
authorAvatar,
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove the trailing comma to comply with style guidelines.
The trailing comma after “authorAvatar” may cause linting errors.

 export default function Testimonial({
   className = '',
   text,
   authorName,
   authorDescription,
-  authorAvatar,
+  authorAvatar
 }: TestimonialProps) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
authorAvatar,
authorAvatar
🧰 Tools
🪛 eslint

[error] 29-29: Delete ,

(prettier/prettier)


[error] 29-29: Unexpected trailing comma.

(comma-dangle)

@Pulkitxm Pulkitxm closed this by deleting the head repository Dec 23, 2024
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.

Testimonial Alignment Issue on AsyncAPI Website
3 participants