-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interactive Widget
- Loading branch information
Showing
50 changed files
with
734 additions
and
353 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file modified
BIN
-29 KB
(30%)
CalendarX/Assets.xcassets/Recommendations/HostsX.imageset/HostsX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-21.5 KB
(33%)
CalendarX/Assets.xcassets/Recommendations/OnlySwitch.imageset/OnlySwitch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,59 @@ | ||
import SwiftUI | ||
import CalendarXShared | ||
|
||
struct CalendarXView: View { | ||
|
||
@StateObject | ||
private var router = Router.shared | ||
|
||
@StateObject | ||
private var alertVM = AlertViewModel.shared | ||
|
||
@StateObject | ||
private var settingsVM = SettingsViewModel() | ||
|
||
|
||
private let mainVM = MainViewModel() | ||
|
||
var body: some View { | ||
|
||
ZStack { | ||
Color.appBackground.padding(.top, -15) | ||
rootView | ||
detailView | ||
AlertView(viewModel: alertVM) | ||
} | ||
.appForeground(.appPrimary) | ||
.environment(\.locale, settingsVM.locale) | ||
.envTint(settingsVM.color) | ||
.envColorScheme(settingsVM.colorScheme) | ||
.onChange(of: settingsVM.locale, notification: NSLocale.currentLocaleDidChangeNotification) | ||
|
||
} | ||
|
||
@ViewBuilder | ||
private var rootView: some View { | ||
switch router.root { | ||
case .calendar: MainView(viewModel: mainVM) | ||
case .settings: SettingsView(viewModel: settingsVM) | ||
case .unknown: EmptyView() | ||
} | ||
} | ||
|
||
|
||
@ViewBuilder | ||
private var detailView: some View { | ||
switch router.path { | ||
case .date(let appDate): DateView(appDate: appDate).fullScreenCover() | ||
case .recommendations: RecommendationsView().fullScreenCover() | ||
case .menubarSettings: MenubarSettingsView().fullScreenCover() | ||
case .appearanceSettings: AppearanceSettingsView(viewModel: settingsVM).fullScreenCover() | ||
case .calendarSettings: CalendarSettingsView().fullScreenCover() | ||
case .about: AboutView().fullScreenCover() | ||
default: EmptyView() | ||
} | ||
} | ||
|
||
|
||
} | ||
|
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
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 |
---|---|---|
|
@@ -60,5 +60,7 @@ struct AboutView: View { | |
|
||
} | ||
.frame(height: .mainHeight, alignment: .top) | ||
.padding() | ||
|
||
} | ||
} |
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 |
---|---|---|
|
@@ -49,7 +49,8 @@ struct MenubarSettingsView: View { | |
|
||
} | ||
.focusable(false) | ||
|
||
.padding() | ||
|
||
} | ||
|
||
|
||
|
Oops, something went wrong.