-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from overmindtech/auth-view
authenticate tea
- Loading branch information
Showing
4 changed files
with
306 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/charmbracelet/bubbles/spinner" | ||
tea "github.com/charmbracelet/bubbletea" | ||
"github.com/charmbracelet/lipgloss" | ||
) | ||
|
||
type spinnerModel struct { | ||
spinner spinner.Model | ||
} | ||
|
||
func createSpinner() spinnerModel { | ||
s := spinner.New() | ||
s.Spinner = spinner.Pulse | ||
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(ColorPalette.Light.BgMain)) | ||
return spinnerModel{spinner: s} | ||
} | ||
|
||
func (m spinnerModel) Init() tea.Cmd { | ||
return m.spinner.Tick | ||
} | ||
|
||
func (m spinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | ||
switch msg := msg.(type) { | ||
|
||
default: | ||
var cmd tea.Cmd | ||
m.spinner, cmd = m.spinner.Update(msg) | ||
return m, cmd | ||
} | ||
} | ||
|
||
func (m spinnerModel) View() string { | ||
return m.spinner.View() | ||
} |
Oops, something went wrong.