Skip to content

Commit 5b74919

Browse files
committed
Search Styles
1 parent 19a4af4 commit 5b74919

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

internal/navigation/search.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package navigation
22

33
import (
4-
"github.com/charmbracelet/bubbles/textinput"
54
"regexp"
65
"strings"
6+
7+
"github.com/charmbracelet/bubbles/textinput"
8+
"github.com/maaslalani/slides/styles"
79
)
810

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

2527
func NewSearch() Search {
26-
sti := textinput.NewModel()
27-
sti.Placeholder = "search..."
28-
return Search{SearchTextInput: sti}
28+
ti := textinput.NewModel()
29+
ti.Placeholder = "search"
30+
ti.Prompt = "/"
31+
ti.PromptStyle = styles.Search
32+
ti.TextStyle = styles.Search
33+
return Search{SearchTextInput: ti}
2934
}
3035

3136
func (s *Search) Query() string {

styles/styles.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ const (
1818
)
1919

2020
var (
21-
Author = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Left).MarginLeft(2)
22-
Date = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).Margin(0, 1)
23-
Page = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Right).MarginRight(3)
24-
Slide = lipgloss.NewStyle().Padding(1)
25-
Status = lipgloss.NewStyle().Padding(1)
26-
ActionStatus = lipgloss.NewStyle().
27-
Foreground(salmon).
28-
Align(lipgloss.Left).
29-
MarginLeft(3)
21+
Author = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Left).MarginLeft(2)
22+
Date = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).Margin(0, 1)
23+
Page = lipgloss.NewStyle().Foreground(salmon).Align(lipgloss.Right).MarginRight(3)
24+
Slide = lipgloss.NewStyle().Padding(1)
25+
Status = lipgloss.NewStyle().Padding(1)
26+
Search = lipgloss.NewStyle().Faint(true).Align(lipgloss.Left).MarginLeft(2)
3027
)
3128

3229
var (

0 commit comments

Comments
 (0)