From b2de7cc1ac4260091383bb8fa3cddae4218d9c87 Mon Sep 17 00:00:00 2001 From: fernanduandrade Date: Sat, 15 Aug 2026 14:00:30 -0300 Subject: [PATCH 1/3] =?UTF-8?q?fix(profile):=20desabilitar=20o=20handler?= =?UTF-8?q?=20do=20social=20links=20quando=20n=C3=A3o=20tiver=20plataforma?= =?UTF-8?q?=20selecionada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app-modules/panel-app/src/Pages/ProfilePage.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app-modules/panel-app/src/Pages/ProfilePage.php b/app-modules/panel-app/src/Pages/ProfilePage.php index 8b1f0722..3b60ffab 100644 --- a/app-modules/panel-app/src/Pages/ProfilePage.php +++ b/app-modules/panel-app/src/Pages/ProfilePage.php @@ -256,11 +256,13 @@ public function form(Schema $schema): Schema ->label(__('panel-app::profile.fields.platform')) ->options(SocialPlatform::class) ->required(fn (Get $get): bool => filled($get('handle'))) + ->live() ->columnSpan(1), TextInput::make('handle') ->label(__('panel-app::profile.fields.handle')) ->placeholder(__('panel-app::profile.placeholders.handle')) + ->disabled(fn (Get $get): bool => blank($get('platform'))) ->required(fn (Get $get): bool => filled($get('platform'))) ->live(onBlur: true) ->afterStateUpdated(function (Get $get, TextInput $component): void { From b4e38fc24c7f8cae6402dfea24973f6db6842b5b Mon Sep 17 00:00:00 2001 From: fernanduandrade Date: Sat, 15 Aug 2026 14:22:41 -0300 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20adicionar=20icons=20das=20plataform?= =?UTF-8?q?as=20dispon=C3=ADveis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/profile-preview-card.blade.php | 2 +- app-modules/panel-app/src/Pages/ProfilePage.php | 11 ++++++++++- app-modules/profile/src/Enums/SocialPlatform.php | 12 ++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app-modules/panel-app/resources/views/components/profile-preview-card.blade.php b/app-modules/panel-app/resources/views/components/profile-preview-card.blade.php index f10c5700..dea705d8 100644 --- a/app-modules/panel-app/resources/views/components/profile-preview-card.blade.php +++ b/app-modules/panel-app/resources/views/components/profile-preview-card.blade.php @@ -252,7 +252,7 @@ class="inline-block rounded-full border border-gray-200 bg-gray-50 px-2.5 py-0.5 rel="noopener noreferrer" class="inline-flex items-center gap-1 text-xs font-medium text-purple-600 hover:text-purple-800 dark:text-purple-400 dark:hover:text-purple-200 transition-colors" > - + {{ $platform->getLabel() }} diff --git a/app-modules/panel-app/src/Pages/ProfilePage.php b/app-modules/panel-app/src/Pages/ProfilePage.php index 3b60ffab..0ab3a254 100644 --- a/app-modules/panel-app/src/Pages/ProfilePage.php +++ b/app-modules/panel-app/src/Pages/ProfilePage.php @@ -254,7 +254,16 @@ public function form(Schema $schema): Schema Grid::make(2)->schema([ Select::make('platform') ->label(__('panel-app::profile.fields.platform')) - ->options(SocialPlatform::class) + ->options(fn (): array => collect(SocialPlatform::cases()) + ->mapWithKeys(fn (SocialPlatform $platform): array => [ + $platform->value => sprintf( + '%s %s', + svg($platform->getBrandIcon(), 'h-4 w-4')->toHtml(), + e($platform->getLabel()), + ), + ]) + ->all()) + ->allowHtml() ->required(fn (Get $get): bool => filled($get('handle'))) ->live() ->columnSpan(1), diff --git a/app-modules/profile/src/Enums/SocialPlatform.php b/app-modules/profile/src/Enums/SocialPlatform.php index db6eaf65..af2d3db4 100644 --- a/app-modules/profile/src/Enums/SocialPlatform.php +++ b/app-modules/profile/src/Enums/SocialPlatform.php @@ -45,6 +45,18 @@ public function getIcon(): Heroicon }; } + public function getBrandIcon(): string + { + return match ($this) { + self::Instagram => 'fab-instagram', + self::Twitter => 'fab-x-twitter', + self::Website => 'fas-globe', + self::YouTube => 'fab-youtube', + self::Bluesky => 'fab-bluesky', + self::LinkedIn => 'fab-linkedin', + }; + } + public function getUrl(string $handle): string { if (str_starts_with($handle, 'http://') || str_starts_with($handle, 'https://')) { From 042247e0e3888b74e12548561301fa9137d0f00c Mon Sep 17 00:00:00 2001 From: fernanduandrade Date: Sat, 15 Aug 2026 15:10:38 -0300 Subject: [PATCH 3/3] =?UTF-8?q?fix(profile):=20resetar=20campo=20handler?= =?UTF-8?q?=20quando=20n=C3=A3o=20houver=20op=C3=A7=C3=A3o=20de=20platafor?= =?UTF-8?q?ma=20selecionada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app-modules/panel-app/src/Pages/ProfilePage.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app-modules/panel-app/src/Pages/ProfilePage.php b/app-modules/panel-app/src/Pages/ProfilePage.php index 0ab3a254..fb551c21 100644 --- a/app-modules/panel-app/src/Pages/ProfilePage.php +++ b/app-modules/panel-app/src/Pages/ProfilePage.php @@ -266,6 +266,11 @@ public function form(Schema $schema): Schema ->allowHtml() ->required(fn (Get $get): bool => filled($get('handle'))) ->live() + ->afterStateUpdated(static function (Get $get, Set $set): void { + if (blank($get('platform'))) { + $set('handle', null); + } + }) ->columnSpan(1), TextInput::make('handle')