Skip to content

Commit

Permalink
adjusted ui
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeelmu committed May 25, 2024
1 parent 4507576 commit 4348455
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Asthmaguard/DataSource/Endpoints/Database/DatabaseSetUp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ extension DatabaseManager {
})
}

// MARK: - Fetch Doctor

func fetchDoctorByToken(token: Int) {
let querySQL = "SELECT Token FROM Doctors WHERE Token = ?;"
var queryStatement: OpaquePointer? = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SDWebImageSwiftUI

@available(iOS 17.0, *)
struct BreathingExerciseScreen: View {
Expand Down
29 changes: 24 additions & 5 deletions Asthmaguard/Presentation/View/Companion/CompanionLoginScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ struct CompanionLoginScreen: View {
.font(Font.custom("Poppins-Regular", size: 16))
.foregroundColor(Color(red: 0.48, green: 0.44, blue: 0.45))
.multilineTextAlignment(.center)





VStack(spacing: 16) {
Expand All @@ -57,9 +54,31 @@ struct CompanionLoginScreen: View {
.shadow(color: Color(red: 0.58, green: 0.68, blue: 1, opacity: 0.30), radius: 22, y: 10)
}


Button(action: {loginViewModel.login()}) {
Text("Patient Portal")
.font(Font.custom("Poppins-Regular", size: 14).weight(.bold))
.foregroundColor(.white)
.frame(width: 200)
.frame(height: 50)
.background(
LinearGradient(gradient: Gradient(colors: [Color(red: 0.57, green: 0.64, blue: 0.99), Color(red: 0.62, green: 0.81, blue: 1)]), startPoint: .trailing, endPoint: .leading)
)
.cornerRadius(99)
.shadow(color: Color(red: 0.58, green: 0.68, blue: 1, opacity: 0.30), radius: 22, y: 10)
}

HStack(spacing: 3){
Text("Do not have an account?")
.font(Font.custom("Poppins", size: 14))
.lineSpacing(21)
.foregroundColor(Color(red: 0.12, green: 0.09, blue: 0.09))
Button(action:{loginViewModel.register()}){
Text("Get Started!")
.font(Font.custom("Poppins", size: 14))
.foregroundColor(Color(red: 0.57, green: 0.64, blue: 0.99))
}
}



}
.padding(.horizontal, 32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ struct CompanionRegisterScreen: View {

var body: some View {

VStack(spacing: 20) {
VStack(spacing: 25) {
Text("Asthma")
.font(Font.custom("Poppins-Regular", size: 32).weight(.bold))
.foregroundColor(Color(red: 0.12, green: 0.09, blue: 0.09))
+ Text("Guard")
.font(Font.custom("Poppins-Regular", size: 32).weight(.bold))
.foregroundColor(Color(red: 0.57, green: 0.64, blue: 0.99))

Spacer()
VStack(spacing:5){
VStack(spacing:20){
Text("Stay in touch with your asthma patient,")
.font(Font.custom("Poppins-Regular", size: 16))
.lineSpacing(24)
Expand All @@ -36,7 +35,6 @@ struct CompanionRegisterScreen: View {
.foregroundColor(Color(red: 0.12, green: 0.09, blue: 0.09))
}

Spacer()

VStack(spacing:2){
CustomTextField(systemName: "person", placeholder: "First Name", text: $companionRegisterViewModel.firstName).padding(10)
Expand All @@ -46,9 +44,7 @@ struct CompanionRegisterScreen: View {
CustomTextField(systemName: "envelope", placeholder: "Email", text: $companionRegisterViewModel.email).padding(10)
.keyboardType(.emailAddress)

CustomTextField(systemName: "lock", placeholder: "Password", text: $companionRegisterViewModel.password).padding(10)

CustomTextField(systemName: "person", placeholder: "Companion’s referral", text: $companionRegisterViewModel.companionReferral).padding(10)
CustomTextField(systemName: "lock", placeholder: "Companion’s referral", text: $companionRegisterViewModel.companionReferral).padding(10)


HStack {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RegisterViewModel: ObservableObject {


func register() {
DatabaseManager.shared.addUser(username: firstName+lastName, password: password, email: email)
DatabaseManager.shared.addUser(username: firstName+lastName, password: password, email: email, token: 123)
isRegistered = true

}
Expand Down

0 comments on commit 4348455

Please sign in to comment.