Skip to content

Commit 0d61501

Browse files
committed
feat(style): show custom vault style
1 parent 68cb930 commit 0d61501

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

main.go

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/atotto/clipboard"
99
cmd "github.com/jalpp/passdiy/cmds"
10+
"github.com/jalpp/passdiy/extend"
1011

1112
"github.com/charmbracelet/bubbles/list"
1213
"github.com/charmbracelet/bubbles/spinner"
@@ -297,6 +298,10 @@ func (m model) View() string {
297298
return style.ConfigStyle.Render(fmt.Sprintf("%s\n\n %s", m.list.View(), m.output))
298299
}
299300

301+
if strings.Contains(strings.ToLower(m.output), extend.VAULT_PREFIX) {
302+
return style.CustomStyle.Render(fmt.Sprintf("%s\n\n %s", m.list.View(), m.output))
303+
}
304+
300305
return style.GreenStyle.Render(fmt.Sprintf("%s\n\n 🔑 [c] Copy [esc] Exist Sublist [x] Clear \n 🔑 Buffer: %s%s", m.list.View(), cmd.CoverUp(m.output), copyMessage))
301306

302307
}

style/style.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ package style
22

33
import (
44
"github.com/charmbracelet/lipgloss"
5+
custom "github.com/jalpp/passdiy/extend"
6+
hcp "github.com/jalpp/passdiy/hcpvault"
7+
opass "github.com/jalpp/passdiy/onepassword"
58
)
69

710
var (
811
GreenStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#7DDA58"))
912
ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#E4080A"))
10-
VaultStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFDE59"))
11-
OPassStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#4CAAF7"))
13+
VaultStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(hcp.VAULT_DISPLAY_COLOR))
14+
OPassStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(opass.VAULT_DISPLAY_COLOR))
15+
CustomStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(custom.VAULT_DISPLAY_COLOR))
1216
ConfigStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#CC6CE7"))
1317
)

0 commit comments

Comments
 (0)