mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 15:37:53 +00:00
feat: added hello world markup template
This commit is contained in:
parent
fd18cf5246
commit
81f721099c
1 changed files with 20 additions and 0 deletions
|
|
@ -45,6 +45,9 @@ new class extends Component {
|
||||||
public function renderExample(string $example)
|
public function renderExample(string $example)
|
||||||
{
|
{
|
||||||
switch ($example) {
|
switch ($example) {
|
||||||
|
case 'helloWorld':
|
||||||
|
$markup = $this->renderHelloWorld();
|
||||||
|
break;
|
||||||
case 'quote':
|
case 'quote':
|
||||||
$markup = $this->renderQuote();
|
$markup = $this->renderQuote();
|
||||||
break;
|
break;
|
||||||
|
|
@ -61,6 +64,22 @@ new class extends Component {
|
||||||
$this->blade_code = $markup;
|
$this->blade_code = $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function renderHelloWorld(): string
|
||||||
|
{
|
||||||
|
return <<<HTML
|
||||||
|
<x-trmnl::view>
|
||||||
|
<x-trmnl::layout>
|
||||||
|
<x-trmnl::markdown gapSize="large">
|
||||||
|
<x-trmnl::title>TRMNL BYOS Laravel</x-trmnl::title>
|
||||||
|
<x-trmnl::content>“This screen was rendered by BYOS Laravel”</x-trmnl::content>
|
||||||
|
<x-trmnl::label variant="underline">Benjamin Nussbaum</x-trmnl::label>
|
||||||
|
</x-trmnl::markdown>
|
||||||
|
</x-trmnl::layout>
|
||||||
|
<x-trmnl::title-bar/>
|
||||||
|
</x-trmnl::view>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
|
||||||
public function renderQuote(): string
|
public function renderQuote(): string
|
||||||
{
|
{
|
||||||
return <<<HTML
|
return <<<HTML
|
||||||
|
|
@ -151,6 +170,7 @@ HTML;
|
||||||
<div class="mt-5 mb-5 ">
|
<div class="mt-5 mb-5 ">
|
||||||
<span>Examples</span>
|
<span>Examples</span>
|
||||||
<div class="text-accent">
|
<div class="text-accent">
|
||||||
|
<a href="#" wire:click="renderExample('helloWorld')" class="text-xl">Hello World</a> |
|
||||||
<a href="#" wire:click="renderExample('quote')" class="text-xl">Quote</a> |
|
<a href="#" wire:click="renderExample('quote')" class="text-xl">Quote</a> |
|
||||||
<a href="#" wire:click="renderExample('trainMonitor')" class="text-xl">Train Monitor</a> |
|
<a href="#" wire:click="renderExample('trainMonitor')" class="text-xl">Train Monitor</a> |
|
||||||
<a href="#" wire:click="renderExample('homeAssistant')" class="text-xl">Temperature Sensors</a>
|
<a href="#" wire:click="renderExample('homeAssistant')" class="text-xl">Temperature Sensors</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue