mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
refactor: edit existing tui elements to add new gh add tui component
This commit is contained in:
@@ -47,6 +47,7 @@ type listKeyMap struct {
|
||||
createAuthor key.Binding
|
||||
deleteAuthor key.Binding
|
||||
tempAdd key.Binding
|
||||
ghAdd key.Binding
|
||||
}
|
||||
|
||||
func newListKeyMap() *listKeyMap {
|
||||
@@ -79,6 +80,10 @@ func newListKeyMap() *listKeyMap {
|
||||
key.WithKeys("T"),
|
||||
key.WithHelp("T", "Add temporary author"),
|
||||
),
|
||||
ghAdd: key.NewBinding(
|
||||
key.WithKeys("c"),
|
||||
key.WithHelp("c", "Add GitHub author"),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +185,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
// Handle keys from keyList (help menu)
|
||||
switch {
|
||||
case key.Matches(msg, m.keys.ghAdd):
|
||||
sub_model = NewGitHubUserForm(&m)
|
||||
return m, tea.ClearScreen
|
||||
|
||||
case key.Matches(msg, m.keys.negation):
|
||||
i, ok := m.list.SelectedItem().(item)
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user