mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 07:27:47 +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) {
|
if ($standalone) {
|
||||||
return view('trmnl-layouts.single', [
|
if ($size === 'full') {
|
||||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
return view('trmnl-layouts.single', [
|
||||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
||||||
'slot' => $renderedContent,
|
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||||
])->render();
|
'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;
|
return $renderedContent;
|
||||||
|
|
@ -386,4 +396,13 @@ class Plugin extends Model
|
||||||
{
|
{
|
||||||
return $this->configuration[$key] ?? $default;
|
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