refactor: replace textarea with markdown editor for onboarding description and enhance modal content rendering

This commit is contained in:
2025-12-04 00:44:37 -05:00
parent 6963ff6121
commit c0aa08751d
2 changed files with 13 additions and 8 deletions

View File

@@ -3,8 +3,8 @@
namespace Paymenter\Extensions\Others\Onboarding\Admin\Resources;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Form;
@@ -43,11 +43,11 @@ class OnboardingResource extends Resource
->maxLength(255)
->placeholder('Welcome to Our Platform'),
Textarea::make('description')
MarkdownEditor::make('description')
->label('Description')
->required()
->rows(4)
->placeholder('A brief description of this onboarding step...'),
->placeholder('A brief description of this onboarding step...')
->helperText('You can use markdown formatting in the description. Use **bold**, *italic*, links, lists, and more.'),
FileUpload::make('image')
->label('Image')

View File

@@ -78,12 +78,17 @@
<!-- Show content when slides exist -->
@if(count($slides) > 0 && isset($slides[$currentSlide]))
<div>
<h3 class="text-primary-100 text-xl font-semibold">
<h3 class="text-primary-100 text-xl font-semibold mb-3">
{{ $slides[$currentSlide]['title'] ?? 'Loading...' }}
</h3>
<p class="text-base/80 text-sm leading-6">
{{ $slides[$currentSlide]['description'] ?? 'Please wait...' }}
</p>
<div class="prose prose-sm dark:prose-invert max-w-none text-base/80">
{!! \Illuminate\Support\Str::markdown(e($slides[$currentSlide]['description'] ?? 'Please wait...'), [
'allow_unsafe_links' => false,
'renderer' => [
'soft_break' => "<br>"
]
]) !!}
</div>
</div>
@endif