mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
This commit is contained in:
parent
ee9f21a83d
commit
e9037ef5d7
1 changed files with 25 additions and 6 deletions
|
|
@ -343,12 +343,22 @@ class Plugin extends Model
|
|||
}
|
||||
|
||||
if ($standalone) {
|
||||
return view('trmnl-layouts.single', [
|
||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
if ($size === 'full') {
|
||||
return view('trmnl-layouts.single', [
|
||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
} else {
|
||||
return view('trmnl-layouts.mashup', [
|
||||
'mashupLayout' => $this->getPreviewMashupLayoutForSize($size),
|
||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||
'slot' => $renderedContent,
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
|
||||
return $renderedContent;
|
||||
|
|
@ -386,4 +396,13 @@ class Plugin extends Model
|
|||
{
|
||||
return $this->configuration[$key] ?? $default;
|
||||
}
|
||||
|
||||
public function getPreviewMashupLayoutForSize(string $size): string
|
||||
{
|
||||
return match ($size) {
|
||||
'half_vertical' => '1Lx1R',
|
||||
'quadrant' => '2x2',
|
||||
default => '1Tx1B',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue