Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial intake form (WIP) #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

# Mac OS X
*.DS_Store
.DS_Store

## User settings
xcuserdata/
Expand Down
77 changes: 67 additions & 10 deletions PhillyTruce/Intake/IntakeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,75 @@ import SwiftUI

struct IntakeView: View {
@Binding var appState: AppState

@State var firstName: String = ""
@State var lastName: String = ""
@State var mobileNumber: String = ""
@State var email: String = ""
@State var conflictDetails: String = ""
@State var issue: IssueType = .personalConflict
enum IssueType {
case personalConflict
case domesticIssue
case neighborhoodDispute
case other

var label: String {
switch self {
case .personalConflict: return "Personal Conflict"
case .domesticIssue: return "Family/Domestic Issue"
case .neighborhoodDispute: return "Neighborhood Dispute"
case .other: return "Other"
}
}
}

var body: some View {
VStack {
Spacer()

Text("Intake")

Spacer()

DarkBlueButton(text: "Cancel") {
appState = .community
NavigationView {
Form {
Section(header: Text("Your Info")) {
Text("Your information will be kept private")
.foregroundColor(.red)
TextField("First Name", text: $firstName)
TextField("Last Name", text: $lastName)
TextField("Mobile Number", text: $mobileNumber)
TextField("Email (optional)", text: $email)
}
Section(header: Text("Location")) {

}
Section(header: Text("Conflict Details")) {
Picker(selection: $issue, label: Text("")) {
Text(IssueType.personalConflict.label)
.tag(IssueType.personalConflict)
Text(IssueType.domesticIssue.label)
.tag(IssueType.domesticIssue)
Text(IssueType.neighborhoodDispute.label)
.tag(IssueType.neighborhoodDispute)
Text(IssueType.other.label)
.tag(IssueType.other)
}.pickerStyle(.inline)

ZStack(alignment: .topLeading) {
TextEditor(text: $conflictDetails)
.frame(minHeight: 100, maxHeight: 400, alignment: .leading)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray, lineWidth: 1))
.padding()
Text("What's going on?")
.frame(minHeight: 100, maxHeight: 400, alignment: .center)
.padding(.leading, 50)
.opacity(conflictDetails == "" ? 1 : 0)
}
}

DarkBlueButton(text: "Send") {
appState = .community
}
DarkBlueButton(text: "Cancel") {
appState = .community
}
}
.navigationTitle("Get Help")
}
}
}
Expand Down