bezhanSalleh / filament-language-switch

A versatile and user-friendly plugin designed for Filament Panels.
MIT License
210 stars 45 forks source link

outside panel placement always pointing to left side (top, bottom) only #90

Closed valpuia604 closed 2 months ago

valpuia604 commented 5 months ago

This is my code inside AppServiceProvider

public function boot(): void
{
    LanguageSwitch::configureUsing(function (LanguageSwitch $switch) {
        $switch
            ->locales(['en', 'zh_CN'])
            ->visible(outsidePanels: true)
            ->outsidePanelPlacement(Placement::TopCenter);
    });
}

And this is the result. No matter how I try to change the position, it always ended up to TopLeft or BottomLeft only

Screenshot from 2024-04-09 10-36-17

Laravel v11.2.0 Livewire v3.4.10 Filament v3.2.63 Language switch v3.1.0

stardust-kevin commented 4 months ago

@valpuia604 I solved this problem, hope it helps you. Laravel v11.0.9 Filament v3.2.81 Language switch v3.1 image I think you can just do this:

/vendor/bezhansalleh/filament-language-switch/resources/views/language-switch.blade.php

replace 'justify-end' => str_contains($outsidePanelsPlacement, 'right'), with 'right-0' => str_contains($outsidePanelsPlacement, 'right'), If your theme does not have the right-0 attribute, you need to customize the theme and add it.

.right-0 {
    right: 0px;
}

Now, it works great.

bezhanSalleh commented 2 months ago

simple pages do not have render hooks in the topbar so the placement seems kinda off. any help would be appreciated