Change summary
ui/components/header/header.go | 6 ++----
ui/ui.go | 8 ++------
2 files changed, 4 insertions(+), 10 deletions(-)
Detailed changes
@@ -15,11 +15,10 @@ type Header struct {
// New creates a new header component.
func New(c common.Common, text string) *Header {
- h := &Header{
+ return &Header{
common: c,
text: text,
}
- return h
}
// SetSize implements common.Component.
@@ -39,6 +38,5 @@ func (h *Header) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// View implements tea.Model.
func (h *Header) View() string {
- s := h.common.Styles.Header.Copy().Width(h.common.Width)
- return s.Render(strings.TrimSpace(h.text))
+ return h.common.Styles.ServerName.Render(strings.TrimSpace(h.text))
}
@@ -260,13 +260,11 @@ func (ui *UI) View() string {
default:
view = "Unknown state :/ this is a bug!"
}
- switch ui.activePage {
- case selectionPage:
+ if ui.activePage == selectionPage {
view = lipgloss.JoinVertical(lipgloss.Bottom,
ui.header.View(),
view,
)
- case repoPage:
}
if ui.showFooter {
view = lipgloss.JoinVertical(lipgloss.Bottom,
@@ -274,9 +272,7 @@ func (ui *UI) View() string {
ui.footer.View(),
)
}
- return style.Render(
- view,
- )
+ return style.Render(view)
}
func (ui *UI) setRepoCmd(rn string) tea.Cmd {