Store Branding: Apply brand color to backend as well (#5992)

* Store Branding: Apply brand color to backend as well

Closes #5990.

* Add adjustments for different theme scenarios

* Add description text

* Make it optional to apply the brand color to the backend

* Toggle color fixes
This commit is contained in:
d11n
2024-09-13 14:39:21 +02:00
committed by GitHub
parent b7ba53eb60
commit 7348a6a62f
14 changed files with 164 additions and 35 deletions

View File

@@ -34,6 +34,7 @@ public partial class UIStoresController
LogoUrl = await _uriResolver.Resolve(Request.GetAbsoluteRootUri(), storeBlob.LogoUrl),
CssUrl = await _uriResolver.Resolve(Request.GetAbsoluteRootUri(), storeBlob.CssUrl),
BrandColor = storeBlob.BrandColor,
ApplyBrandColorToBackend = storeBlob.ApplyBrandColorToBackend,
NetworkFeeMode = storeBlob.NetworkFeeMode,
AnyoneCanCreateInvoice = storeBlob.AnyoneCanInvoice,
PaymentTolerance = storeBlob.PaymentTolerance,
@@ -75,10 +76,11 @@ public partial class UIStoresController
blob.RefundBOLT11Expiration = TimeSpan.FromDays(model.BOLT11Expiration);
if (!string.IsNullOrEmpty(model.BrandColor) && !ColorPalette.IsValid(model.BrandColor))
{
ModelState.AddModelError(nameof(model.BrandColor), "Invalid color");
ModelState.AddModelError(nameof(model.BrandColor), "The brand color needs to be a valid hex color code");
return View(model);
}
blob.BrandColor = model.BrandColor;
blob.ApplyBrandColorToBackend = model.ApplyBrandColorToBackend && !string.IsNullOrEmpty(model.BrandColor);
var userId = GetUserId();
if (userId is null)