Skip to content

Commit

Permalink
fix(ui): no items style
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed May 2, 2023
1 parent 399c33e commit 7498560
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions ui/components/selector/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/repo/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 3 additions & 8 deletions ui/styles/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ type Styles struct {
ErrorTitle lipgloss.Style
ErrorBody lipgloss.Style

AboutNoReadme lipgloss.Style

LogItem struct {
Normal struct {
Base lipgloss.Style
Expand Down Expand Up @@ -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: " ",
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7498560

Please sign in to comment.