diff --git a/internal/app/app.go b/internal/app/app.go index b7f69c8..dd6f4b6 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -5,8 +5,10 @@ import ( "strings" tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" "github.com/dustin-ward/termtyping/internal/character" "github.com/dustin-ward/termtyping/internal/data" + "github.com/dustin-ward/termtyping/internal/statusbar" "github.com/dustin-ward/termtyping/internal/styles" ) @@ -24,6 +26,8 @@ type AppModel struct { text string pos int quitting bool + + status_bar statusbar.StatusBarModel } // Number of words to use per each test @@ -112,5 +116,9 @@ func (m AppModel) View() string { view_text = b.String() } - return styles.TextBox.Render(view_text) + return styles.BorderStyle.Render(lipgloss.JoinVertical( + lipgloss.Left, + styles.StatusBar.Render(m.status_bar.View()), + styles.TextBox.Render(view_text), + )) } diff --git a/internal/statusbar/status_bar.go b/internal/statusbar/status_bar.go new file mode 100644 index 0000000..082be72 --- /dev/null +++ b/internal/statusbar/status_bar.go @@ -0,0 +1,18 @@ +package statusbar + +import tea "github.com/charmbracelet/bubbletea" + +type StatusBarModel struct { +} + +func (m StatusBarModel) Init() tea.Cmd { + return nil +} + +func (m StatusBarModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + return m, nil +} + +func (m StatusBarModel) View() string { + return "TEST" +} diff --git a/internal/styles/styles.go b/internal/styles/styles.go index 6abab66..b55be1b 100644 --- a/internal/styles/styles.go +++ b/internal/styles/styles.go @@ -14,5 +14,7 @@ var ( RemainingText = lipgloss.NewStyle().Foreground(LightGrey) ActiveText = lipgloss.NewStyle().Foreground(White) - TextBox = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).Width(APP_WIDTH).Padding(1, 2).Margin(0, 2).Foreground(White) + TextBox = lipgloss.NewStyle().Width(APP_WIDTH).Margin(0, 2) + StatusBar = lipgloss.NewStyle().Width(APP_WIDTH).Margin(0, 2).Border(lipgloss.NormalBorder()).BorderForeground(LightGrey).BorderTop(false).BorderLeft(false).BorderRight(false) + BorderStyle = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).Foreground(White) )