-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08d92a7
commit 46f8f86
Showing
6 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@props([ | ||
'dto' | ||
]) | ||
|
||
<li class="relative flex gap-x-4"> | ||
@unless($isLast) | ||
<div class="absolute left-0 top-0 flex w-6 justify-center -bottom-6"> | ||
<div class="w-px bg-gray-200"></div> | ||
</div> | ||
@endUnless | ||
|
||
<!-- take the array from the DTO and pass it in here. but also look up what the ComponentAttributeBag function is actually called in blade --> | ||
<x-dynamic-component :component="$dto->component" :attributes="new ComponentAttributeBag($dto->props)" /> | ||
|
||
<x-some-specified-comonent prop1="value1" prop2="value2" /> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Thunk\VerbsHistory\States\DTOs; | ||
use Thunk\Verbs\SerializedByVerbs; | ||
use Thunk\Verbs\Support\Normalization\NormalizeToPropertiesAndClassName; | ||
|
||
class HistoryComponentDto implements SerializedByVerbs | ||
{ | ||
use NormalizeToPropertiesAndClassName; | ||
|
||
public function __construct( | ||
public string $component, | ||
public array $props, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Thunk\VerbsHistory\States\DTOs; | ||
use Illuminate\Support\Carbon; | ||
use Thunk\Verbs\SerializedByVerbs; | ||
use Thunk\VerbsHistory\States\DTOs\HistoryComponentDto; | ||
use Thunk\Verbs\Support\Normalization\NormalizeToPropertiesAndClassName; | ||
|
||
class HistoryItem implements SerializedByVerbs | ||
{ | ||
use NormalizeToPropertiesAndClassName; | ||
|
||
public function __construct( | ||
public Carbon $date_time, | ||
public ?HistoryComponentDto $component = null, | ||
public ?string $message = null, | ||
) { | ||
} | ||
|
||
public function humanTime() | ||
{ | ||
return $this->date_time->diffForHumans(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters