Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Coder Desktop/Coder Desktop/Views/LoginForm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ struct LoginForm<S: Session>: View {
Text("Generate a session token at ")
.font(.subheadline)
.foregroundColor(.secondary)
Link(cliAuthURL.absoluteString, destination: cliAuthURL)
.font(.subheadline)
.foregroundColor(.blue)
ResponsiveLink(title: cliAuthURL.absoluteString, destination: cliAuthURL)
}
}
}.formStyle(.grouped).scrollDisabled(true).padding(.horizontal)
Expand Down
39 changes: 39 additions & 0 deletions Coder Desktop/Coder Desktop/Views/ResponsiveLink.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import SwiftUI

struct ResponsiveLink: View {
let title: String
let destination: URL

@State private var isHovered = false
@State private var isPressed = false
@Environment(\.openURL) private var openURL

var body: some View {
Text(title)
.font(.subheadline)
.foregroundColor(isPressed ? .red : .blue)
.underline(isHovered, color: isPressed ? .red : .blue)
.onHover { hovering in
isHovered = hovering
if hovering {
NSCursor.pointingHand.push()
} else {
NSCursor.pop()
}
}
.simultaneousGesture(
DragGesture(minimumDistance: 0)
.onChanged { _ in
withAnimation(.easeInOut(duration: 0.1)) {
isPressed = true
}
}
.onEnded { _ in
withAnimation(.easeInOut(duration: 0.1)) {
isPressed = false
}
openURL(destination)
}
)
}
}
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy