diff --git a/app/View/Components/Utils/Notice.php b/app/View/Components/Utils/Notice.php new file mode 100644 index 0000000..32fe5ac --- /dev/null +++ b/app/View/Components/Utils/Notice.php @@ -0,0 +1,32 @@ + 'flex-col-reverse', + 'top-right' => 'flex-col', + ]; + + public string $position; + + public function __construct( + #[Config('utils.notice.position')] string $position, + #[Config('utils.notice.auto_close')] public bool $autoClose, + #[Config('utils.notice.time_close')] public int $timeClose, + ) { + $this->position = $this->positions[$position]; + } + + public function render(): View + { + return view('components.utils.notice'); + } +} diff --git a/config/utils.php b/config/utils.php new file mode 100644 index 0000000..17418ba --- /dev/null +++ b/config/utils.php @@ -0,0 +1,9 @@ + [ + 'position' => 'top-right', + 'auto_close' => true, + 'time_close' => 5000, // ms + ], +]; diff --git a/resources/views/components/utils/notice.blade.php b/resources/views/components/utils/notice.blade.php index 94eaf1f..7027f80 100644 --- a/resources/views/components/utils/notice.blade.php +++ b/resources/views/components/utils/notice.blade.php @@ -2,7 +2,10 @@