Skip to content

Commit

Permalink
fix(ui): move url style into its own
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Nov 15, 2022
1 parent b079c14 commit f65e532
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions ui/pages/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 5 additions & 0 deletions ui/styles/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f65e532

Please sign in to comment.