New design
This commit is contained in:
@@ -4,7 +4,7 @@ namespace App\Livewire\Person;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Services\RiksdagenService;
|
||||
use App\Enums\PartyEnum;
|
||||
use App\Enums\Parties;
|
||||
|
||||
class Search extends Component
|
||||
{
|
||||
@@ -16,7 +16,7 @@ class Search extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parties = PartyEnum::cases();
|
||||
$this->parties = collect(Parties::cases())->sortBy(fn($party) => $party->label())->toArray();
|
||||
}
|
||||
|
||||
public function search()
|
||||
|
||||
@@ -6,7 +6,9 @@ use Livewire\Component;
|
||||
use App\Services\RiksdagenService;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Asantibanez\LivewireCharts\Models\PieChartModel;
|
||||
use Livewire\Attributes\Lazy;
|
||||
|
||||
#[Lazy()]
|
||||
class Show extends Component
|
||||
{
|
||||
public $personId;
|
||||
@@ -132,8 +134,9 @@ class Show extends Component
|
||||
$statistics = $this->votingStatistics;
|
||||
|
||||
$pieChart = (new PieChartModel())
|
||||
->setTitle('Röststatistik för ' . $this->selectedYear)
|
||||
->setAnimated(true);
|
||||
->setTitle('Voteringsstatistik för ' . $this->selectedYear)
|
||||
->setAnimated(true)
|
||||
->withDataLabels();
|
||||
|
||||
$colors = [
|
||||
'Ja' => '#10b981', // Green
|
||||
@@ -150,6 +153,11 @@ class Show extends Component
|
||||
return $pieChart;
|
||||
}
|
||||
|
||||
public function placeholder()
|
||||
{
|
||||
return view('livewire.person.show-skeleton');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.person.show');
|
||||
|
||||
Reference in New Issue
Block a user