Skip to content

Commit

Permalink
[feat] add github documents
Browse files Browse the repository at this point in the history
  • Loading branch information
mrs1669 committed May 19, 2024
1 parent b2c5286 commit ad05648
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions QuickKeyAssistantApp/QuickKeyAssistantApp/MenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import SwiftUI

struct MenuView: View {
@State private var isHovered = false
@State private var isHoveredGitHub = false
@State private var isHoveredSlack = false

var body: some View {
ScrollView {
Expand Down Expand Up @@ -170,6 +171,21 @@ struct MenuView: View {
.foregroundStyle(.gray)
}

ZStack(alignment: .leading) {
if isHoveredGitHub {
Color.gray.opacity(0.3)
}
Text("Official Documents")
.onHover { hovered in
self.isHoveredGitHub = hovered
}
.onTapGesture {
if let url = URL(string: "https://docs.github.com/en/get-started/accessibility/keyboard-shortcuts") {
NSWorkspace.shared.open(url)
}
}
}

Divider()

Text("Slack")
Expand All @@ -185,12 +201,12 @@ struct MenuView: View {
}

ZStack(alignment: .leading) {
if isHovered {
if isHoveredSlack {
Color.gray.opacity(0.3)
}
Text("Official Documents")
.onHover { hovered in
self.isHovered = hovered
self.isHoveredSlack = hovered
}
.onTapGesture {
if let url = URL(string: "https://slack.com/intl/en-gb/help/articles/201374536-Slack-keyboard-shortcuts-and-commands") {
Expand Down

0 comments on commit ad05648

Please sign in to comment.