-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Refactoring v0.0.1 #16
base: master
Are you sure you want to change the base?
Changes from all commits
52c5c48
c20b9da
931588a
3cde985
327da91
312fd40
dd5e4a2
c65accd
96fe18a
3a17003
286086e
c7602d2
75de36c
145b14d
ed01257
ba652e1
e58d45f
28157da
802257c
1024691
725ee9d
7312503
bd61ac0
89e51ea
5b5015b
da2dfa2
14720ae
3c308f3
403608a
c2bd6a1
4a55813
09a7ec8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
iStore.xcodeproj/project.xcworkspace/xcuserdata/mohamedsayed.xcuserdatad/UserInterfaceState.xcuserstate | ||
*.xcuserstate | ||
*.xcuserstate | ||
*.xcuserstate |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
import SwiftUI | ||
|
||
struct CartList: View { | ||
|
||
private let carts: [CartData] | ||
|
||
init(carts: [CartData]) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
import SwiftUI | ||
|
||
struct CheckOutButton: View { | ||
|
||
private let total: Int | ||
private let action: () -> Void | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,23 +8,33 @@ | |
import SwiftUI | ||
|
||
struct ContentView: View { | ||
@EnvironmentObject private var locationDataManager: LocationDataManager | ||
|
||
private let user: AuthenticatedUser | ||
private let isGuest: Bool | ||
|
||
init(user: AuthenticatedUser, isGuest: Bool) { | ||
self.user = user | ||
self.isGuest = isGuest | ||
} | ||
|
||
var body: some View { | ||
TabView { | ||
HomeView() | ||
HomeView(id: user.id, homeAddress: user.address.address, homePostalCode: user.address.postalCode, homeCity: user.address.city, homeState: user.address.state, homeLatitude: user.address.coordinates.lat, homeLongitude: user.address.coordinates.lng, currentAddress: locationDataManager.address, currentPostalCode: locationDataManager.postalCode, currentCity: locationDataManager.city, currentState: locationDataManager.state, currentLatitude: locationDataManager.latitude, currentLongitude: locationDataManager.longitude, isCurrentLocation: locationDataManager.isCurrentLocation, isGuest: isGuest, getLocationPermission: locationDataManager.requestUserLocationPermission) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it better to create a custom object with all passing properties and pass it directly to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I will try it and push the changes. |
||
.tabItem { | ||
Image(systemName: "house.fill") | ||
} | ||
|
||
CartView() | ||
CartView(id: user.id) | ||
.tabItem { | ||
Image(systemName: "bag.fill") | ||
Image(systemName: "cart") | ||
} | ||
|
||
ProfileView() | ||
ProfileView(username: user.username, firstName: user.firstName, lastName: user.lastName, maidenName: user.maidenName, email: user.email, phone: user.phone, image: user.image, homeAddress: user.address.address, homePostalCode: user.address.postalCode, homeCity: user.address.city, homeState: user.address.state, isGuest: isGuest) | ||
.tabItem { | ||
Image(systemName: "person.fill") | ||
} | ||
} | ||
.accentColor(.pink) | ||
.tint(.pink) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you add this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It caused Problems with Applying stashed or merging other branches into the branch.