Skip to content

Commit

Permalink
ui: better display for username in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvhdr committed May 24, 2024
1 parent 4dee5c6 commit 3c57b53
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ui/components/footer/footer.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,20 @@ func (m *Model) UpdateProgramContext(ctx *context.ProgramContext) {
}

func (m *Model) renderViewSwitcher(ctx context.ProgramContext) string {
view := m.ctx.User
var view string
if ctx.View == config.PRsView {
view += " |  PRs"
view += " PRs"
} else {
view += " |  Issues"
view += " Issues"
}

return ctx.Styles.Tabs.ViewSwitcher.Copy().
Render(view)
var user string
if ctx.User != "" {
user = ctx.Styles.Tabs.ViewSwitcher.Copy().Background(ctx.Theme.FaintText).Render("@" + ctx.User)
}

return lipgloss.JoinHorizontal(lipgloss.Top, ctx.Styles.Tabs.ViewSwitcher.Copy().
Render(view), user)
}

func (m *Model) SetLeftSection(leftSection string) {
Expand Down

0 comments on commit 3c57b53

Please sign in to comment.