From 56c2bdda2029024d23b24b597a6a68d42ba16c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 9 Feb 2024 19:20:38 +0100 Subject: [PATCH] Refactor subscription plan switch component and add form validation --- .../subscription-plan-switch.blade.php | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php b/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php index c1be68fc7043..91520780ad8c 100644 --- a/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php @@ -1,9 +1,47 @@
- + @if($errors->any()) +
+ @foreach($errors->all() as $error) +

{{ $error }}

+ @endforeach +
+ @endif + + @if($state['show_rff']) +
+ @if(strlen(auth()->guard('contact')->user()->first_name) === 0) +
+ + +
+ @endif - @if($amount > 0) + @if(strlen(auth()->guard('contact')->user()->last_name) === 0) +
+ + +
+ @endif + + @if(strlen(auth()->guard('contact')->user()->email) === 0) +
+ + +
+ @endif + +
+ +
+
+ @endif + + + @if($amount > 0 && $state['show_rff'] == false)
@@ -33,6 +71,9 @@ + + + @@ -62,7 +103,7 @@ @endif
- @elseif($amount <= 0) + @elseif($amount <= 0 && $state['show_rff'] == false)