common

package
v0.0.0-...-80d3fd2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WhyBadgeStyle = func(color lipgloss.Color) lipgloss.Style {
		return lipgloss.NewStyle().Background(color).
			Foreground(lipgloss.Color("#FFFFFF")).
			Padding(0, 1, 0, 1).
			Margin(0, 1, 0, 0).Bold(true)
	}
)

Functions

This section is empty.

Types

type Common

type Common struct {
	Width      int
	Height     int
	Zone       *zone.Manager
	Store      data.Store
	Figlet     *figlet4go.AsciiRender
	FigletOpts *figlet4go.RenderOptions
}

Common is a struct all components should embed

func NewCommon

func NewCommon() Common

func (*Common) DeleteWhys

func (c *Common) DeleteWhys(whys []data.Why) tea.Cmd

func (*Common) GetDaysIntentions

func (c *Common) GetDaysIntentions(day time.Time) tea.Cmd

func (*Common) ReadWhys

func (c *Common) ReadWhys(filter data.WhyStatusEnum) tea.Cmd

func (*Common) SetSize

func (c *Common) SetSize(height, width int)

SetSize sets the width and height of the common struct

func (*Common) UpsertDayReview

func (c *Common) UpsertDayReview(days []data.Day) tea.Cmd

func (*Common) UpsertIntentions

func (c *Common) UpsertIntentions(intentions []data.Intention) tea.Cmd

func (*Common) UpsertWhys

func (c *Common) UpsertWhys(whys []data.Why) tea.Cmd

type Component

type Component interface {
	tea.Model
	SetSize(height, width int)
}

type ErrMsg

type ErrMsg struct{ Error error }

type IntentionMsg

type IntentionMsg struct {
	Yesterday []data.Intention
	Today     []data.Intention
	Tomorrow  []data.Intention
	Error     error
}

type WhyDataMsg

type WhyDataMsg struct {
	Data  []data.Why
	Error error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL