gemenon

[ACTIVE] The Safari of the Gemini ecosystem
git clone git://git.figbert.com/gemenon.git
Log | Files | Refs

commit ef2cbf41bcd7a3d6ac427f9f1b19084d528a00a4
parent 9263269a6f7e341c3037493bdf611f9ced64d9a7
Author: FIGBERT <figbert@figbert.com>
Date:   Sun,  4 Sep 2022 10:33:42 -0700

Color non-Gemini links in purple

Diffstat:
MShared/ContentView.swift | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Shared/ContentView.swift b/Shared/ContentView.swift @@ -77,12 +77,15 @@ struct ContentView: View { case .Text(let str): Text(str) case .Link(let url, let str): - Link(destination: url) { - if str != nil { - Text(str!) - } else { - Text(url.absoluteString) + if url.scheme == "gemini" { + Link(destination: url) { + Text(str != nil ? str! : url.absoluteString) + } + } else { + Link(destination: url) { + Text(str != nil ? str! : url.absoluteString) } + .foregroundColor(.purple) } case .PreformattedText(let code, _): Text(code).monospaced(true)