actions move to backend file
This commit is contained in:
36
app/View/Components/Link/Hover.php
Normal file
36
app/View/Components/Link/Hover.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components\Link;
|
||||||
|
|
||||||
|
use App\Abstracts\View\Component;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class Hover extends Component
|
||||||
|
{
|
||||||
|
public $color;
|
||||||
|
public $groupHover;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
string $color = 'to-black',
|
||||||
|
bool $groupHover = false,
|
||||||
|
|
||||||
|
) {
|
||||||
|
$this->color = $color;
|
||||||
|
$this->groupHover = $groupHover;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represent the component.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Contracts\View\View|string
|
||||||
|
*/
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('components.link.hover');
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,10 @@
|
|||||||
@props(['color', 'text', 'groupHover'])
|
<span
|
||||||
|
@class([
|
||||||
@php
|
$color,
|
||||||
if (empty($color)) {
|
$groupHover ? 'group-hover:bg-full-2' : 'hover:bg-full-2',
|
||||||
$color = 'to-black';
|
'bg-no-repeat bg-0-2 bg-0-full bg-gradient-to-b from-transparent transition-backgroundSize'
|
||||||
}
|
])
|
||||||
|
>
|
||||||
if (empty($groupHover)) {
|
{!! $slot !!}
|
||||||
$groupHover = false;
|
|
||||||
}
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<span class="bg-no-repeat bg-0-2 bg-0-full {{ $groupHover ? 'group-hover:bg-full-2' : 'hover:bg-full-2' }} bg-gradient-to-b from-transparent {{ $color }} transition-backgroundSize">
|
|
||||||
{!! $slot !!}
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user