mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
fix: use .New() instead of the deprecated .NewModel() to init models
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ func NewLogin() State {
|
|||||||
|
|
||||||
var t textinput.Model
|
var t textinput.Model
|
||||||
for i := range ls.Inputs {
|
for i := range ls.Inputs {
|
||||||
t = textinput.NewModel()
|
t = textinput.New()
|
||||||
t.CursorStyle = ui.CursorStyle
|
t.CursorStyle = ui.CursorStyle
|
||||||
t.Prompt = "| "
|
t.Prompt = "| "
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ type InputState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewInputBox() InputState {
|
func NewInputBox() InputState {
|
||||||
input := textinput.NewModel()
|
input := textinput.New()
|
||||||
input.Placeholder = "Send a message..."
|
input.Placeholder = "Send a message..."
|
||||||
input.Focus()
|
input.Focus()
|
||||||
|
|
||||||
|
|||||||
@@ -51,16 +51,14 @@ type State struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewMainScreen(client *client.Client) State {
|
func NewMainScreen(client *client.Client) State {
|
||||||
newViewport := &viewport.Model{
|
newViewport := viewport.New(0, 0)
|
||||||
HighPerformanceRendering: false,
|
newViewport.Wrap = viewport.Wrap
|
||||||
Wrap: viewport.Wrap,
|
newViewport.Style = MessagesStyle.Copy()
|
||||||
Style: MessagesStyle.Copy(),
|
|
||||||
}
|
|
||||||
|
|
||||||
return State{
|
return State{
|
||||||
ConnReader: nil,
|
ConnReader: nil,
|
||||||
Client: client,
|
Client: client,
|
||||||
Viewport: newViewport,
|
Viewport: &newViewport,
|
||||||
FocusIndex: InputBox,
|
FocusIndex: InputBox,
|
||||||
InputBox: NewInputBox(),
|
InputBox: NewInputBox(),
|
||||||
SidePanel: NewSidePanel(client),
|
SidePanel: NewSidePanel(client),
|
||||||
|
|||||||
Reference in New Issue
Block a user