Skip to content

Commit

Permalink
Customize Home View
Browse files Browse the repository at this point in the history
  • Loading branch information
nriedman committed Apr 3, 2024
1 parent 5c6ce1f commit b56db18
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 9 deletions.
48 changes: 48 additions & 0 deletions ENGAGEHF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; };
2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */ = {isa = PBXBuildFile; productRef = 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */; };
2FF53D8D2A8729D600042B76 /* ENGAGEHFStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */; };
4DB025B72BBDE903002D2545 /* DashboardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025B62BBDE903002D2545 /* DashboardView.swift */; };
4DB025BD2BBDE9F7002D2545 /* HeartHealthView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */; };
4DB025BF2BBDEA03002D2545 /* EducationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025BE2BBDEA03002D2545 /* EducationView.swift */; };
4DB025C12BBDEA0B002D2545 /* MedicationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */; };
56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */ = {isa = PBXBuildFile; productRef = 56E708342BB06B7100B08F0A /* SpeziLicense */; };
56E7083B2BB06F6F00B08F0A /* SwiftPackageList in Frameworks */ = {isa = PBXBuildFile; productRef = 56E7083A2BB06F6F00B08F0A /* SwiftPackageList */; };
653A2551283387FE005D4D48 /* ENGAGEHF.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A2550283387FE005D4D48 /* ENGAGEHF.swift */; };
Expand Down Expand Up @@ -124,6 +128,10 @@
2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SocialSupportQuestionnaire.json; sourceTree = "<group>"; };
2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = "<group>"; };
2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ENGAGEHFStandard.swift; sourceTree = "<group>"; };
4DB025B62BBDE903002D2545 /* DashboardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardView.swift; sourceTree = "<group>"; };
4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartHealthView.swift; sourceTree = "<group>"; };
4DB025BE2BBDEA03002D2545 /* EducationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EducationView.swift; sourceTree = "<group>"; };
4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MedicationsView.swift; sourceTree = "<group>"; };
653A254D283387FE005D4D48 /* ENGAGEHF.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ENGAGEHF.app; sourceTree = BUILT_PRODUCTS_DIR; };
653A2550283387FE005D4D48 /* ENGAGEHF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ENGAGEHF.swift; sourceTree = "<group>"; };
653A255428338800005D4D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -273,6 +281,38 @@
path = Helper;
sourceTree = "<group>";
};
4DB025B52BBDE8EC002D2545 /* Dashboard */ = {
isa = PBXGroup;
children = (
4DB025B62BBDE903002D2545 /* DashboardView.swift */,
);
path = Dashboard;
sourceTree = "<group>";
};
4DB025B92BBDE9CB002D2545 /* HeartHealth */ = {
isa = PBXGroup;
children = (
4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */,
);
path = HeartHealth;
sourceTree = "<group>";
};
4DB025BA2BBDE9DA002D2545 /* Medications */ = {
isa = PBXGroup;
children = (
4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */,
);
path = Medications;
sourceTree = "<group>";
};
4DB025BB2BBDE9E2002D2545 /* Education */ = {
isa = PBXGroup;
children = (
4DB025BE2BBDEA03002D2545 /* EducationView.swift */,
);
path = Education;
sourceTree = "<group>";
};
653A2544283387FE005D4D48 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -303,6 +343,10 @@
2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */,
2F4E23822989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift */,
2FC975A72978F11A00BA99FE /* Home.swift */,
4DB025B52BBDE8EC002D2545 /* Dashboard */,
4DB025B92BBDE9CB002D2545 /* HeartHealth */,
4DB025BB2BBDE9E2002D2545 /* Education */,
4DB025BA2BBDE9DA002D2545 /* Medications */,
A9720E412ABB68B300872D23 /* Account */,
2FE5DC2829EDD398004B9AB4 /* Onboarding */,
2FE5DC3B29EDD7D0004B9AB4 /* Schedule */,
Expand Down Expand Up @@ -540,16 +584,20 @@
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */,
2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */,
2F4FC8D729EE69D300BFFE26 /* MockUpload.swift in Sources */,
4DB025C12BBDEA0B002D2545 /* MedicationsView.swift in Sources */,
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */,
2FE5DC3829EDD7CA004B9AB4 /* InterestingModules.swift in Sources */,
4DB025BF2BBDEA03002D2545 /* EducationView.swift in Sources */,
2FE5DC3529EDD7CA004B9AB4 /* Consent.swift in Sources */,
2FE5DC4529EDD7F2004B9AB4 /* Binding+Negate.swift in Sources */,
4DB025B72BBDE903002D2545 /* DashboardView.swift in Sources */,
2FC975A82978F11A00BA99FE /* Home.swift in Sources */,
2FE5DC4E29EDD7FA004B9AB4 /* ScheduleView.swift in Sources */,
A9DFE8A92ABE551400428242 /* AccountButton.swift in Sources */,
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */,
2FF53D8D2A8729D600042B76 /* ENGAGEHFStandard.swift in Sources */,
2FE5DC4729EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift in Sources */,
4DB025BD2BBDE9F7002D2545 /* HeartHealthView.swift in Sources */,
A9720E432ABB68CC00872D23 /* AccountSetupHeader.swift in Sources */,
2FE5DC4029EDD7EE004B9AB4 /* FeatureFlags.swift in Sources */,
2FE5DC4629EDD7F2004B9AB4 /* Bundle+Image.swift in Sources */,
Expand Down
60 changes: 60 additions & 0 deletions ENGAGEHF/Dashboard/DashboardView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// SPDX-License-Identifier: MIT
//
// DashboardView.swift
// ENGAGEHF
//
// Created by Nick Riedman on 4/3/24.
//

