repos / pico

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

commit
5b0ef24
parent
625dcb4
author
Eric Bower
date
2024-05-17 16:41:46 +0000 UTC
styles(tui): create account page
3 files changed,  +11, -17
M tui/createaccount/create.go
+5, -6
 1@@ -199,11 +199,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 2 
 3 // View renders current view from the model.
 4 func (m Model) View() string {
 5-	intro := "To create an account, enter a username.\n\n"
 6-	intro += "After that, go to https://pico.sh/getting-started#next-steps"
 7-	s := fmt.Sprintf("%s\n\n%s\n\n", "hacker labs", intro)
 8-	s += fmt.Sprintf("Public Key: %s\n\n", shared.KeyForSha256(m.shared.Session.PublicKey()))
 9-	s += m.input.View() + "\n\n"
10+	s := common.LogoView() + "\n\n"
11+	pubkey := fmt.Sprintf("pubkey: %s", shared.KeyForSha256(m.shared.Session.PublicKey()))
12+	s += m.shared.Styles.Label.SetString(pubkey).String()
13+	s += "\n\n" + m.input.View() + "\n\n"
14 
15 	if m.state == submitting {
16 		s += m.spinnerView()
17@@ -214,7 +213,7 @@ func (m Model) View() string {
18 			s += "\n\n" + m.errMsg
19 		}
20 	}
21-	s += fmt.Sprintf("\n\n%s\n", helpMsg)
22+	s += fmt.Sprintf("\n\n%s\n", m.shared.Styles.HelpSection.SetString(helpMsg))
23 
24 	return s
25 }
M tui/plus/plus.go
+0, -9
 1@@ -45,15 +45,6 @@ Send cash (USD) or check to:
 2 - 206 E Huron St STE 103
 3 - Ann Arbor MI 48104
 4 
 5-## What are the storage limits?
 6-
 7-We don't want pico+ users to think about storage limits.  For all
 8-intents and purposes, there are no storage restrictions.  Having said
 9-that, if we detect abuse or feel like a user is storing too much, we
10-will notify the user and potentially suspend their account.
11-
12-Again, most users do not need to worry.
13-
14 ## Notes
15 
16 Have any questions not covered here? [Email](mailto:hello@pico.sh)
M tui/ui.go
+6, -2
 1@@ -173,10 +173,14 @@ func (m *UI) View() string {
 2 		s += m.pages[m.activePage].View()
 3 	}
 4 
 5+	maxWidth := 100
 6 	width := m.shared.Width - m.shared.Styles.App.GetHorizontalFrameSize()
 7+	if width < maxWidth {
 8+		maxWidth = width
 9+	}
10 	str := wrap.String(
11-		wordwrap.String(s, width),
12-		width,
13+		wordwrap.String(s, maxWidth),
14+		maxWidth,
15 	)
16 	return m.shared.Styles.App.Render(str)
17 }