Skip to content

Commit

Permalink
Add input text color setting
Browse files Browse the repository at this point in the history
  • Loading branch information
tonning committed Dec 30, 2024
1 parent c5aa791 commit 48dbd6b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
public function up(): void
{
$this->migrator->add('mailcoach.promotion_bar_input_text_color', '#000');
}

public function down()
{
$this->migrator->delete('mailcoach.promotion_bar_input_text_color');
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class="mailcoach-text-center"
name="email"
wire:model="email"
class="mailcoach-ml-4 mailcoach-h-8 mailcoach-border-0 {{ $this->settings->promotion_bar_radius }} mailcoach-text-sm mailcoach-w-60"
style="background-color: {{ $this->settings->promotion_bar_input_background_color }}"
style="background-color: {{ $this->settings->promotion_bar_input_background_color }}; color: {{ $this->settings->promotion_bar_input_text_color }}"
placeholder="{{ $this->settings->promotion_bar_input_placeholder }}"
>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
wire:model="settings.promotion_bar_input_background_color"
/>

<x-lego::color-picker
label="Input Text Color"
wire:model="settings.promotion_bar_input_text_color"
/>

<x-lego::color-picker
label="Button Background Color"
wire:model="settings.promotion_bar_button_background_color"
Expand Down
1 change: 1 addition & 0 deletions src/Extensions/Marketing/PromotionBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function rules(): array
'settings.promotion_bar_background_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_text_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_input_background_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_input_text_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_button_background_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_button_text_color' => Rule::requiredIf($this->settings->enabled === true),
'settings.promotion_bar_radius' => Rule::requiredIf($this->settings->enabled === true),
Expand Down
1 change: 1 addition & 0 deletions src/Settings/MailcoachSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class MailcoachSettings extends AppSettings
public string $promotion_bar_background_color;
public string $promotion_bar_text_color;
public string $promotion_bar_input_background_color;
public string $promotion_bar_input_text_color;
public string $promotion_bar_button_background_color;
public string $promotion_bar_button_text_color;
public string $promotion_bar_radius;
Expand Down

0 comments on commit 48dbd6b

Please sign in to comment.