Skip to content

Commit

Permalink
1941
Browse files Browse the repository at this point in the history
  • Loading branch information
Velkonost committed Feb 10, 2024
1 parent 8f8750b commit cb5e770
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.velkonost.getbetter.android.features.profile.ProfileNavRoute
import com.velkonost.getbetter.android.features.settings.SettingsNavRoute
import com.velkonost.getbetter.android.features.social.SocialNavRoute
import com.velkonost.getbetter.android.features.splash.SplashNavRoute
import com.velkonost.getbetter.android.features.subscription.SubscriptionNavRoute
import com.velkonost.getbetter.android.features.taskdetail.TaskDetailNavRoute
import com.velkonost.getbetter.core.compose.provide
import com.velkonost.getbetter.shared.core.vm.navigation.NavigationScreen
Expand All @@ -27,7 +28,8 @@ val AppScreens = setOf(
AddAreaNavRoute,
NoteDetailNavRoute,
TaskDetailNavRoute,
AbilityDetailsNavRoute
AbilityDetailsNavRoute,
SubscriptionNavRoute
)

val NavigationScreens = setOf(
Expand Down
16 changes: 16 additions & 0 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
46D8577E2AD0787E00BE74DA /* AddAreaHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D8577D2AD0787E00BE74DA /* AddAreaHeader.swift */; };
46D9381C2ABAECB70096A221 /* ProfileRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D9381B2ABAECB70096A221 /* ProfileRoute.swift */; };
46D9381E2ABAECBE0096A221 /* ProfileScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D9381D2ABAECBE0096A221 /* ProfileScreen.swift */; };
46DEF1CC2B77778B00C238FE /* SubscriptionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46DEF1CB2B77778B00C238FE /* SubscriptionScreen.swift */; };
46DEF1CE2B7777C300C238FE /* SubscriptionRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46DEF1CD2B7777C300C238FE /* SubscriptionRoute.swift */; };
46E0030A2B691F97006BF54E /* OnboardingContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E003092B691F97006BF54E /* OnboardingContent.swift */; };
46E20A282B2F4DAA0037CEEF /* OnboardingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E20A272B2F4DAA0037CEEF /* OnboardingScreen.swift */; };
46E20A2A2B2F4DB10037CEEF /* OnboardingRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E20A292B2F4DB10037CEEF /* OnboardingRoute.swift */; };
Expand Down Expand Up @@ -337,6 +339,8 @@
46D8577D2AD0787E00BE74DA /* AddAreaHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAreaHeader.swift; sourceTree = "<group>"; };
46D9381B2ABAECB70096A221 /* ProfileRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileRoute.swift; sourceTree = "<group>"; };
46D9381D2ABAECBE0096A221 /* ProfileScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileScreen.swift; sourceTree = "<group>"; };
46DEF1CB2B77778B00C238FE /* SubscriptionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionScreen.swift; sourceTree = "<group>"; };
46DEF1CD2B7777C300C238FE /* SubscriptionRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionRoute.swift; sourceTree = "<group>"; };
46E003092B691F97006BF54E /* OnboardingContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingContent.swift; sourceTree = "<group>"; };
46E20A272B2F4DAA0037CEEF /* OnboardingScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingScreen.swift; sourceTree = "<group>"; };
46E20A292B2F4DB10037CEEF /* OnboardingRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingRoute.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -552,6 +556,7 @@
461F7C6D2AA8D7DE003791CF /* Features */ = {
isa = PBXGroup;
children = (
46DEF1CA2B77778200C238FE /* Subscription */,
46E20A262B2F4DA20037CEEF /* Onboarding */,
46407B942B287345004A3AA2 /* AbilityDetails */,
46E380492B24D86500056C0D /* Abilities */,
Expand Down Expand Up @@ -936,6 +941,15 @@
path = Profile;
sourceTree = "<group>";
};
46DEF1CA2B77778200C238FE /* Subscription */ = {
isa = PBXGroup;
children = (
46DEF1CB2B77778B00C238FE /* SubscriptionScreen.swift */,
46DEF1CD2B7777C300C238FE /* SubscriptionRoute.swift */,
);
path = Subscription;
sourceTree = "<group>";
};
46E20A262B2F4DA20037CEEF /* Onboarding */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1261,6 +1275,7 @@
46407B962B28734E004A3AA2 /* AbilityDetailsScreen.swift in Sources */,
46AEEF7D2B0BB76B00A9376C /* CalendarDateItem.swift in Sources */,
467D996C2AFA1C9C00F4397E /* AuthorData.swift in Sources */,
46DEF1CC2B77778B00C238FE /* SubscriptionScreen.swift in Sources */,
46B17E142AADE482008C2BC4 /* AuthTextField.swift in Sources */,
46E2DD2F2AE93A3B00B4B2B5 /* AreaPicker.swift in Sources */,
460054B72ABB576B00586767 /* WisdomItem.swift in Sources */,
Expand Down Expand Up @@ -1329,6 +1344,7 @@
46059D2D2AC41DB500DC5015 /* ExpandableButtonPanel.swift in Sources */,
468B87682ABC45BF001BBEB1 /* DiaryRoute.swift in Sources */,
464B60B62ABAF81B00369EC3 /* Avatar.swift in Sources */,
46DEF1CE2B7777C300C238FE /* SubscriptionRoute.swift in Sources */,
468B794F2ACC57F000A8886C /* AddNoteItem.swift in Sources */,
468B876C2ABC45CC001BBEB1 /* CalendarsRoute.swift in Sources */,
468356FF2B0E326800DC356A /* ActionItem.swift in Sources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,8 @@
filePath = "iosApp/App/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "143"
endingLineNumber = "143"
startingLineNumber = "146"
endingLineNumber = "146"
landmarkName = "handle(resource:)"
landmarkType = "7">
</BreakpointContent>
Expand All @@ -1362,8 +1362,8 @@
filePath = "iosApp/App/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "135"
endingLineNumber = "135"
startingLineNumber = "138"
endingLineNumber = "138"
landmarkName = "body"
landmarkType = "24">
</BreakpointContent>
Expand All @@ -1378,8 +1378,8 @@
filePath = "iosApp/App/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "151"
endingLineNumber = "151"
startingLineNumber = "154"
endingLineNumber = "154"
landmarkName = "handle(resource:)"
landmarkType = "7">
<Locations>
Expand Down Expand Up @@ -1441,8 +1441,8 @@
filePath = "iosApp/App/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "146"
endingLineNumber = "146"
startingLineNumber = "149"
endingLineNumber = "149"
landmarkName = "handle(resource:)"
landmarkType = "7">
<Locations>
Expand Down
3 changes: 3 additions & 0 deletions iosApp/iosApp/App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ struct ContentView: View {
case _ where route.starts(with: NavigationScreenKt.ONBOARDING_DESTINATION) :
OnboardingRoute().view(pilot: pilot, route: route)

case _ where route.starts(with: NavigationScreenKt.SUBSCRIPTION_DESTINATION) :
SubscriptionRoute().view(pilot: pilot, route: route)

default : EmptyView()
}

Expand Down
3 changes: 2 additions & 1 deletion iosApp/iosApp/App/Koin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ extension KoinApplication {
\.TaskDetailViewModel,
\.AbilitiesViewModel,
\.AbilityDetailsViewModel,
\.OnboardingViewModel
\.OnboardingViewModel,
\.SubscriptionViewModel
]

static func inject<T>() -> T { shared.inject() }
Expand Down
3 changes: 1 addition & 2 deletions iosApp/iosApp/Features/Diary/notes/NotesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ struct NotesView: View {
let onBottomReach: () -> Void

init(
adPosition: Int,
state: Binding<NotesViewState>,
adPosition: Int, state: Binding<NotesViewState>,
isLoading: Bool, items: [Note],
createGoalClick: @escaping () -> Void, createNoteClick: @escaping () -> Void,
itemClick: @escaping (Note) -> Void,
Expand Down
5 changes: 4 additions & 1 deletion iosApp/iosApp/Features/Diary/tasks/TasksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ struct TasksView: View {
private let onTaskFavoriteClick: (TaskUI) -> Void

init(
isLoading: Bool, favoriteItems: [TaskUI], currentItems: [TaskUI], completedItems: [TaskUI],
isLoading: Bool,
favoriteItems: [TaskUI],
currentItems: [TaskUI],
completedItems: [TaskUI],
onTaskClick: @escaping (TaskUI) -> Void,
onTaskFavoriteClick: @escaping (TaskUI) -> Void,
onTaskListUpdateClick: @escaping () -> Void
Expand Down
6 changes: 5 additions & 1 deletion iosApp/iosApp/Features/Diary/tasks/components/TaskItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ struct TaskItem: View {
private let onClick: () -> Void
private let onFavoriteClick: () -> Void

init(item: TaskUI, onClick: @escaping () -> Void, onFavoriteClick: @escaping () -> Void) {
init(
item: TaskUI,
onClick: @escaping () -> Void,
onFavoriteClick: @escaping () -> Void
) {
self.item = item
self.onClick = onClick
self.onFavoriteClick = onFavoriteClick
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ struct TaskItemHeader : View {
let isFavoriteLoading: Bool
let onFavoriteClick: (() -> Void)?

init(areaName: String, taskName: String? = nil, areaIcon: UIImage, isFavorite: Bool, isFavoriteLoading: Bool, onFavoriteClick: (() -> Void)? = nil) {
init(
areaName: String,
taskName: String? = nil,
areaIcon: UIImage,
isFavorite: Bool,
isFavoriteLoading: Bool,
onFavoriteClick: (() -> Void)? = nil
) {
self.areaName = areaName
self.taskName = taskName
self.areaIcon = areaIcon
Expand Down
39 changes: 39 additions & 0 deletions iosApp/iosApp/Features/Subscription/SubscriptionRoute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// SubscriptionRoute.swift
// iosApp
//
// Created by velkonost on 10.02.2024.
// Copyright © 2024 orgName. All rights reserved.
//

import Foundation
import SharedSDK
import SwiftUI

struct SubscriptionRoute: NavRoute {
typealias T = SubscriptionViewModel

var route: String {
return NavigationScreen.SubscriptionNavScreen.shared.route
}

var menuIcon: UIImage? {
return nil
}

var content: some View {
return SubscriptionScreen(viewModel: viewModel)
}

var viewModel: SubscriptionViewModel {
@LazyKoin var delegate: SubscriptionViewModel
return delegate
}

func getArguments() -> Array<String> {
return []
}

}


22 changes: 22 additions & 0 deletions iosApp/iosApp/Features/Subscription/SubscriptionScreen.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SubscriptionScreen.swift
// iosApp
//
// Created by velkonost on 10.02.2024.
// Copyright © 2024 orgName. All rights reserved.
//

import Foundation
import SwiftUI
import SharedSDK
import KMMViewModelSwiftUI
import KMPNativeCoroutinesAsync

struct SubscriptionScreen: View {

@StateViewModel var viewModel: SubscriptionViewModel

var body: some View {
@State var state = viewModel.viewStateValue as! SubscriptionViewState
}
}

0 comments on commit cb5e770

Please sign in to comment.