This commit is contained in:
Zed
2019-08-15 23:17:13 +02:00
parent 6a7a65e16b
commit 1464131707
3 changed files with 48 additions and 57 deletions

View File

@@ -17,7 +17,7 @@ proc renderNavbar*(title: string): VNode =
icon "info-circled", title="About", href="/about"
icon "cog-2", title="Preferences", href="/settings"
proc renderMain*(body: VNode; prefs: Prefs; title="Nitter"; titleText=""; desc="";
proc renderMain*(body: VNode; title="Nitter"; titleText=""; desc="";
`type`="article"; video=""; images: seq[string] = @[]): string =
let node = buildHtml(html(lang="en")):
head:
@@ -62,5 +62,5 @@ proc renderError*(error: string): VNode =
tdiv(class="error-panel"):
span: text error
proc showError*(error: string; title: string; prefs: Prefs): string =
renderMain(renderError(error), prefs, title=title, titleText="Error")
proc showError*(error, title: string): string =
renderMain(renderError(error), title, "Error")