Skip to content

Commit

Permalink
Fix header row style. (#460)
Browse files Browse the repository at this point in the history
lipgloss changed the row numbering in this PR (charmbracelet/lipgloss#377)
  • Loading branch information
boks1971 authored Nov 1, 2024
1 parent ae02d1e commit 23409c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/lk/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/lipgloss/table"
"github.com/urfave/cli/v3"

"github.com/livekit/livekit-cli/pkg/config"
Expand Down Expand Up @@ -249,9 +250,9 @@ func listProjects(ctx context.Context, cmd *cli.Command) error {
table := CreateTable().
StyleFunc(func(row, col int) lipgloss.Style {
switch {
case row == 0:
case row == table.HeaderRow:
return headerStyle
case cliConfig.Projects[row-1].Name == cliConfig.DefaultProject:
case cliConfig.Projects[row].Name == cliConfig.DefaultProject:
return selectedStyle
default:
return baseStyle
Expand Down
2 changes: 1 addition & 1 deletion cmd/lk/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func CreateTable() *table.Table {
headerStyle := baseStyle.Bold(true)

styleFunc := func(row, col int) lipgloss.Style {
if row == 0 {
if row == table.HeaderRow {
return headerStyle
}
return baseStyle
Expand Down

0 comments on commit 23409c6

Please sign in to comment.