This repository has been archived by the owner on Apr 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8314fc
commit bc7e8d2
Showing
13 changed files
with
418 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0xF4", | ||
"green" : "0x84", | ||
"red" : "0x00" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,9 @@ struct Job: Codable, Hashable, Identifiable { | |
let jobValue: String | ||
let allowedCvFormat: [String] | ||
let imageUrl: String | ||
let employerEmail: String? | ||
let employerPhone: Double? | ||
let employerName: String? | ||
|
||
var id: Int { jobId } | ||
|
||
|
@@ -114,6 +117,9 @@ struct Job: Codable, Hashable, Identifiable { | |
case jobValue = "job_value" | ||
case allowedCvFormat = "allowed_cv_format" | ||
case imageUrl = "image_url" | ||
case employerPhone = "employer_phone" | ||
case employerEmail = "employer_email" | ||
case employerName = "employer_name" | ||
} | ||
|
||
func toJSON() -> String? { | ||
|
@@ -199,7 +205,10 @@ class JobModel { | |
cvRequired: true, | ||
jobValue: "Random Job Value", | ||
allowedCvFormat: [".pdf", ".docx"], | ||
imageUrl: "https://cdn.mos.cms.futurecdn.net/ohsXtgy8Hmi9PzDNpKhJ5N.jpg" | ||
imageUrl: "https://cdn.mos.cms.futurecdn.net/ohsXtgy8Hmi9PzDNpKhJ5N.jpg", | ||
employerEmail: "[email protected]", | ||
employerPhone: 15225237383.0, | ||
employerName: "Employer Name" | ||
) | ||
return randomJob | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// SwiftUIView.swift | ||
// mobile | ||
// | ||
// Created by cb on 10.09.23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ContactAndDirections: View { | ||
let job: Job | ||
|
||
var body: some View { | ||
HStack { | ||
if let phone = job.employerPhone { | ||
Spacer() | ||
Link(destination: URL(string: "tel://\(phone)")!) { | ||
Image(systemName: "phone") | ||
.font(.title) | ||
.foregroundColor(.blue) | ||
} | ||
Spacer() | ||
} | ||
|
||
if let email = job.employerEmail { | ||
Spacer() | ||
Link(destination: URL(string: "mailto:\(email)")!) { | ||
Image(systemName: "envelope") | ||
.font(.title) | ||
.foregroundColor(.blue) | ||
} | ||
Spacer() | ||
} | ||
Spacer() | ||
Link(destination: getDirectionsURL()) { | ||
Image(systemName: "arrow.right.circle") | ||
.font(.title) | ||
.foregroundColor(.blue) | ||
} | ||
Spacer() | ||
}.padding() | ||
} | ||
|
||
// Function to generate directions URL | ||
private func getDirectionsURL() -> URL { | ||
let destinationLat = job.latitude | ||
let destinationLong = job.longitude | ||
let googleMapsURL = "https://www.google.com/maps/dir/?api=1&destination=\(destinationLat),\(destinationLong)" | ||
|
||
return URL(string: googleMapsURL)! | ||
} | ||
} | ||
|
||
struct Previews_ContactAndDirections_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContactAndDirections(job: JobModel.generateRandomJob()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.