You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: models/initialize.go
+72-24
Original file line number
Diff line number
Diff line change
@@ -5,51 +5,99 @@ import (
5
5
6
6
tea "github.com/charmbracelet/bubbletea"
7
7
8
+
"github.com/initia-labs/weave/models/weaveinit"
8
9
"github.com/initia-labs/weave/styles"
9
10
"github.com/initia-labs/weave/utils"
10
11
)
11
12
12
-
typeExistingAppCheckerstruct {
13
-
TextInput utils.TextInput
13
+
funcInitHeader() string {
14
+
returnstyles.FadeText("Welcome to Weave! 🪢\n\n") +
15
+
styles.RenderPrompt("As this is your first time using Weave, we ask that you set up your Gas Station account,\nwhich will hold the necessary funds for the OPinit-bots or relayer to send transactions.\n\n", []string{"Gas Station account"}, styles.Empty) +
16
+
styles.BoldText("Please note that Weave will not send any transactions without your confirmation.\n", styles.Yellow) +
17
+
styles.Text("While you can complete this setup later, we recommend doing it now to ensure a smoother experience.\n\n", styles.Gray)
view:=styles.RenderPreviousResponse(styles.ArrowSeparator, "Would you like to set up a Gas Station account", []string{"Gas Station account"}, string(*selected))
52
+
returnNewGasStationMnemonicInput(view), nil
53
+
caseNo:
54
+
returnweaveinit.NewWeaveInit(), nil
55
+
}
32
56
}
33
-
m.TextInput=input
34
57
returnm, cmd
35
58
}
36
59
37
-
func (m*ExistingAppChecker) View() string {
38
-
view:=styles.FadeText("Welcome to Weave! 🪢\n\n")
60
+
func (m*ExistingWeaveChecker) View() string {
61
+
view:=InitHeader()
62
+
view+=styles.RenderPrompt("Would you like to set up a Gas Station account", []string{"Gas Station account"}, styles.Question) +
63
+
" "+styles.Text("(The account that will hold the funds required by the OPinit-bots or relayer to send transactions)", styles.Gray)
64
+
view+=m.Selector.View()
39
65
40
-
view+=styles.RenderPrompt("As this is your first time using Weave, we ask that you set up your Gas Station account,\nwhich will hold the necessary funds for the OPinit-bots or relayer to send transactions.\n\n", []string{"Gas Station account"}, styles.Empty)
66
+
returnview
67
+
}
41
68
42
-
view+=styles.BoldText("Please note that Weave will not send any transactions without your confirmation.\n", styles.Yellow)
69
+
typeGasStationMnemonicInputstruct {
70
+
previousResponsestring
71
+
utils.TextInput
72
+
}
43
73
44
-
view+=styles.Text("While you can complete this setup later, we recommend doing it now to ensure a smoother experience.\n\n", styles.Gray)
m.previousResponse+=styles.RenderPreviousResponse(styles.DotsSeparator, "Please set up a Gas Station account", []string{"Gas Station account"}, "*Mnemonic has been entered and is now hidden for security purposes.*")
returnInitHeader() +m.previousResponse+styles.RenderPrompt("Please set up a Gas Station account", []string{"Gas Station account"}, styles.Question) +m.TextInput.View()
0 commit comments