diff --git a/app/View/Components/Alert.php b/app/View/Components/Alert.php new file mode 100644 index 000000000..eba2d61af --- /dev/null +++ b/app/View/Components/Alert.php @@ -0,0 +1,96 @@ +rounded = $rounded; + $this->border = $border; + + $this->color = $this->getColor($color); + $this->icon = $this->getIcon($icon); + + $this->title = $title; + $this->description = $description; + + $this->list = $list; + $this->actions = $actions; + + $this->dismiss = $dismiss; + } + + /** + * Get the view / contents that represent the component. + * + * @return \Illuminate\Contracts\View\View|string + */ + public function render() + { + return view('components.alert.index'); + } + + protected function getColor($color) + { + if (! empty($color)) { + return $color; + } + + $color = 'green'; + + return $color; + } + + protected function getIcon($icon) + { + if (! empty($icon)) { + return $icon; + } + + $icon = 'check_circle'; + + return $icon; + } +} diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 07819fa41..849f76b98 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -228,6 +228,7 @@ return [ 'preview_mode' => 'Preview Mode', 'go_back' => 'Go back to :type', 'validation_error' => 'Validation error', + 'dismiss' => 'Dismiss', 'card' => [ 'cards' => 'Card|Cards', diff --git a/resources/views/components/alert/index.blade.php b/resources/views/components/alert/index.blade.php new file mode 100644 index 000000000..85b70dc39 --- /dev/null +++ b/resources/views/components/alert/index.blade.php @@ -0,0 +1,104 @@ +
{{ $description }}
+ + @if ($list) +