repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
47c2cad
parent
16c06a6
author
Eric Bower
date
2024-05-18 02:47:37 +0000 UTC
styles(tui): settings page suggested width
1 files changed,  +7, -9
M tui/settings/settings.go
+7, -9
 1@@ -13,6 +13,8 @@ import (
 2 	"github.com/picosh/pico/tui/pages"
 3 )
 4 
 5+var maxWidth = 50
 6+
 7 type state int
 8 
 9 const (
10@@ -91,15 +93,11 @@ func (m Model) findAnalyticsFeature() *db.FeatureFlag {
11 }
12 
13 func (m Model) analyticsView() string {
14-	banner := `Get usage statistics on your blog, blog posts, and
15-pages sites. For example, see unique visitors, most popular URLs,
16-and top referers.
17+	banner := `Get usage statistics on your blog, blog posts, and pages sites. For example, see unique visitors, most popular URLs, and top referers.
18 
19-We do not collect usage statistic unless analytics is enabled.
20-Further, when analytics are disabled we do not purge usage statistics.
21+We do not collect usage statistic unless analytics is enabled. Further, when analytics are disabled we do not purge usage statistics.
22 
23-We will only store usage statistics for 1 year from when the event
24-was created.`
25+We will only store usage statistics for 1 year from when the event was created.`
26 
27 	str := ""
28 	hasPlus := m.shared.PlusFeatureFlag != nil
29@@ -115,7 +113,7 @@ was created.`
30 		str += banner + "\n\n" + m.shared.Styles.Error.SetString("Analytics is only available to pico+ users.").String()
31 	}
32 
33-	return m.shared.Styles.RoundedBorder.SetString(str).String()
34+	return m.shared.Styles.RoundedBorder.Copy().Width(maxWidth).SetString(str).String()
35 }
36 
37 func (m Model) featuresView() string {
38@@ -138,7 +136,7 @@ func (m Model) featuresView() string {
39 	t := table.New().
40 		Border(lipgloss.RoundedBorder()).
41 		BorderStyle(m.shared.Styles.Renderer.NewStyle().BorderForeground(common.Indigo)).
42-		Width(m.shared.Width).
43+		Width(maxWidth).
44 		Headers(headers...).
45 		Rows(data...)
46 	return "Features\n" + t.String()