feat(get-user): expose Hamkar menu icon brand colors
Emit menu_icon_color and menu_icon_active_color when brandManaged so apps can theme nav icons separately. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -212,6 +212,8 @@ async function main() {
|
|||||||
primaryColor: primary,
|
primaryColor: primary,
|
||||||
secondaryColor: secondary,
|
secondaryColor: secondary,
|
||||||
backgroundColor: background,
|
backgroundColor: background,
|
||||||
|
menuIconColor: existingUi?.brand?.menuIconColor ?? null,
|
||||||
|
menuIconActiveColor: existingUi?.brand?.menuIconActiveColor ?? null,
|
||||||
settingsManaged: managed,
|
settingsManaged: managed,
|
||||||
brandManaged,
|
brandManaged,
|
||||||
registryMode: registryMode || existingUi?.registryMode || 'dynamicMode',
|
registryMode: registryMode || existingUi?.registryMode || 'dynamicMode',
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ export function buildHamkarUiFromBrand(input: {
|
|||||||
primaryColor?: string | null
|
primaryColor?: string | null
|
||||||
secondaryColor?: string | null
|
secondaryColor?: string | null
|
||||||
backgroundColor?: string | null
|
backgroundColor?: string | null
|
||||||
|
menuIconColor?: string | null
|
||||||
|
menuIconActiveColor?: string | null
|
||||||
settingsManaged?: boolean
|
settingsManaged?: boolean
|
||||||
brandManaged?: boolean
|
brandManaged?: boolean
|
||||||
registryMode?: string | null
|
registryMode?: string | null
|
||||||
@@ -47,6 +49,8 @@ export function buildHamkarUiFromBrand(input: {
|
|||||||
primaryColor?: string | null
|
primaryColor?: string | null
|
||||||
secondaryColor?: string | null
|
secondaryColor?: string | null
|
||||||
backgroundColor?: string | null
|
backgroundColor?: string | null
|
||||||
|
menuIconColor?: string | null
|
||||||
|
menuIconActiveColor?: string | null
|
||||||
}
|
}
|
||||||
settings?: {
|
settings?: {
|
||||||
pricing_box_theme?: string
|
pricing_box_theme?: string
|
||||||
@@ -65,6 +69,8 @@ export function buildHamkarUiFromBrand(input: {
|
|||||||
primaryColor: input.primaryColor || null,
|
primaryColor: input.primaryColor || null,
|
||||||
secondaryColor: input.secondaryColor || null,
|
secondaryColor: input.secondaryColor || null,
|
||||||
backgroundColor: input.backgroundColor || null,
|
backgroundColor: input.backgroundColor || null,
|
||||||
|
menuIconColor: input.menuIconColor || null,
|
||||||
|
menuIconActiveColor: input.menuIconActiveColor || null,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
pricing_box_theme: String(input.settings?.pricing_box_theme || '1'),
|
pricing_box_theme: String(input.settings?.pricing_box_theme || '1'),
|
||||||
@@ -83,6 +89,8 @@ export function buildHamkarUiFromBrand(input: {
|
|||||||
primaryColor: input.defaultSnapshot.brand?.primaryColor ?? null,
|
primaryColor: input.defaultSnapshot.brand?.primaryColor ?? null,
|
||||||
secondaryColor: input.defaultSnapshot.brand?.secondaryColor ?? null,
|
secondaryColor: input.defaultSnapshot.brand?.secondaryColor ?? null,
|
||||||
backgroundColor: input.defaultSnapshot.brand?.backgroundColor ?? null,
|
backgroundColor: input.defaultSnapshot.brand?.backgroundColor ?? null,
|
||||||
|
menuIconColor: input.defaultSnapshot.brand?.menuIconColor ?? null,
|
||||||
|
menuIconActiveColor: input.defaultSnapshot.brand?.menuIconActiveColor ?? null,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
pricing_box_theme: String(
|
pricing_box_theme: String(
|
||||||
|
|||||||
@@ -170,6 +170,12 @@ async function main() {
|
|||||||
backgroundColor: restore
|
backgroundColor: restore
|
||||||
? keepSnapshot.brand?.backgroundColor
|
? keepSnapshot.brand?.backgroundColor
|
||||||
: existing?.brand?.backgroundColor ?? brandBackground,
|
: existing?.brand?.backgroundColor ?? brandBackground,
|
||||||
|
menuIconColor: restore
|
||||||
|
? keepSnapshot.brand?.menuIconColor
|
||||||
|
: existing?.brand?.menuIconColor ?? null,
|
||||||
|
menuIconActiveColor: restore
|
||||||
|
? keepSnapshot.brand?.menuIconActiveColor
|
||||||
|
: existing?.brand?.menuIconActiveColor ?? null,
|
||||||
settingsManaged: Boolean(existing?.settingsManaged),
|
settingsManaged: Boolean(existing?.settingsManaged),
|
||||||
brandManaged: Boolean(existing?.brandManaged),
|
brandManaged: Boolean(existing?.brandManaged),
|
||||||
registryMode: restore
|
registryMode: restore
|
||||||
|
|||||||
@@ -128,6 +128,15 @@ export class GetUserService {
|
|||||||
*/
|
*/
|
||||||
brand_chrome:
|
brand_chrome:
|
||||||
isHamkarUi && ui?.brandManaged === true ? true : undefined,
|
isHamkarUi && ui?.brandManaged === true ? true : undefined,
|
||||||
|
/** Hamkar brand_chrome: default / selected menu+header icon strokes */
|
||||||
|
menu_icon_color:
|
||||||
|
isHamkarUi && ui?.brandManaged === true
|
||||||
|
? hamkarBrand?.menuIconColor || undefined
|
||||||
|
: undefined,
|
||||||
|
menu_icon_active_color:
|
||||||
|
isHamkarUi && ui?.brandManaged === true
|
||||||
|
? hamkarBrand?.menuIconActiveColor || undefined
|
||||||
|
: undefined,
|
||||||
/** Admin expiry modals — near/expired server, plugin, support */
|
/** Admin expiry modals — near/expired server, plugin, support */
|
||||||
subscription_alerts,
|
subscription_alerts,
|
||||||
plugin_store_enabled: isKhanegi
|
plugin_store_enabled: isKhanegi
|
||||||
|
|||||||
Reference in New Issue
Block a user