Skip to content

Commit 5e66f81

Browse files
committed
feat: add banner component support
1 parent a45c364 commit 5e66f81

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

src/components/banner.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Box, Text } from "ink";
2+
import BigText from "ink-big-text";
3+
4+
interface BannerProps {
5+
text?: string;
6+
font?:
7+
| "block"
8+
| "simple"
9+
| "simpleBlock"
10+
| "3d"
11+
| "simple3d"
12+
| "chrome"
13+
| "huge";
14+
colors?: string[];
15+
align?: "left" | "center" | "right";
16+
showSubtitle?: boolean;
17+
}
18+
19+
export const Banner = ({
20+
text = "Mstudio",
21+
font = "block",
22+
colors = ["white"],
23+
align = "left",
24+
showSubtitle = true,
25+
}: BannerProps) => {
26+
return (
27+
<Box
28+
flexDirection="column"
29+
alignItems={
30+
align === "center"
31+
? "center"
32+
: align === "right"
33+
? "flex-end"
34+
: "flex-start"
35+
}
36+
>
37+
<BigText text={text} font={font} colors={colors} />
38+
{showSubtitle && (
39+
<Box marginTop={1}>
40+
<Text color="gray" dimColor>
41+
Welcome to Missing Studio CLI
42+
</Text>
43+
</Box>
44+
)}
45+
</Box>
46+
);
47+
};

src/ui/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default function App({ provider, model }: AppProps) {
5050
model: selectedModel,
5151
enabled: Boolean(selectedProvider && selectedModel && readyForApi),
5252
});
53+
5354
const [currentInput, setCurrentInput] = useState<string>("");
5455
const [showHelp, setShowHelp] = useState(false);
5556
const { exit } = useApp();

src/ui/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Box, Text } from "ink";
2-
import { AsciiLogo } from "../components/ascii-logo.js";
1+
import { Box } from "ink";
2+
import { Banner } from "../components/banner.js";
33

44
type AppLayoutProps = {
55
children: React.ReactNode;
@@ -9,7 +9,7 @@ export default function AppLayout({ children }: AppLayoutProps) {
99
return (
1010
<Box flexDirection="column" minHeight={24} padding={1}>
1111
<Box justifyContent="flex-start" marginBottom={1}>
12-
<AsciiLogo />
12+
<Banner />
1313
</Box>
1414
<Box flexGrow={1} flexDirection="column">
1515
{children}

0 commit comments

Comments
 (0)