mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
Replace logo with custom ASCII (#958)
This commit is contained in:
parent
95e4a60a83
commit
f8a31f29aa
4 changed files with 79 additions and 25 deletions
|
|
@ -8,30 +8,39 @@ import React from 'react';
|
|||
import { Box, Text } from 'ink';
|
||||
import Gradient from 'ink-gradient';
|
||||
import { Colors } from '../colors.js';
|
||||
|
||||
const asciiArtLogo = `
|
||||
██████╗ ███████╗███╗ ███╗██╗███╗ ██╗██╗
|
||||
██╔════╝ ██╔════╝████╗ ████║██║████╗ ██║██║
|
||||
██║ ███╗█████╗ ██╔████╔██║██║██╔██╗ ██║██║
|
||||
██║ ██║██╔══╝ ██║╚██╔╝██║██║██║╚██╗██║██║
|
||||
╚██████╔╝███████╗██║ ╚═╝ ██║██║██║ ╚████║██║
|
||||
╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝
|
||||
`;
|
||||
import { shortAsciiLogo, longAsciiLogo } from './AsciiArt.js';
|
||||
import { getAsciiArtWidth } from '../utils/textUtils.js';
|
||||
|
||||
interface HeaderProps {
|
||||
title?: string;
|
||||
customAsciiArt?: string; // For user-defined ASCII art
|
||||
terminalWidth: number; // For responsive logo
|
||||
}
|
||||
|
||||
export const Header: React.FC<HeaderProps> = ({ title = asciiArtLogo }) => (
|
||||
<>
|
||||
<Box marginBottom={1} alignItems="flex-start">
|
||||
{Colors.GradientColors ? (
|
||||
<Gradient colors={Colors.GradientColors}>
|
||||
<Text>{title}</Text>
|
||||
</Gradient>
|
||||
) : (
|
||||
<Text>{title}</Text>
|
||||
)}
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
export const Header: React.FC<HeaderProps> = ({
|
||||
customAsciiArt,
|
||||
terminalWidth,
|
||||
}) => {
|
||||
let displayTitle;
|
||||
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
|
||||
|
||||
if (customAsciiArt) {
|
||||
displayTitle = customAsciiArt;
|
||||
} else {
|
||||
displayTitle =
|
||||
terminalWidth >= widthOfLongLogo ? longAsciiLogo : shortAsciiLogo;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box marginBottom={1} alignItems="flex-start">
|
||||
{Colors.GradientColors ? (
|
||||
<Gradient colors={Colors.GradientColors}>
|
||||
<Text>{displayTitle}</Text>
|
||||
</Gradient>
|
||||
) : (
|
||||
<Text>{displayTitle}</Text>
|
||||
)}
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue