fix: remove hardcoded branding, use config-driven chain name everywhere

- Fix TS error in safeFormats plugin (use any for dayjsClass parameter)
- Replace hardcoded "Blockscout" with config.chain.name in DeFiDropdown
- Replace hardcoded "LUX" SVG text with config.chain.name in LogoFallback
- Use config.chain.name in NetworkIcon fallback aria-label
- Delete unused lux-logo.tsx (dead code with hardcoded branding)
This commit is contained in:
2026-02-25 11:01:28 -08:00
parent 0cddfbf1ab
commit 82213f6b7b
5 changed files with 8 additions and 117 deletions
+3 -3
View File
@@ -46,11 +46,11 @@ const relativeTimeConfig = {
// tokens (lll, llll) are used on a locale without formats. This plugin ensures
// formats are always present on whichever locale the instance uses.
// Must be registered AFTER localizedFormat.
const safeFormats: dayjs.PluginFunc = (_option, dayjsClass) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const safeFormats: dayjs.PluginFunc = (_option, dayjsClass: any) => {
const wrappedFormat = dayjsClass.prototype.format;
dayjsClass.prototype.format = function(formatStr?: string) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const locale = this.$locale() as any;
const locale = this.$locale();
if (locale && !locale.formats) {
locale.formats = LUX_FORMATS;
}
-109
View File
@@ -1,109 +0,0 @@
import React from 'react';
interface LuxLogoProps {
width?: number;
height?: number;
className?: string;
variant?: 'icon' | 'wordmark' | 'full';
}
export const LuxLogo: React.FC<LuxLogoProps> = ({
width = 50,
height = 50,
className = '',
variant = 'icon',
}) => {
// LUX triangle icon (downward-pointing black triangle)
const renderIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 50 50"
width={ width }
height={ height }
className={ className }
>
<polygon
points="25,46.65 50,3.35 0,3.35"
fill="currentColor"
/>
</svg>
);
// LUX wordmark in Inter font
const renderWordmark = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 30"
width={ width * 2 }
height={ height * 0.6 }
className={ className }
>
<text
x="0"
y="23"
fontFamily="Geist Sans, sans-serif"
fontSize="28"
fontWeight="700"
letterSpacing="-0.02em"
fill="currentColor"
>
LUX
</text>
</svg>
);
// Full logo with icon and wordmark
const renderFull = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 150 50"
width={ width * 3 }
height={ height }
className={ className }
>
{ /* Triangle icon */ }
<polygon
points="25,46.65 50,3.35 0,3.35"
fill="currentColor"
/>
{ /* Wordmark */ }
<text
x="60"
y="35"
fontFamily="Geist Sans, sans-serif"
fontSize="32"
fontWeight="700"
letterSpacing="-0.02em"
fill="currentColor"
>
LUX
</text>
</svg>
);
switch (variant) {
case 'wordmark':
return renderWordmark();
case 'full':
return renderFull();
case 'icon':
default:
return renderIcon();
}
};
// Emoji version
export const LuxEmoji = () => '▼';
// Export variants for easy use
export const LuxIcon = (props: Omit<LuxLogoProps, 'variant'>) => (
<LuxLogo { ...props } variant="icon"/>
);
export const LuxWordmark = (props: Omit<LuxLogoProps, 'variant'>) => (
<LuxLogo { ...props } variant="wordmark"/>
);
export const LuxFullLogo = (props: Omit<LuxLogoProps, 'variant'>) => (
<LuxLogo { ...props } variant="full"/>
);
+1 -1
View File
@@ -11,7 +11,7 @@ import { INVERT_FILTER } from './consts';
const IconFallback = () => {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="30" height="30" aria-label="LUX Network icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="30" height="30" aria-label={ `${ config.chain.name } icon` }>
<polygon points="25,46.65 50,3.35 0,3.35" fill="currentColor"/>
</svg>
);
+3 -3
View File
@@ -15,9 +15,9 @@ const LogoFallback = () => {
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="24" height="24">
<polygon points="25,46.65 50,3.35 0,3.35" fill="currentColor"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 30" width="72" height="20">
<text x="0" y="23" fontFamily="Geist Sans, sans-serif" fontSize="28" fontWeight="700" letterSpacing="-0.02em" fill="currentColor">LUX</text>
</svg>
<chakra.span fontWeight="700" fontSize="lg" letterSpacing="-0.02em">
{ config.chain.name }
</chakra.span>
</Flex>
);
};
+1 -1
View File
@@ -39,7 +39,7 @@ const DeFiDropdown = () => {
<PopoverTrigger>
<Button size="2xs" gap={ 0 }>
<chakra.span display={{ base: 'none', lg: 'inline' }} whiteSpace="pre-wrap">
Blockscout{ space }
{ config.chain.name || 'Explorer' }{ space }
</chakra.span>
DeFi
<IconSvg name="arrows/east-mini" boxSize={ 4 } ml={ 1 } transform="rotate(-90deg)"/>