Colorize repo title and clone command

Christian Rocha created

Change summary

tui/bubbles/repo/bubble.go | 10 ++++------
tui/style/style.go         | 10 +++-------
2 files changed, 7 insertions(+), 13 deletions(-)

Detailed changes

tui/bubbles/repo/bubble.go 🔗

@@ -107,20 +107,18 @@ func (b Bubble) headerView() string {
 		n = "Home"
 	}
 	title := ts.Render(n)
-	note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)).
-		Render(b.sshAddress())
+	note := ns.Width(b.width - b.widthMargin - lipgloss.Width(title)).Render(b.sshAddress())
 	return lipgloss.JoinHorizontal(lipgloss.Top, title, note)
 }
 
 func (b *Bubble) View() string {
-	s := b.styles
 	header := b.headerView()
-	bs := s.RepoBody.Copy()
+	bs := b.styles.RepoBody.Copy()
 	if b.Active {
-		bs = bs.BorderForeground(s.ActiveBorderColor)
+		bs = bs.BorderForeground(b.styles.ActiveBorderColor)
 	}
 	body := bs.
-		Width(b.width - b.widthMargin - s.RepoBody.GetVerticalFrameSize()).
+		Width(b.width - b.widthMargin - b.styles.RepoBody.GetVerticalFrameSize()).
 		Height(b.height - b.heightMargin - lipgloss.Height(header)).
 		Render(b.readmeViewport.View())
 	return header + body

tui/style/style.go 🔗

@@ -35,8 +35,6 @@ type Styles struct {
 	Error      lipgloss.Style
 	ErrorTitle lipgloss.Style
 	ErrorBody  lipgloss.Style
-
-	Command lipgloss.Style
 }
 
 func DefaultStyles() *Styles {
@@ -108,11 +106,13 @@ func DefaultStyles() *Styles {
 	s.RepoTitle = lipgloss.NewStyle().
 		Border(s.RepoTitleBorder).
 		BorderForeground(s.InactiveBorderColor).
-		Padding(0, 2)
+		Padding(0, 2).
+		Foreground(lipgloss.Color("252"))
 
 	s.RepoNote = lipgloss.NewStyle().
 		Border(s.RepoNoteBorder, true, true, true, false).
 		BorderForeground(s.InactiveBorderColor).
+		Foreground(lipgloss.Color("168")).
 		Padding(0, 2)
 
 	s.RepoBody = lipgloss.NewStyle().
@@ -147,9 +147,5 @@ func DefaultStyles() *Styles {
 		MarginLeft(2).
 		Width(52) // for now
 
-	s.Command = lipgloss.NewStyle().
-		Background(lipgloss.Color("237")).
-		Foreground(lipgloss.Color("204"))
-
 	return s
 }