Skip to content

Commit

Permalink
Merge pull request #553 from pennlabs/george-botros/more-options-for-…
Browse files Browse the repository at this point in the history
…candidate-contact-info

Add more options for candidate contact info
  • Loading branch information
JHawk0224 authored Sep 20, 2024
2 parents d97e7ae + 33ba33b commit 969a9cc
Showing 1 changed file with 42 additions and 10 deletions.
52 changes: 42 additions & 10 deletions PennMobile/Subletting/SubletCandidatesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,53 @@ struct CandidateRow: View {

var body: some View {
VStack(alignment: .leading, spacing: 10) {
Button(action: {
guard let url = URL(string: "mailto:\(offer.email)") else { return }
UIApplication.shared.open(url)
}) {
Text(offer.email)
.font(.headline)
HStack {
Image(systemName: "envelope")

Menu {
Button(action: {
guard let url = URL(string: "mailto:\(offer.email)") else { return }
UIApplication.shared.open(url)
}) {
Label("Send Email", systemImage: "envelope")
}

Button(action: {
UIPasteboard.general.string = offer.email
}) {
Label("Copy Email", systemImage: "doc.on.doc")
}
} label: {
Text(offer.email)
.font(.headline)
}
}

HStack {
Image(systemName: "phone")
Button(action: {
guard let url = URL(string: "tel:\(offer.phoneNumber)") else { return }
UIApplication.shared.open(url)
}) {
Menu {
Button(action: {
guard let url = URL(string: "tel:\(offer.phoneNumber)") else { return }
UIApplication.shared.open(url)
}) {
Label("Call Number", systemImage: "phone")
}

Button(action: {
guard let url = URL(string: "sms:\(offer.phoneNumber)") else { return }
UIApplication.shared.open(url)
}) {
Label("Send Message", systemImage: "message")
}

Button(action: {
UIPasteboard.general.string = offer.phoneNumber
}) {
Label("Copy", systemImage: "doc.on.doc")
}
} label: {
Text(offer.phoneNumber)
.font(.headline)
}
}
.font(.subheadline)
Expand Down

0 comments on commit 969a9cc

Please sign in to comment.