dd6f492032c27f89a0d8ae56d9735004b0e3c6ad

Author
Christian Rocha <christian@rocha.is>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

chore: minor tidying up

Diff

 1diff --git a/ui/components/header/header.go b/ui/components/header/header.go
 2index b490ab1e3f64aac66777a2ec48bf79df10a1c822..32e9cf04496a9ec0edc20a381f13f59754c5f863 100644
 3--- a/ui/components/header/header.go
 4+++ b/ui/components/header/header.go
 5@@ -15,11 +15,10 @@ type Header struct {
 6 
 7 // New creates a new header component.
 8 func New(c common.Common, text string) *Header {
 9-	h := &Header{
10+	return &Header{
11 		common: c,
12 		text:   text,
13 	}
14-	return h
15 }
16 
17 // SetSize implements common.Component.
18@@ -39,6 +38,5 @@ func (h *Header) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
19 
20 // View implements tea.Model.
21 func (h *Header) View() string {
22-	s := h.common.Styles.Header.Copy().Width(h.common.Width)
23-	return s.Render(strings.TrimSpace(h.text))
24+	return h.common.Styles.ServerName.Render(strings.TrimSpace(h.text))
25 }
26diff --git a/ui/ui.go b/ui/ui.go
27index 052e5ad654904d1cbacc960f97645d7dde2f373a..23070282e2bbdd8a3d4e28cf9a59d289f350b988 100644
28--- a/ui/ui.go
29+++ b/ui/ui.go
30@@ -260,13 +260,11 @@ func (ui *UI) View() string {
31 	default:
32 		view = "Unknown state :/ this is a bug!"
33 	}
34-	switch ui.activePage {
35-	case selectionPage:
36+	if ui.activePage == selectionPage {
37 		view = lipgloss.JoinVertical(lipgloss.Bottom,
38 			ui.header.View(),
39 			view,
40 		)
41-	case repoPage:
42 	}
43 	if ui.showFooter {
44 		view = lipgloss.JoinVertical(lipgloss.Bottom,
45@@ -274,9 +272,7 @@ func (ui *UI) View() string {
46 			ui.footer.View(),
47 		)
48 	}
49-	return style.Render(
50-		view,
51-	)
52+	return style.Render(view)
53 }
54 
55 func (ui *UI) setRepoCmd(rn string) tea.Cmd {