import SpeziAccount
import SpeziMockWebService
import SwiftUI

struct HomeTitle: View {
@Binding var presentingAccount: Bool

var body: some View {
HStack {
titleBar
AccountButton(isPresented: $presentingAccount)
}
}

private var titleBar: some View {
Text("ENGAGE-HF Home")
.font(.title)
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color("AccentColor"))
}
}

struct Dashboard: View {
@Binding var presentingAccount: Bool

var body: some View {
VStack {
// Title


// Greeting and Date

// Notifications

// To-Do list

// Latest Vitals

// Symptom Survey
}
.toolbar {
AccountButton(isPresented: $presentingAccount)
}
}
}
22 changes: 22 additions & 0 deletions ENGAGEHF/Education/EducationView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// EducationView.swift
// ENGAGEHF
//
// Created by Nick Riedman on 4/3/24.
//

import SpeziAccount
import SpeziMockWebService
import SwiftUI

struct Education: View {
@Binding var presentingAccount: Bool

var body: some View {
Text("Education Test")
}
}
24 changes: 24 additions & 0 deletions ENGAGEHF/HeartHealth/HeartHealthView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// SPDX-License-Identifier: MIT
//
// HeartHealthView.swift
// ENGAGEHF
//
// Created by Nick Riedman on 4/3/24.
//

import SpeziAccount
import SpeziMockWebService
import SwiftUI

struct HeartHealth: View {
@Binding var presentingAccount: Bool

var body: some View {
Text("Heart Health Test")
}
}
30 changes: 21 additions & 9 deletions ENGAGEHF/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import SwiftUI

struct HomeView: View {
enum Tabs: String {
case schedule
case contact
case home
case heart
case medications
case education
case mockUpload
}

Expand All @@ -23,21 +25,31 @@ struct HomeView: View {
}


@AppStorage(StorageKeys.homeTabSelection) private var selectedTab = Tabs.schedule
@AppStorage(StorageKeys.homeTabSelection) private var selectedTab = Tabs.home
@State private var presentingAccount = false


var body: some View {
TabView(selection: $selectedTab) {
ScheduleView(presentingAccount: $presentingAccount)
.tag(Tabs.schedule)
Dashboard(presentingAccount: $presentingAccount)
.tag(Tabs.home)
.tabItem {
Label("SCHEDULE_TAB_TITLE", systemImage: "list.clipboard")
Label("Home", systemImage: "house")
}
Contacts(presentingAccount: $presentingAccount)
.tag(Tabs.contact)
HeartHealth(presentingAccount: $presentingAccount)
.tag(Tabs.heart)
.tabItem {
Label("CONTACTS_TAB_TITLE", systemImage: "person.fill")
Label("Heart Health", systemImage: "heart.square")
}
Medications(presentingAccount: $presentingAccount)
.tag(Tabs.medications)
.tabItem {
Label("Medications", systemImage: "pill")
}
Education(presentingAccount: $presentingAccount)
.tag(Tabs.education)
.tabItem {
Label("Education", systemImage: "book.pages")
}
if FeatureFlags.disableFirebase {
MockUpload(presentingAccount: $presentingAccount)
Expand Down
22 changes: 22 additions & 0 deletions ENGAGEHF/Medications/MedicationsView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// MedicationsView.swift
// ENGAGEHF
//
// Created by Nick Riedman on 4/3/24.
//

import SpeziAccount
import SpeziMockWebService
import SwiftUI

struct Medications: View {
@Binding var presentingAccount: Bool

var body: some View {
Text("Medications Test")
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.373",
"green" : "0.412",
"red" : "0.176"
}
},
"idiom" : "universal"
}
],
Expand Down
26 changes: 26 additions & 0 deletions ENGAGEHF/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
},
"CONTACTS_TAB_TITLE" : {
"comment" : "MARK: - Contacts",
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
Expand All @@ -103,6 +104,12 @@
}
}
}
},
"Education" : {

},
"Education Test" : {

},
"HEALTHKIT_PERMISSIONS_BUTTON" : {
"localizations" : {
Expand Down Expand Up @@ -144,6 +151,15 @@
}
}
}
},
"Heart Health" : {

},
"Heart Health Test" : {

},
"Home" : {

},
"INTERESTING_MODULES_AREA1_DESCRIPTION" : {
"localizations" : {
Expand Down Expand Up @@ -275,6 +291,12 @@
}
}
}
},
"Medications" : {

},
"Medications Test" : {

},
"MOCK_WEB_SERVICE_TAB_TITLE" : {
"comment" : "MARK: - Mock Upload Data Storage Provider",
Expand Down Expand Up @@ -340,6 +362,7 @@
},
"SCHEDULE_TAB_TITLE" : {
"comment" : "MARK: - Schedule",
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
Expand Down Expand Up @@ -398,6 +421,9 @@
}
}
}
},
"Test" : {

},
"WELCOME_AREA1_DESCRIPTION" : {
"localizations" : {
Expand Down

0 comments on commit b56db18

Please sign in to comment.