-
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.
Merge pull request #19 from vespinola/18-create-a-view-for-packages-f…
…or-withdrawal 18 create a view for packages for withdrawal
- Loading branch information
Showing
29 changed files
with
460 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ struct AuthRepository: AuthRepositoryProtocol { | |
decoder: JSONDecoder() | ||
) | ||
|
||
// let model = LoginEntity(username: "[email protected]", accessToken: "eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTejJzVFFSUitpU2tWaXRnV0ZFUXFIdXBOTmpZaE5DR1gybEtsc0NSaXpLV0NaYkw3c2s0N083UE96S2FiaThTTFBYZ1ExSUxneFlNbjZYXC9peVQ5QUVPODk5K3FidE0ybVhvckx3aTV2dnYxK3ZUMDZoaG1qb1JwcHhvWHhFcEZHWEhvbTBWeEdCb05VY3p2MFVvTTZSRHRHUEI0RHV6U0IwNnRRaElJUFJSNWFXUFIzMllDVkJaTlJ1ZDNieGNBMk13MFZwYU16eHI1bU1lNHJ2ZWROdUFPbDhZSkFUbDFZSzhMc05peXdJRkNwdEMwbE43T0Vhd3kzWVQ2ZitTclljNk1iQVoyZ3RKd0pNdzJkUmNsNkFrTWY1bGhxWHlwUzVXZ3NYRDgxbTFvdXloMjBUUit1SnN3WWN2ZFBrbzUxMXQyNXN5a3B3U3Q0RGFVc0tkQkYzZDF6VU1cL3hlQnRLQ0VyTmxUVExYUm1ya1BlNUV5ZiswZEtIbisrXC9qTHBGQU9ya1wvdVhmNVBOYjZ6RDY4ZUxrenJqb1FtRGg1cFQxSE5iTUVuS3prRE1cLzAraVVmMzErOHZIdytPRDVGVkoyaUVmXC92NFwvbGgyZk5EVGRVbkRETnJKcmFFZEh1bDl3N2thOWZUbjYraGFIWDRYRWlrUDRvYVRHY1NPVEVGTGVrbFRqdjI4SzFwMjFcL2M2ZlYzbkhQVG1iaGJyOGZybFRweGxWV2J6UjZyRjZyWTZOU3FmYnJxMkd0aGc4czNCNElGdktZYXc5TndxVVNiQzJLS1JtWmlTZDl1VVY3VzJRalFyMzQ1K3Uza3pjSGRkTGZncGtCRXluU3h1WnpYQ3VOZTZqZkhoMHV6WDM2XC9XNmNIOERcL1wvaGNLbEMyeFN3TUFBQT09Iiwic3ViIjoidmxhZGltaXIuZXNwaW5vbGFAZ21haWwuY29tIiwiZXhwIjoxNzI0NTQxOTQ3LCJpYXQiOjE3MTg0OTM5NDcsInJvbGVzIjpbIlJPTEVfTk9fUk9MRVMiXX0._SSqulgIqcM0GabBT7oSULFsWEgiFGQKDGDpVKdFy3U") | ||
// | ||
AppData.shared.updateToken(model.accessToken) | ||
} | ||
} |
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
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
mobile-courier-app/Presentation/Helpers/Modifiers/RoundedIndicatorViewModifier.swift
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,26 @@ | ||
// | ||
// RoundedIndicatorViewModifier.swift | ||
// mobile-courier-app | ||
// | ||
// Created by Vladimir Espinola on 2024-06-19. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct RoundedIndicatorViewModifier: ViewModifier { | ||
func body(content: Content) -> some View { | ||
content | ||
.padding(4) | ||
.foregroundStyle(.white) | ||
.background( | ||
RoundedRectangle(cornerRadius: 8) | ||
.foregroundStyle(.accent) | ||
) | ||
} | ||
} | ||
|
||
extension View { | ||
func roundedIndicator() -> some View { | ||
ModifiedContent(content: self, modifier: RoundedIndicatorViewModifier()) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
43 changes: 0 additions & 43 deletions
43
mobile-courier-app/Presentation/Package/PackagesView.swift
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
mobile-courier-app/Presentation/PackagesForWithdrawal/GroupedPackageReadyView.swift
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,67 @@ | ||
// | ||
// GroupedPackageReadyView.swift | ||
// mobile-courier-app | ||
// | ||
// Created by Vladimir Espinola on 2024-06-19. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct GroupedPackageReadyView: View { | ||
|
||
var groupedPackage: GroupedPackageEntity | ||
|
||
var body: some View { | ||
VStack(spacing: 8) { | ||
HStack(alignment: .center) { | ||
Text("At the branch") | ||
.roundedIndicator() | ||
|
||
Spacer() | ||
|
||
VStack(alignment: .trailing) { | ||
Text("\(groupedPackage.totalWeight) Kg") | ||
} | ||
} | ||
|
||
HStack { | ||
Text("\(groupedPackage.paquetes.count) packages") | ||
|
||
Spacer() | ||
|
||
Text("Gs. \(groupedPackage.formattedTotalCost)") | ||
.foregroundStyle(.accent) | ||
.font(.title2) | ||
.fontWeight(.bold) | ||
} | ||
|
||
} | ||
.frame(maxWidth: .infinity) | ||
.padding(.init( | ||
top: 8, | ||
leading: 16, | ||
bottom: 8, | ||
trailing: 16) | ||
) | ||
.foregroundStyle(.black) | ||
.background( | ||
RoundedRectangle(cornerRadius: 6) | ||
.fill(Color.surface) | ||
) | ||
.clipped() | ||
.listRowSeparator(.hidden) | ||
.listRowSpacing(.zero) | ||
.listRowInsets(.none) | ||
} | ||
} | ||
|
||
#Preview { | ||
GroupedPackageReadyView( | ||
groupedPackage: .init( | ||
embarqueCodigo: 2000, | ||
paquetes: [ | ||
.mock | ||
] | ||
) | ||
) | ||
} |
Oops, something went wrong.