diff --git a/ui/toolkit/dialog.go b/ui/toolkit/dialog.go index 05f10fb..56b2a41 100644 --- a/ui/toolkit/dialog.go +++ b/ui/toolkit/dialog.go @@ -6,7 +6,7 @@ import ( "github.com/charmbracelet/lipgloss" ) -func (tk *ToolKit) Dialog(title string, content string) string { +func (tk *ToolKit) Dialog(title string, content string, bbar bool) string { var view strings.Builder = strings.Builder{} var style lipgloss.Style @@ -27,16 +27,25 @@ func (tk *ToolKit) Dialog(title string, content string) string { } bindings = append(bindings, "esc close") - bottombar := tk.theme.DialogBox.Bottombar. - Width(tk.ViewWidth()). - Render(strings.Join(bindings, " · ")) + var ui string + if bbar { + bottombar := tk.theme.DialogBox.Bottombar. + Width(tk.ViewWidth()). + Render(strings.Join(bindings, " · ")) - ui := lipgloss.JoinVertical( - lipgloss.Center, - titlebar, - content, - bottombar, - ) + ui = lipgloss.JoinVertical( + lipgloss.Center, + titlebar, + content, + bottombar, + ) + } else { + ui = lipgloss.JoinVertical( + lipgloss.Center, + titlebar, + content, + ) + } var tmp string if tk.IsFocused() { diff --git a/ui/windows/postcreate/view.go b/ui/windows/postcreate/view.go index 1425cf9..412c62c 100644 --- a/ui/windows/postcreate/view.go +++ b/ui/windows/postcreate/view.go @@ -46,6 +46,7 @@ func buildView(mi interface{}, cached bool) string { return m.tk.Dialog( title, m.textarea.View(), + true, ) } diff --git a/ui/windows/postshow/view.go b/ui/windows/postshow/view.go index 22ab727..2b1b0bb 100644 --- a/ui/windows/postshow/view.go +++ b/ui/windows/postshow/view.go @@ -27,6 +27,7 @@ func buildView(mi interface{}, cached bool) string { return m.tk.Dialog( "Post", viewportStyle.Render(m.viewport.View()), + true, ) }