Skip to content

Commit

Permalink
Search Styles
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Nov 1, 2021
1 parent 19a4af4 commit 5b74919
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
13 changes: 9 additions & 4 deletions internal/navigation/search.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package navigation

import (
"github.com/charmbracelet/bubbles/textinput"
"regexp"
"strings"

"github.com/charmbracelet/bubbles/textinput"
"github.com/maaslalani/slides/styles"
)

// Model is an interface for models.model, so that cycle imports are avoided
Expand All @@ -23,9 +25,12 @@ type Search struct {
}

func NewSearch() Search {
sti := textinput.NewModel()
sti.Placeholder = "search..."
return Search{SearchTextInput: sti}
ti := textinput.NewModel()
ti.Placeholder = "search"
ti.Prompt = "/"
ti.PromptStyle = styles.Search
ti.TextStyle = styles.Search
return Search{SearchTextInput: ti}
}

func (s *Search) Query() string {
Expand Down
15 changes: 6 additions & 9 deletions styles/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ const (
)

var (
Author = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Left).MarginLeft(2)
Date = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).Margin(0, 1)
Page = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Right).MarginRight(3)
Slide = lipgloss.NewStyle().Padding(1)
Status = lipgloss.NewStyle().Padding(1)
ActionStatus = lipgloss.NewStyle().
Foreground(salmon).
Align(lipgloss.Left).
MarginLeft(3)
Author = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Left).MarginLeft(2)
Date = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).Margin(0, 1)
Page = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Right).MarginRight(3)
Slide = lipgloss.NewStyle().Padding(1)
Status = lipgloss.NewStyle().Padding(1)
Search = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).MarginLeft(2)
)

var (
Expand Down

0 comments on commit 5b74919

Please sign in to comment.