mirror of
https://github.com/zoriya/vex.git
synced 2026-06-07 12:15:35 +00:00
43 lines
764 B
Go
43 lines
764 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/charmbracelet/lipgloss"
|
|
. "github.com/zoryia/vex/tui/pages"
|
|
)
|
|
|
|
func (m Model) AuthView() string {
|
|
return lipgloss.JoinHorizontal(
|
|
lipgloss.Left,
|
|
m.auth.LoginForm.View(),
|
|
m.auth.RegisterForm.View(),
|
|
)
|
|
}
|
|
func (m Model) EntriesView() string {
|
|
return m.list.View()
|
|
}
|
|
func (m Model) FeedsView() string {
|
|
return fmt.Sprintf("%s ", *m.auth.Jwt)
|
|
}
|
|
func (m Model) TagsView() string {
|
|
return ""
|
|
}
|
|
func (m Model) View() string {
|
|
switch m.page {
|
|
case LOGIN:
|
|
return m.AuthView()
|
|
case REGISTER:
|
|
return m.AuthView()
|
|
case ENTRIES:
|
|
return m.EntriesView()
|
|
case FEEDS:
|
|
return m.FeedsView()
|
|
case TAGS:
|
|
return m.TagsView()
|
|
case PREVIEW:
|
|
return m.Preview.View()
|
|
}
|
|
return "Really unexpected state, get help"
|
|
}
|