diff --git a/bamboohr/widget.go b/bamboohr/widget.go index e69435d5..f5e81bde 100644 --- a/bamboohr/widget.go +++ b/bamboohr/widget.go @@ -8,6 +8,7 @@ import ( ) type Widget struct { + Name string RefreshedAt time.Time RefreshInterval int View *tview.TextView @@ -15,6 +16,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ + Name: "BambooHR", RefreshedAt: time.Now(), RefreshInterval: 3600, } @@ -43,7 +45,7 @@ func (widget *Widget) addView() { view.SetBorder(true) view.SetDynamicColors(true) - view.SetTitle(" BambooHR ") + view.SetTitle(widget.Name) widget.View = view } diff --git a/gcal/widget.go b/gcal/widget.go index edb6bb8c..6d1af240 100644 --- a/gcal/widget.go +++ b/gcal/widget.go @@ -10,6 +10,7 @@ import ( ) type Widget struct { + Name string RefreshedAt time.Time RefreshInterval int View *tview.TextView @@ -17,6 +18,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ + Name: "Calendar", RefreshedAt: time.Now(), RefreshInterval: 1800, } @@ -45,7 +47,7 @@ func (widget *Widget) addView() { view.SetBorder(true) view.SetDynamicColors(true) - view.SetTitle(" Calendar ") + view.SetTitle(widget.Name) widget.View = view } diff --git a/github/client.go b/github/client.go deleted file mode 100644 index 9d2b6b37..00000000 --- a/github/client.go +++ /dev/null @@ -1,11 +0,0 @@ -package github - -import ( - _ "github.com/google/go-github/github" -) - -func Fetch() string { - //client := github.NewClient(nil) - - return "" -} diff --git a/github/widget.go b/github/widget.go deleted file mode 100644 index 03d2ecf2..00000000 --- a/github/widget.go +++ /dev/null @@ -1,18 +0,0 @@ -package github - -import ( - "fmt" - - "github.com/rivo/tview" -) - -func Widget() tview.Primitive { - widget := tview.NewTextView() - widget.SetBorder(true) - widget.SetDynamicColors(true) - widget.SetTitle(" 🐱 Github ") - - fmt.Fprintf(widget, "%s", "This is github") - - return widget -} diff --git a/status/widget.go b/status/widget.go index bd0002bc..404d1ed4 100644 --- a/status/widget.go +++ b/status/widget.go @@ -9,6 +9,7 @@ import ( ) type Widget struct { + Name string RefreshedAt time.Time RefreshInterval int View *tview.TextView @@ -16,6 +17,7 @@ type Widget struct { func NewWidget() *Widget { widget := Widget{ + Name: "Status", RefreshedAt: time.Now(), RefreshInterval: 1, } @@ -43,13 +45,12 @@ func (widget *Widget) addView() { view.SetBorder(true) view.SetDynamicColors(true) - view.SetTitle(" BambooHR ") + view.SetTitle(widget.Name) widget.View = view } func (widget *Widget) contentFrom() string { - //return "cats and gods\ndogs and tacs" return fmt.Sprint(rand.Intn(100)) }