fix(ui): move url style into its own

Ayman Bagabas created

Change summary

ui/pages/repo/repo.go | 5 +----
ui/styles/styles.go   | 5 +++++
2 files changed, 6 insertions(+), 4 deletions(-)

Detailed changes

ui/pages/repo/repo.go 🔗

@@ -310,10 +310,7 @@ func (r *Repo) headerView() string {
 	} else {
 		desc = r.common.Styles.Repo.HeaderDesc.Render(desc)
 	}
-	// TODO move this into a style.
-	urlStyle := lipgloss.NewStyle().
-		MarginLeft(1).
-		Foreground(lipgloss.Color("168")).
+	urlStyle := r.common.Styles.URLStyle.Copy().
 		Width(r.common.Width - lipgloss.Width(desc) - 1).
 		Align(lipgloss.Right)
 	url := git.RepoURL(cfg.Host, cfg.Port, r.selectedRepo.Repo())

ui/styles/styles.go 🔗

@@ -53,6 +53,7 @@ type Styles struct {
 	HelpKey     lipgloss.Style
 	HelpValue   lipgloss.Style
 	HelpDivider lipgloss.Style
+	URLStyle    lipgloss.Style
 
 	Error      lipgloss.Style
 	ErrorTitle lipgloss.Style
@@ -257,6 +258,10 @@ func DefaultStyles() *Styles {
 		Foreground(lipgloss.Color("237")).
 		SetString(" • ")
 
+	s.URLStyle = lipgloss.NewStyle().
+		MarginLeft(1).
+		Foreground(lipgloss.Color("168"))
+
 	s.Error = lipgloss.NewStyle().
 		MarginTop(2)