Skip to content

Commit

Permalink
remove unused vars and change to Sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvhdr committed Feb 16, 2024
1 parent 1c3c0a7 commit 702b0a6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ui/components/footer/footer.go
Expand Up @@ -23,7 +23,7 @@ type Model struct {
}

func NewModel(ctx context.ProgramContext) Model {
help := bbHelp.NewModel()
help := bbHelp.New()
help.ShowAll = true
help.Styles = ctx.Styles.Help.BubbleStyles
l := ""
Expand Down
3 changes: 2 additions & 1 deletion ui/components/inputbox/inputbox.go
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"

"github.com/dlvhdr/gh-dash/ui/context"
)

Expand Down Expand Up @@ -38,7 +39,7 @@ func NewModel(ctx *context.ProgramContext) Model {
ta.FocusedStyle.EndOfBuffer = lipgloss.NewStyle().Foreground(ctx.Theme.FaintText)
ta.Focus()

h := help.NewModel()
h := help.New()
h.Styles = ctx.Styles.Help.BubbleStyles
return Model{
ctx: ctx,
Expand Down
7 changes: 4 additions & 3 deletions ui/components/issuesidebar/issuesidebar.go
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"

"github.com/dlvhdr/gh-dash/data"
"github.com/dlvhdr/gh-dash/ui/common"
"github.com/dlvhdr/gh-dash/ui/components/inputbox"
Expand Down Expand Up @@ -254,7 +255,7 @@ func (m *Model) SetIsCommenting(isCommenting bool) tea.Cmd {
m.inputBox.SetPrompt("Leave a comment...")

if isCommenting {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand All @@ -274,7 +275,7 @@ func (m *Model) SetIsAssigning(isAssigning bool) tea.Cmd {
}

if isAssigning {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand All @@ -301,7 +302,7 @@ func (m *Model) SetIsUnassigning(isUnassigning bool) tea.Cmd {
m.inputBox.SetValue(strings.Join(m.issueAssignees(), "\n"))

if isUnassigning {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand Down
6 changes: 0 additions & 6 deletions ui/components/issuessection/constants.go
@@ -1,11 +1,5 @@
package issuessection

import "github.com/charmbracelet/lipgloss"

var (
updatedAtCellWidth = lipgloss.Width("2mo ago")
issueRepoCellWidth = 15
issueAuthorCellWidth = 15
issueAssigneesCellWidth = 20
issueNumCommentsCellWidth = 6
)
5 changes: 0 additions & 5 deletions ui/components/pr/pr.go
Expand Up @@ -19,11 +19,6 @@ type PullRequest struct {
Data data.PullRequestData
}

type sectionPullRequestsFetchedMsg struct {
SectionId int
Prs []PullRequest
}

func (pr *PullRequest) getTextStyle() lipgloss.Style {
return components.GetIssueTextStyle(pr.Ctx, pr.Data.State)
}
Expand Down
7 changes: 4 additions & 3 deletions ui/components/prsidebar/prsidebar.go
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"

"github.com/dlvhdr/gh-dash/data"
"github.com/dlvhdr/gh-dash/ui/common"
"github.com/dlvhdr/gh-dash/ui/components/inputbox"
Expand Down Expand Up @@ -291,7 +292,7 @@ func (m *Model) SetIsCommenting(isCommenting bool) tea.Cmd {
m.inputBox.SetPrompt("Leave a comment...")

if isCommenting {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand All @@ -315,7 +316,7 @@ func (m *Model) SetIsAssigning(isAssigning bool) tea.Cmd {
}

if isAssigning {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand All @@ -342,7 +343,7 @@ func (m *Model) SetIsUnassigning(isUnassigning bool) tea.Cmd {
m.inputBox.SetValue(strings.Join(m.prAssignees(), "\n"))

if isUnassigning {
return tea.Sequentially(textarea.Blink, m.inputBox.Focus())
return tea.Sequence(textarea.Blink, m.inputBox.Focus())
}
return nil
}
Expand Down

0 comments on commit 702b0a6

Please sign in to comment.