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 description empty string creating bug in layout #2400

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/Livewire/DTO/AlbumFormatted.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(AbstractAlbum $album, ?string $url)
$this->min_taken_at = $album->min_taken_at?->format($min_max_date_format);
$this->max_taken_at = $album->max_taken_at?->format($min_max_date_format);
$this->created_at = $album->created_at->format($create_date_format);
$this->description = $album->description;
$this->description = trim($album->description ?? '');
}
if ($album instanceof Album) {
$this->num_children = $album->num_children;
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/gallery/album/details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
</a>
@endif
</div>
@if($this->AlbumFormatted->description !== null)
<div class="w-full px-7 my-4 text-justify text-text-main-200 prose prose-invert prose-sm" {{ $attributes }} >
@if($this->AlbumFormatted->description !== '')
<div class="w-full px-7 max-w-full my-4 text-justify text-text-main-200 prose prose-invert prose-sm" {{ $attributes }} >{{-- prose set max-width to 65 chars --}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need w-full and max-w-full?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes.
w-full = width: 100%
max-w-full = max-width: 100%

@markdown{{ $this->AlbumFormatted->description }}@endmarkdown
</div>
@endif
Loading