f779018b370c0f4976988258d0aa51fc50633da1

Author
Christian Rocha <christian@rocha.is>
Committer
Christian Rocha <christian@rocha.is>
Date

Message

Colorize repo title and clone command

Diff

 1diff --git a/tui/bubbles/repo/bubble.go b/tui/bubbles/repo/bubble.go
 2index eafba0df5b29ca629df8d0b942e047f811cd54bf..609fd2dace458b3b2584030d9c57ae4b985f10eb 100644
 3--- a/tui/bubbles/repo/bubble.go
 4+++ b/tui/bubbles/repo/bubble.go
 5@@ -107,20 +107,18 @@ func (b Bubble) headerView() string {
 6 		n = "Home"
 7 	}
 8 	title := ts.Render(n)
 9-	note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)).
10-		Render(b.sshAddress())
11+	note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)).Render(b.sshAddress())
12 	return lipgloss.JoinHorizontal(lipgloss.Top, title, note)
13 }
14 
15 func (b *Bubble) View() string {
16-	s := b.styles
17 	header := b.headerView()
18-	bs := s.RepoBody.Copy()
19+	bs := b.styles.RepoBody.Copy()
20 	if b.Active {
21-		bs = bs.BorderForeground(s.ActiveBorderColor)
22+		bs = bs.BorderForeground(b.styles.ActiveBorderColor)
23 	}
24 	body := bs.
25-		Width(b.width - b.widthMargin - s.RepoBody.GetVerticalFrameSize()).
26+		Width(b.width - b.widthMargin - b.styles.RepoBody.GetVerticalFrameSize()).
27 		Height(b.height - b.heightMargin - lipgloss.Height(header)).
28 		Render(b.readmeViewport.View())
29 	return header + body
30diff --git a/tui/style/style.go b/tui/style/style.go
31index aad8135b3dedb39245b750c93205a3c41480900c..5043a98a2ab67b581d3a69b5c71ace592efc6abc 100644
32--- a/tui/style/style.go
33+++ b/tui/style/style.go
34@@ -35,8 +35,6 @@ type Styles struct {
35 	Error      lipgloss.Style
36 	ErrorTitle lipgloss.Style
37 	ErrorBody  lipgloss.Style
38-
39-	Command lipgloss.Style
40 }
41 
42 func DefaultStyles() *Styles {
43@@ -108,11 +106,13 @@ func DefaultStyles() *Styles {
44 	s.RepoTitle = lipgloss.NewStyle().
45 		Border(s.RepoTitleBorder).
46 		BorderForeground(s.InactiveBorderColor).
47-		Padding(0, 2)
48+		Padding(0, 2).
49+		Foreground(lipgloss.Color("252"))
50 
51 	s.RepoNote = lipgloss.NewStyle().
52 		Border(s.RepoNoteBorder, true, true, true, false).
53 		BorderForeground(s.InactiveBorderColor).
54+		Foreground(lipgloss.Color("168")).
55 		Padding(0, 2)
56 
57 	s.RepoBody = lipgloss.NewStyle().
58@@ -147,9 +147,5 @@ func DefaultStyles() *Styles {
59 		MarginLeft(2).
60 		Width(52) // for now
61 
62-	s.Command = lipgloss.NewStyle().
63-		Background(lipgloss.Color("237")).
64-		Foreground(lipgloss.Color("204"))
65-
66 	return s
67 }