-
Notifications
You must be signed in to change notification settings - Fork 0
main/production #22
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
main/production #22
Conversation
There was a problem hiding this 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 refactors two Blade components to make their CSS class props optional by moving default values into inline fallbacks.
- Changed
imageContainerClassAttributesandclassAttributesprop defaults tonull - Added inline
??fallbacks for default Tailwind CSS classes in the templates
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| resources/views/components/list-image-card.blade.php | Made image container classes optional with a null coalesce fallback |
| resources/views/components/list-grid.blade.php | Made grid wrapper classes optional with a null coalesce fallback |
Comments suppressed due to low confidence (2)
resources/views/components/list-image-card.blade.php:10
- Add component tests to verify both custom and default class scenarios for
imageContainerClassAttributes, ensuring the fallback behaves as expected.
<div class="{{ $imageContainerClassAttributes ?? 'h-32 h-32 flex-shrink-0 overflow-hidden' }}">
resources/views/components/list-grid.blade.php:3
- Include tests to cover cases where
classAttributesis provided and when it falls back to the default, ensuring both render paths are validated.
<div class="{{ $classAttributes ?? 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4'}}">
| 'imageContainerClassAttributes' => null, | ||
| 'name', | ||
| 'role' => null, | ||
| 'icons' => [], | ||
| ]) | ||
|
|
||
| <div class="flex flex-row rounded-xl overflow-hidden transition group"> | ||
| <div class="{{ $imageContainerClassAttributes }}"> | ||
| <img src="{{ $image }}" alt="{{ $name }}" | ||
| class="w-full h-full object-cover transition-transform duration-300 ease-in-out group-hover:scale-105"/> | ||
| <div class="{{ $imageContainerClassAttributes ?? 'h-32 h-32 flex-shrink-0 overflow-hidden' }}"> |
Copilot
AI
Jun 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider defining the default container classes directly in the @props declaration (e.g., 'imageContainerClassAttributes' => 'h-32 h-32 flex-shrink-0 overflow-hidden') and removing the inline fallback to simplify the template logic.
| @props(['classAttributes' => null]) | ||
|
|
||
| <div class="{{ $classAttributes }}"> | ||
| <div class="{{ $classAttributes ?? 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4'}}"> |
Copilot
AI
Jun 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, consider setting the default grid classes in the @props declaration (e.g., 'classAttributes' => 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4') and remove the inline fallback for cleaner code.
No description provided.