Add LOA feature, improve components
This commit is contained in:
@@ -25,20 +25,26 @@ use Illuminate\View\Component;
|
||||
|
||||
class Alert extends Component
|
||||
{
|
||||
public $alertType;
|
||||
|
||||
public $extraStyling;
|
||||
public
|
||||
$alertType,
|
||||
$extraStyling,
|
||||
$title,
|
||||
$icon;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @param $alertType
|
||||
* @param string $extraStyling
|
||||
* @param string $alertType The color the alert should have.
|
||||
* @param string $title The alert's title
|
||||
* @param string $icon The alert's icon, placed before the title
|
||||
* @param string $extraStyling Any extra CSS classes to add
|
||||
*/
|
||||
public function __construct($alertType, $extraStyling = '')
|
||||
public function __construct(string $alertType, string $title = '', string $icon = '', string $extraStyling = '')
|
||||
{
|
||||
$this->alertType = $alertType;
|
||||
$this->extraStyling = $extraStyling;
|
||||
$this->icon = $icon;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
40
app/View/Components/Button.php
Normal file
40
app/View/Components/Button.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class Button extends Component
|
||||
{
|
||||
public string
|
||||
$type,
|
||||
$icon,
|
||||
$link,
|
||||
$target,
|
||||
$size,
|
||||
$color,
|
||||
$disabled,
|
||||
$id;
|
||||
|
||||
public function __construct($id, $color, $type = 'button', $disabled = false, $size = '', $target = '', $link = '', $icon = '')
|
||||
{
|
||||
$this->link = $link;
|
||||
$this->disabled = $disabled;
|
||||
$this->type = $type;
|
||||
$this->target = $target;
|
||||
$this->size = $size;
|
||||
$this->color = $color;
|
||||
$this->id = $id;
|
||||
$this->icon = $icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.button');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user