feat: wip tui updates
This commit is contained in:
parent
5d7e9d79c4
commit
dde2d98a84
5 changed files with 158 additions and 24 deletions
43
tui/notifications.go
Normal file
43
tui/notifications.go
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package tui
|
||||
|
||||
import tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
type (
|
||||
NotificationScreenModel struct{
|
||||
Size Size
|
||||
}
|
||||
|
||||
SwitchNotificationScreenMsg struct{}
|
||||
)
|
||||
|
||||
func SwitchNotificationScreen() tea.Msg {
|
||||
return SwitchNotificationScreenMsg{}
|
||||
}
|
||||
|
||||
func NewNotificationScreen() NotificationScreenModel {
|
||||
return NotificationScreenModel{}
|
||||
}
|
||||
|
||||
func (m NotificationScreenModel) Init() tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m NotificationScreenModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
var cmd tea.Cmd
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
case "q", "ctrl-c":
|
||||
cmd = tea.Quit
|
||||
case "H":
|
||||
cmd = SwitchHomeScreen
|
||||
}
|
||||
}
|
||||
|
||||
return m, cmd
|
||||
}
|
||||
|
||||
func (m NotificationScreenModel) View() string {
|
||||
return "notification screen"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue