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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions components/Testimonial.tsx
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.

Original file line number Diff line number Diff line change
Expand Up @@ -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.

*
* @param {TestimonialProps} props - The props for the Testimonial component.
* @param {string} props.className - Additional CSS class for styling the card.
* @param {string} props.text - The testimonial from the author.
* @param {string} props.authorName - The name of the author.
* @param {string} props.authorDescription - The description of the author.
* @param {string} props.authorAvatar - The path to avatar of the author.
* @param {string} props.authorAvatar - The path to the avatar of the author.
*/
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)

}: TestimonialProps) {
return (
<li className={`p-4 sm:px-6 md:flex md:flex-row md:py-4 md:pr-0 ${className}`}>
<blockquote className='mt-8 md:flex md:grow md:flex-col'>
<div className='relative text-lg font-medium leading-7 text-gray-600 md:flex-1'>
<IconQuote className='absolute left-0 top-0 size-8 -translate-y-2 text-primary-500' />
<Paragraph className='relative pl-10 text-left'>{text}</Paragraph>
<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}`}
>
<blockquote className="flex flex-col gap-6 text-left md:flex-grow">
<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" />
<Paragraph className="relative pl-12">{text}</Paragraph>
</div>
<footer className='mt-6'>
<div className='flex'>
<figure className='inline-flex shrink-0 rounded-full border-2 border-white'>
<img className='size-12 rounded-full' src={authorAvatar} alt={authorName} data-testid='Testimonial-img' />
</figure>
<div className='ml-4 text-left'>
<p className='text-base font-bold leading-6 text-gray-900'>{authorName}</p>
<p className='text-base font-medium leading-6 text-primary-500'>{authorDescription}</p>
</div>
<footer className="flex items-center gap-4">
<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"
/>
</figure>
<div>
<p className="text-base font-bold leading-6 text-gray-900">
{authorName}
</p>
<p className="text-sm font-medium leading-5 text-primary-500">
{authorDescription}
</p>
</div>
</footer>
</blockquote>
Expand Down
Loading