mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
merge: @luxfi/brand as canonical Lux brand source
This commit is contained in:
@@ -4,30 +4,50 @@
|
||||
// block and API host at mount time. This file is the only place where
|
||||
// Lux-specific text/logos/colors live in the build.
|
||||
//
|
||||
// Source of truth for the Lux brand block: @luxfi/brand
|
||||
// (https://github.com/luxfi/brand). We read every Lux value from the
|
||||
// package's brand.json so a brand bump in the package propagates here
|
||||
// on the next install — no string copies, no drift. The JSON subpath
|
||||
// is used because the npm-published @luxfi/[email protected] omits its .d.ts
|
||||
// shipping artefact; brand.json is included and TypeScript infers full
|
||||
// literal types from it under `resolveJsonModule`.
|
||||
//
|
||||
// Logo source of truth: @luxfi/logo (https://github.com/luxfi/logo).
|
||||
// We import the canonical SVG generator and inline it as a data URL so
|
||||
// the build artifact has zero external dependencies for the brand mark.
|
||||
|
||||
import type { BridgeConfig } from '@luxfi/bridge'
|
||||
import luxBrandJson from '@luxfi/brand/brand.json'
|
||||
import { getColorSVG } from '@luxfi/logo'
|
||||
|
||||
const luxBrand = luxBrandJson.brand
|
||||
|
||||
const luxLogoDataUrl = `data:image/svg+xml;utf8,${encodeURIComponent(getColorSVG())}`
|
||||
|
||||
// `import.meta.env` is Vite's standard env namespace; missing values fall back
|
||||
// to the production network.
|
||||
// to values read from @luxfi/brand (which in turn defaults to the production
|
||||
// Lux network).
|
||||
const env = import.meta.env
|
||||
|
||||
const fallbackApiHost = luxBrand.appDomain
|
||||
? `https://api.bridge.${luxBrand.appDomain}`
|
||||
: 'https://api.bridge.lux.network'
|
||||
const fallbackDocsUrl = luxBrand.docsDomain
|
||||
? `https://${luxBrand.docsDomain}/bridge`
|
||||
: 'https://docs.lux.network/bridge'
|
||||
|
||||
export const bridgeConfig: BridgeConfig = {
|
||||
apiHost: env.VITE_BRIDGE_API_HOST ?? 'https://api.bridge.lux.network',
|
||||
apiHost: env.VITE_BRIDGE_API_HOST ?? fallbackApiHost,
|
||||
env: env.VITE_BRIDGE_ENV ?? 'mainnet',
|
||||
clientId: env.VITE_BRIDGE_CLIENT_ID,
|
||||
iamOrg: env.VITE_BRIDGE_IAM_ORG ?? 'lux',
|
||||
brand: {
|
||||
name: 'Lux Bridge',
|
||||
name: `${luxBrand.shortName ?? 'Lux'} Bridge`,
|
||||
logoUrl: env.VITE_BRIDGE_LOGO_URL ?? luxLogoDataUrl,
|
||||
primaryColor: '#5b8def',
|
||||
secondaryColor: '#7a9ff5',
|
||||
supportEmail: '[email protected]',
|
||||
docsUrl: 'https://docs.lux.network/bridge',
|
||||
primaryColor: luxBrand.primaryColor ?? '#000000',
|
||||
secondaryColor:
|
||||
luxBrand.theme?.dark?.accent1 ?? luxBrand.theme?.light?.accent1,
|
||||
supportEmail: luxBrand.supportEmail ?? 'support@lux.network',
|
||||
docsUrl: fallbackDocsUrl,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user