cleanup model View() a bit
remove some cruft and verbosity and weird order of things
This commit is contained in:
parent
1a03f7f23f
commit
50e8c992d1
|
@ -222,22 +222,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
return m, cmd
|
return m, cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m model) View() (out string) {
|
func (m model) View() string {
|
||||||
var (
|
var panels []string
|
||||||
n string
|
|
||||||
panels []string = []string{
|
|
||||||
style.Render(m.table.View()),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
panels = append(panels, m.footer())
|
|
||||||
|
|
||||||
if m.mode != modes.Listing {
|
if m.mode != modes.Listing {
|
||||||
panels = append([]string{m.header()}, panels...)
|
panels = append(panels, m.header())
|
||||||
}
|
}
|
||||||
|
panels = append(panels, style.Render(m.table.View()), m.footer())
|
||||||
|
|
||||||
out = lipgloss.JoinVertical(lipgloss.Top, panels...)
|
return lipgloss.JoinVertical(lipgloss.Top, panels...)
|
||||||
return out + n
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m model) showHelp() string {
|
func (m model) showHelp() string {
|
||||||
|
|
Loading…
Reference in a new issue