tips as plugin

This commit is contained in:
Sebastian Herrlinger
2026-03-25 01:46:02 +01:00
parent b178de68f0
commit 9d4b720c4f
9 changed files with 66 additions and 82 deletions

View File

@@ -636,28 +636,12 @@ const home = (input: Cfg): TuiSlotPlugin => ({
</box>
)
},
home_tips(ctx, value) {
if (!value.show_tips) return null
home_bottom(ctx) {
const skin = look(ctx.theme.current)
const text = "extra content in the unified home bottom slot"
return (
<box height={4} minHeight={0} width="100%" maxWidth={75} alignItems="center" paddingTop={3} flexShrink={1}>
<text fg={skin.muted}>
<span style={{ fg: skin.accent }}>{input.label}</span> replaces the built-in home tips slot
</text>
</box>
)
},
home_below_tips(ctx, value) {
const skin = look(ctx.theme.current)
const text = value.first_time_user
? "first-time user state"
: value.tips_hidden
? "tips are hidden"
: "extra content below tips"
return (
<box width="100%" maxWidth={75} alignItems="center" paddingTop={1} flexShrink={0}>
<box width="100%" maxWidth={75} alignItems="center" paddingTop={1} flexShrink={0} gap={1}>
<box
border
borderColor={skin.border}