generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Customize Landing Page ## ♻️ Current situation & Problem Currently, the app is a direct copy of the Spezi Template Application, with general views unrelated to ENGAGE-HF. ## ⚙️ Release Notes - Developed the Home tab to have basic navigation structure, including title, account button, and a greeting that includes the current date ## 📚 Documentation The landing page now appears like this: <img width="256" alt="Screenshot 2024-04-04 at 4 16 17 PM" src="https://github.com/StanfordBDHG/ENGAGE-HF/assets/108841122/ec999c99-5e5a-4249-af83-ff63482e63b2"> ## ✅ Testing Implemented UI tests for the Tab buttons and Static Text fields. Further testing will be implemented after authentication is integrated into the app. ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [X] I agree to follow the [Code of Conduct] --------- Co-authored-by: Paul Schmiedmayer <[email protected]>
- Loading branch information
1 parent
5c6ce1f
commit db813e6
Showing
20 changed files
with
157 additions
and
715 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,29 @@ | ||
// | ||
// 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 | ||
// | ||
|
||
import SwiftUI | ||
|
||
|
||
struct Greeting: View { | ||
var body: some View { | ||
HStack(alignment: .top) { | ||
Text("Hello, world!") | ||
.font(.title.bold()) | ||
Spacer() | ||
Text(.now, style: .date) | ||
.font(.title3) | ||
.foregroundStyle(.secondary) | ||
} | ||
.padding() | ||
} | ||
} | ||
|
||
|
||
#Preview { | ||
Greeting() | ||
} |
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 |
---|---|---|
|
@@ -7,45 +7,30 @@ | |
// | ||
|
||
import SpeziAccount | ||
import SpeziMockWebService | ||
import SwiftUI | ||
|
||
|
||
struct HomeView: View { | ||
enum Tabs: String { | ||
case schedule | ||
case contact | ||
case mockUpload | ||
case home | ||
} | ||
|
||
static var accountEnabled: Bool { | ||
!FeatureFlags.disableFirebase && !FeatureFlags.skipOnboarding | ||
} | ||
|
||
|
||
@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) | ||
.tabItem { | ||
Label("CONTACTS_TAB_TITLE", systemImage: "person.fill") | ||
} | ||
if FeatureFlags.disableFirebase { | ||
MockUpload(presentingAccount: $presentingAccount) | ||
.tag(Tabs.mockUpload) | ||
.tabItem { | ||
Label("MOCK_WEB_SERVICE_TAB_TITLE", systemImage: "server.rack") | ||
} | ||
} | ||
} | ||
.sheet(isPresented: $presentingAccount) { | ||
AccountSheet() | ||
|
@@ -58,29 +43,12 @@ struct HomeView: View { | |
} | ||
|
||
|
||
#if DEBUG | ||
#Preview { | ||
let details = AccountDetails.Builder() | ||
.set(\.userId, value: "[email protected]") | ||
.set(\.name, value: PersonNameComponents(givenName: "Leland", familyName: "Stanford")) | ||
|
||
return HomeView() | ||
.previewWith(standard: ENGAGEHFStandard()) { | ||
ENGAGEHFScheduler() | ||
MockWebService() | ||
AccountConfiguration(building: details, active: MockUserIdPasswordAccountService()) | ||
} | ||
} | ||
|
||
#Preview { | ||
CommandLine.arguments.append("--disableFirebase") // make sure the MockWebService is displayed | ||
CommandLine.arguments.append("--disableFirebase") | ||
return HomeView() | ||
.previewWith(standard: ENGAGEHFStandard()) { | ||
ENGAGEHFScheduler() | ||
MockWebService() | ||
AccountConfiguration { | ||
MockUserIdPasswordAccountService() | ||
} | ||
} | ||
} | ||
#endif |
Oops, something went wrong.