Closed Ethosa closed 1 month ago
I ran into a problem when I was writing the code for the article:
var
tg = Telegram.WebApp
bgColor = tg.themeParams.bg_color
textColor = tg.themeParams.text_color
appRoutes("app"):
"/{p:string}":
tDiv(
class = "flex flex-col w-screen min-h-screen h-full p-12",
style = fmt"background: {bgColor}; color: {textColor}" # error was here
)
I also changed importc
to importjs
pragma in procedures, because it is methods, not functions:
discard tg.MainButton.setText("Click me!")
discard tg.MainButton.show()
tg.expand()
string
->cstring
int64
->cint
is need because all types and procedures has{.importc, nodecl.}