diff --git a/src/Buttons/Button.php b/src/Buttons/Button.php index 4759c19..f67f10a 100644 --- a/src/Buttons/Button.php +++ b/src/Buttons/Button.php @@ -10,6 +10,7 @@ class Button implements Renderable, ReceivesData { protected $text; + protected $icon; protected $action_type; protected $url_template; protected $data_attributes = []; @@ -47,6 +48,16 @@ public function mergeAttributes(array $attributes) : Button return $this; } + public function getIcon() + { + return $this->icon; + } + + public function setIcon(string $icon) + { + $this->icon = $icon; + } + public function getText() : string { return $this->text; @@ -126,6 +137,6 @@ public function hasAttribute($key) public function render() { - return view('_components.button')->with('button', $this); + return view('core::button')->with('button', $this); } } diff --git a/src/Buttons/ButtonGroupDropdown.php b/src/Buttons/ButtonGroupDropdown.php index 9cab767..a082983 100644 --- a/src/Buttons/ButtonGroupDropdown.php +++ b/src/Buttons/ButtonGroupDropdown.php @@ -68,6 +68,6 @@ public function setTarget($target) public function render() { - return view('_components.button_group_dropdown')->with('button', $this); + return view('core::button_group_dropdown')->with('button', $this); } } diff --git a/src/Buttons/ImageButton.php b/src/Buttons/ImageButton.php index 90d2cc2..745ea24 100644 --- a/src/Buttons/ImageButton.php +++ b/src/Buttons/ImageButton.php @@ -16,7 +16,7 @@ public function __construct($img_url, $route) public function render() { - return view('_components.image_button')->with('button', $this); + return view('core::image_button')->with('button', $this); } public function getImage() diff --git a/src/Buttons/PostButton.php b/src/Buttons/PostButton.php index 3ed610c..7216189 100644 --- a/src/Buttons/PostButton.php +++ b/src/Buttons/PostButton.php @@ -16,7 +16,7 @@ public function __construct($text, $action, $data, BaseBtnType $btn_type) public function render() { - return view('_components.post_button')->with('button', $this); + return view('core::post_button')->with('button', $this); } public function data() diff --git a/src/views/button.blade.php b/src/views/button.blade.php new file mode 100644 index 0000000..1389502 --- /dev/null +++ b/src/views/button.blade.php @@ -0,0 +1,15 @@ +@if($button->isButton()) + +@else + attributes() !!}> + @if($button->getIcon() != '') + + @endif + {{ $button->getText() }} + +@endif \ No newline at end of file diff --git a/src/views/button_group_dropdown.blade.php b/src/views/button_group_dropdown.blade.php new file mode 100644 index 0000000..a115e1b --- /dev/null +++ b/src/views/button_group_dropdown.blade.php @@ -0,0 +1,18 @@ +