Sebastian Mark
8a0ef32c91
- implement TUI in bubbletea - split components into separate files - remove now unused functions - restructure files
24 lines
556 B
Go
24 lines
556 B
Go
package client
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"git.smsvc.net/pomodoro/ChronoTomato/cmd/client/helper"
|
|
GoTomato "git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
|
)
|
|
|
|
func (a app) View() string {
|
|
var body string
|
|
|
|
if a.pomodoro != (GoTomato.ServerMessage{}) {
|
|
body = helper.TerminalOutput(a.pomodoro)
|
|
helper.DesktopNotifications(a.pomodoro)
|
|
} else {
|
|
body = "Waiting for first server message..."
|
|
}
|
|
|
|
helpView := a.help.View(a.keys)
|
|
height := 8 - strings.Count(body, "\n") - strings.Count(helpView, "\n")
|
|
|
|
return body + strings.Repeat("\n", height) + helpView
|
|
}
|