diff --git a/earnapp.go b/earnapp.go index 1f4f947..6fa9894 100644 --- a/earnapp.go +++ b/earnapp.go @@ -11,7 +11,8 @@ import ( ) const ( - EARNAPP_IMAGE_NAME = "fazalfarhan01/earnapp:lite" + EARNAPP_IMAGE_NAME = "fazalfarhan01/earnapp:lite" + EARNAPP_REFERRAL_LINK = "https://earnapp.com/i/J9XF4PXJ" ) type EarnAppConfig struct { @@ -31,17 +32,25 @@ func (i *EarnAppConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app uuid = generateEarnAppUUID() form.GetFormItemByLabel("UUID").(*tview.InputField).SetText(uuid) }) - form.AddButton("Copy Claim URL to Clipboard", func() { - if stringIsEmpty(uuid) { - form.AddTextView("Error", "UUID is required", 0, 1, true, true) - isError = true - } else { - if err := clipboard.WriteAll("https://earnapp.com/r/" + uuid); err != nil { - form.AddTextView("Error", "Failed to copy to clipboard", 0, 1, true, true) - } else { - form.AddTextView("Success", "Copied to clipboard", 0, 1, true, true) + form.AddButton("Claim URL", func() { + isError = stringIsEmpty(uuid) + if isError { + if !showingError { + form.AddTextView("Error", "UUID is required", 0, 1, true, true) + showingError = true } + return } + modal := tview.NewModal(). + SetText("Claim URL:\nhttps://earnapp.com/r/" + uuid). + AddButtons([]string{"Copy", "Close"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Copy" { + clipboard.WriteAll("https://earnapp.com/r/" + uuid) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) form.AddButton("Save", func() { isError = stringIsEmpty(uuid) @@ -60,7 +69,16 @@ func (i *EarnAppConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://earnapp.com/i/J9XF4PXJ") + modal := tview.NewModal(). + SetText("Register on EarnApp\n" + EARNAPP_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(EARNAPP_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/grass.go b/grass.go index 681bb45..0be9e56 100644 --- a/grass.go +++ b/grass.go @@ -9,7 +9,8 @@ import ( ) const ( - GRASS_IMAGE_NAME = "mrcolorrain/grass:latest" + GRASS_IMAGE_NAME = "mrcolorrain/grass:latest" + GRASS_REFERRAL_LINK = "https://app.getgrass.io/register/?referralCode=u154dPm508iVxXy" ) type GrassConfig struct { @@ -47,7 +48,16 @@ func (i *GrassConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app *t returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://app.getgrass.io/register/?referralCode=u154dPm508iVxXy") + modal := tview.NewModal(). + SetText("Register on Grass\n" + GRASS_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(GRASS_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/honeygain.go b/honeygain.go index 84bdbd4..3099ef3 100644 --- a/honeygain.go +++ b/honeygain.go @@ -9,7 +9,8 @@ import ( ) const ( - HONEYGAIN_IMAGE_NAME = "honeygain/honeygain:latest" + HONEYGAIN_IMAGE_NAME = "honeygain/honeygain:latest" + HONEYGAIN_REFERRAL_LINK = "https://r.honeygain.me/SAMUEC73" ) type HoneygainConfig struct { @@ -53,7 +54,16 @@ func (i *HoneygainConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, ap returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://r.honeygain.me/SAMUEC73") + modal := tview.NewModal(). + SetText("Register on Honeygain\n" + HONEYGAIN_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(HONEYGAIN_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/mystnode.go b/mystnode.go index f106877..30a7f37 100644 --- a/mystnode.go +++ b/mystnode.go @@ -10,7 +10,8 @@ import ( ) const ( - MYST_IMAGE_NAME = "mysteriumnetwork/myst:latest" + MYST_IMAGE_NAME = "mysteriumnetwork/myst:latest" + MYST_REFERRAL_LINK = "https://mystnodes.co/?referral_code=ijIy8nJv8xqVoshRmJjKATvoZZYKZ3jhzOY3FWy6" ) type MystConfig struct { @@ -30,7 +31,16 @@ func (i *MystConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app *tv returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://mystnodes.co/?referral_code=ijIy8nJv8xqVoshRmJjKATvoZZYKZ3jhzOY3FWy6") + modal := tview.NewModal(). + SetText("Register on Mysterium Nodes\n" + MYST_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(MYST_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/packetstream.go b/packetstream.go index 2347a26..703d286 100644 --- a/packetstream.go +++ b/packetstream.go @@ -9,7 +9,8 @@ import ( ) const ( - PACKETSTREAM_IMAGE_NAME = "packetstream/psclient:latest" + PACKETSTREAM_IMAGE_NAME = "packetstream/psclient:latest" + PACKETSTREAM_REFERRAL_LINK = "https://packetstream.io/?psr=4cRE" ) type PacketStreamConfig struct { @@ -41,7 +42,16 @@ func (i *PacketStreamConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://packetstream.io/?psr=4cRE") + modal := tview.NewModal(). + SetText("Register on PacketStream\n" + PACKETSTREAM_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(PACKETSTREAM_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/pawnsapp.go b/pawnsapp.go index 4926bf9..c9bdbd3 100644 --- a/pawnsapp.go +++ b/pawnsapp.go @@ -9,7 +9,8 @@ import ( ) const ( - PAWNSAPP_IMAGE_NAME = "iproyal/pawns-cli:latest" + PAWNSAPP_IMAGE_NAME = "iproyal/pawns-cli:latest" + PAWNSAPP_REFERRAL_LINK = "https://pawns.app/?r=1112060" ) type PawnsAppConfig struct { @@ -53,7 +54,16 @@ func (i *PawnsAppConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, app returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://pawns.app/?r=1112060") + modal := tview.NewModal(). + SetText("Register on PawnsApp\n" + PAWNSAPP_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(PAWNSAPP_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) } diff --git a/peer2profit.go b/peer2profit.go index 7e17d02..eb434ff 100644 --- a/peer2profit.go +++ b/peer2profit.go @@ -10,7 +10,8 @@ import ( ) const ( - PEER2PROFIT_IMAGE_NAME = "enwaiax/peer2profit:latest" + PEER2PROFIT_IMAGE_NAME = "enwaiax/peer2profit:latest" + PEER2PROFIT_REFERRAL_LINK = "https://t.me/peer2profit_app_bot?start=1671204644639c8f24d663c" ) type Peer2ProfitConfig struct { @@ -42,7 +43,16 @@ func (i *Peer2ProfitConfig) ConfigureForm(form *tview.Form, frame *tview.Frame, returnToMenu(frame, app) }) form.AddButton("Register", func() { - webbrowser.Open("https://t.me/peer2profit_app_bot?start=1671204644639c8f24d663c") + modal := tview.NewModal(). + SetText("Register on Peer2Profit\n" + PEER2PROFIT_REFERRAL_LINK). + AddButtons([]string{"Open", "Cancel"}). + SetDoneFunc(func(buttonIndex int, buttonLabel string) { + if buttonLabel == "Open" { + webbrowser.Open(PEER2PROFIT_REFERRAL_LINK) + } + app.SetRoot(form, true) + }) + app.SetRoot(modal, true) }) }