From 86bbd2830419c4e83fd90dad0dfe19209a046641 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 12 Apr 2023 15:45:15 -0400 Subject: [PATCH] fix(ui): no items style --- ui/components/selector/selector.go | 1 + ui/pages/repo/readme.go | 2 +- ui/styles/styles.go | 11 +++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ui/components/selector/selector.go b/ui/components/selector/selector.go index 9c99755f506837eb7ac86ab83c2b3ad2871a1d5b..7d65eb6552ab989c6b23b8887b3f3b26e543ec09 100644 --- a/ui/components/selector/selector.go +++ b/ui/components/selector/selector.go @@ -40,6 +40,7 @@ func New(common common.Common, items []IdentifiableItem, delegate ItemDelegate) itms[i] = item } l := list.New(itms, delegate, common.Width, common.Height) + l.Styles.NoItems = common.Styles.NoItems s := &Selector{ Model: l, common: common, diff --git a/ui/pages/repo/readme.go b/ui/pages/repo/readme.go index e10eb3c6b55603d17680969fa95b0eacb25a5560..2743a9f831927f0714b39eb7f1caa9abe1fbfbec 100644 --- a/ui/pages/repo/readme.go +++ b/ui/pages/repo/readme.go @@ -28,7 +28,7 @@ type Readme struct { // NewReadme creates a new readme model. func NewReadme(common common.Common) *Readme { readme := code.New(common, "", "") - readme.NoContentStyle = readme.NoContentStyle.SetString("No readme found.") + readme.NoContentStyle = readme.NoContentStyle.Copy().SetString("No readme found.") return &Readme{ code: readme, common: common, diff --git a/ui/styles/styles.go b/ui/styles/styles.go index 1faac44f93d5ec404baf53f943c41b0bea4519ee..63805bbbead4012bce1c5c6ff3c11a24448228ec 100644 --- a/ui/styles/styles.go +++ b/ui/styles/styles.go @@ -59,8 +59,6 @@ type Styles struct { ErrorTitle lipgloss.Style ErrorBody lipgloss.Style - AboutNoReadme lipgloss.Style - LogItem struct { Normal struct { Base lipgloss.Style @@ -277,11 +275,6 @@ func DefaultStyles() *Styles { Foreground(lipgloss.Color("252")). MarginLeft(2) - s.AboutNoReadme = lipgloss.NewStyle(). - MarginTop(1). - MarginLeft(2). - Foreground(lipgloss.Color("242")) - s.LogItem.Normal.Base = lipgloss.NewStyle(). Border(lipgloss.Border{ Left: " ", @@ -417,7 +410,9 @@ func DefaultStyles() *Styles { MarginLeft(2). Foreground(lipgloss.Color("242")) - s.NoItems = s.AboutNoReadme.Copy() + s.NoItems = lipgloss.NewStyle(). + MarginLeft(2). + Foreground(lipgloss.Color("242")) s.StatusBar = lipgloss.NewStyle(). Height(1)