1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Updated header, added test banner

This commit is contained in:
マリウス 2023-01-01 01:59:10 -05:00
parent 6f6e1c5fad
commit 7fa6953064
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 9 additions and 10 deletions

View File

@ -10,6 +10,10 @@ import (
var (
highlight = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "#7D56F4"}
banner = "▄▗▖▎▄▗▅▖▗▅▅▖▗▅▅▖▅▅▅▖▏▉▅▅┓▅▖▎▗▅▌\n" +
"▗▎▍▄▗▗▎▏▍▝▝▘▍▝▂▉┈▂▎▍▅▋▊▂╴▏▊▗╴▋▎\n" +
"▊▉▌╴▘▁▏▏▅▆┈▏▉▇▆▌▗▖▍▎▃▎▎▅▋▋▎▗▎▍▘\n" +
"▝▄▄▄▘▇▄▆▄▄▄▝▄▄▘▝▘▝▘▏╴▄▘▄▝▘▇╴▄▘▄"
)
type Model struct {
@ -51,18 +55,13 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
}
func (m Model) View() string {
var items []string
row := lipgloss.JoinHorizontal(
lipgloss.Top,
items...,
)
var row string
if m.ctx.Loading == false {
row = lipgloss.JoinHorizontal(lipgloss.Bottom, row, " THING HERE ")
row = lipgloss.JoinHorizontal(lipgloss.Top, banner)
} else {
row = lipgloss.JoinHorizontal(lipgloss.Bottom, row, " THING HERE ", " ", m.spinner.View())
row = lipgloss.JoinHorizontal(lipgloss.Top, banner, " ", m.spinner.View())
}
return lipgloss.JoinHorizontal(lipgloss.Top, row, "\n\n")
return row
}

View File

@ -93,7 +93,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m Model) View() string {
s := strings.Builder{}
s.WriteString(m.header.View() + "\n\n")
s.WriteString(m.header.View() + "\n")
s.WriteString(m.views[m.currentView].View())
return s.String()
}