No more tabs on profile form. New generic card component (simple for now).

This commit is contained in:
Ryan Scherler
2021-01-18 13:00:10 -08:00
parent c39c6d5ce9
commit 1fb23c705e
7 changed files with 64 additions and 60 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,4 +1,4 @@
{
"/js/filament.js": "/js/filament.js?id=575bb8a26dd76080eafa",
"/css/filament.css": "/css/filament.css?id=ecd162b1ad9d5ed8507f"
"/css/filament.css": "/css/filament.css?id=666434e331878aafa0a8"
}
@@ -0,0 +1,3 @@
<div {{ $attributes->merge(['class' => 'bg-white shadow-sm rounded p-4 md:p-6']) }}>
{{ $slot }}
</div>
+8 -6
View File
@@ -3,13 +3,15 @@
'tab',
])
<div
<x-filament::card
x-data="{ tab: '{{ $tab }}' }"
x-cloak
{{ $attributes->merge(['class' => 'bg-white shadow-sm rounded overflow-hidden']) }}
class="overflow-hidden"
>
<div class="bg-gray-100 border-b border-gray-200 flex" class="tablist" role="tablist" aria-label="{{ $label }}">
{{ $tablist }}
<div class="-m-4 md:-m-6">
<div class="bg-gray-100 border-b border-gray-200 flex" class="tablist" role="tablist" aria-label="{{ $label }}">
{{ $tablist }}
</div>
{{ $slot }}
</div>
{{ $slot }}
</div>
</x-filament::card>
+11 -9
View File
@@ -1,11 +1,13 @@
<x-filament::form class="space-y-6">
<x-filament::fields :fields="$this->fields()" />
<x-filament::form>
<x-filament::card class="space-y-6">
<x-filament::fields :fields="$this->fields()" />
<x-filament::button
type="submit"
class="btn-primary"
wire:loading.attr="disabled"
>
{{ __('filament::profile.update') }}
</x-filament::button>
<x-filament::button
type="submit"
class="btn-primary"
wire:loading.attr="disabled"
>
{{ __('filament::profile.update') }}
</x-filament::button>
</x-filament::card>
</x-filament::form>
+39 -42
View File
@@ -82,49 +82,46 @@ class Profile extends Component
public function fields()
{
return [
Tabs::make('filament::profile.title')
->tab('filament::profile.tabs.account', [
Layout::make('grid grid-cols-1 lg:grid-cols-2 gap-6')
->fields([
Text::make('user.name')
->label('Name')
->extraAttributes([
'required' => 'true',
]),
Text::make('user.email')
->type('email')
->label('filament::fields.labels.email')
->modelDirective('wire:model.lazy')
->extraAttributes([
'required' => 'true',
'autocomplete' => 'email',
]),
]),
Avatar::make('avatar')
->label('filament::profile.labels.userPhoto')
->avatar($this->avatar)
->user($this->user)
->deleteMethod('deleteAvatar'),
Fieldset::make('filament::profile.labels.updatePassword')
->fields([
Text::make('password')
->type('password')
->label('filament::fields.labels.password')
->extraAttributes([
'autocomplete' => 'new-password',
])
->hint(__('filament::fields.hints.optional'))
->help(__('filament::profile.help.passwordKeep')),
Text::make('password_confirmation')
->type('password')
->label('filament::fields.labels.newPassword')
->extraAttributes([
'autocomplete' => 'new-password',
])
->hint(__('filament::fields.hints.optional')),
Layout::make('grid grid-cols-1 lg:grid-cols-2 gap-6')
->fields([
Text::make('user.name')
->label('Name')
->extraAttributes([
'required' => 'true',
]),
Text::make('user.email')
->type('email')
->label('filament::fields.labels.email')
->modelDirective('wire:model.lazy')
->extraAttributes([
'required' => 'true',
'autocomplete' => 'email',
]),
]),
Avatar::make('avatar')
->label('filament::profile.labels.userPhoto')
->avatar($this->avatar)
->user($this->user)
->deleteMethod('deleteAvatar'),
Fieldset::make('filament::profile.labels.updatePassword')
->fields([
Text::make('password')
->type('password')
->label('filament::fields.labels.password')
->extraAttributes([
'autocomplete' => 'new-password',
])
->class('grid grid-cols-1 lg:grid-cols-2 gap-6'),
]),
->hint(__('filament::fields.hints.optional'))
->help(__('filament::profile.help.passwordKeep')),
Text::make('password_confirmation')
->type('password')
->label('filament::fields.labels.newPassword')
->extraAttributes([
'autocomplete' => 'new-password',
])
->hint(__('filament::fields.hints.optional')),
])
->class('grid grid-cols-1 lg:grid-cols-2 gap-6'),
];
}