-
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 #411 from PermanentOrg/feature/VSP-1354-Redeem-Sto…
…rage VSP-1354 [iOS] Redeem Code screen.
- Loading branch information
Showing
90 changed files
with
1,518 additions
and
612 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
45 changes: 45 additions & 0 deletions
45
Permanent/Common/Base/SwiftUIViews/AlertsViews/BottomInfoMessageView.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,45 @@ | ||
// | ||
// BottomInfoMessageView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 10.01.2024. | ||
|
||
import SwiftUI | ||
|
||
struct BottomInfoMessageView: View { | ||
var alertTextTitle: String | ||
var alertTextDescription: String | ||
var closeAction: (() -> Void) | ||
|
||
var body: some View { | ||
ZStack { | ||
Color(.success25) | ||
HStack(alignment: .top) { | ||
Image(.checkmarkGreen) | ||
VStack(alignment: .leading) { | ||
Text(alertTextTitle) | ||
.textStyle(SmallXRegularTextStyle()) | ||
.foregroundColor(.blue900) | ||
Text(alertTextDescription) | ||
.textStyle(SmallXXXRegularTextStyle()) | ||
.foregroundColor(.blue600) | ||
} | ||
Spacer() | ||
Button(action: closeAction) { | ||
Image(.closeGreen) | ||
} | ||
} | ||
.padding(.horizontal, 16) | ||
.padding(.vertical, 16) | ||
} | ||
.cornerRadius(12) | ||
.frame(height: 80) | ||
.shadow(color: Color(red: 0.07, green: 0.11, blue: 0.29).opacity(0.12), radius: 16, x: 0, y: 24) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 12) | ||
.inset(by: 0.5) | ||
.stroke(Color(.success200), lineWidth: 1) | ||
) | ||
.padding(.bottom, 24) | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Permanent/Common/Base/SwiftUIViews/AlertsViews/BottomInvalidAlertMessageView.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,46 @@ | ||
// | ||
// BottomInvalidAlertMessageView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 21.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct BottomInvalidAlertMessageView: View { | ||
var alertTextTitle: String | ||
var alertTextDescription: String | ||
var closeAction: (() -> Void) | ||
|
||
var body: some View { | ||
ZStack { | ||
Color(.error25) | ||
HStack(alignment: .top) { | ||
Image(.explanationMarkRed) | ||
VStack(alignment: .leading) { | ||
Text(alertTextTitle) | ||
.textStyle(SmallXRegularTextStyle()) | ||
.foregroundColor(.error500) | ||
Text(alertTextDescription) | ||
.textStyle(SmallXXXRegularTextStyle()) | ||
.foregroundColor(.blue600) | ||
} | ||
Spacer() | ||
Button(action: closeAction) { | ||
Image(.closeNavigationRed) | ||
} | ||
} | ||
.padding(.horizontal, 16) | ||
.padding(.vertical, 16) | ||
} | ||
.cornerRadius(12) | ||
.frame(height: 80) | ||
.shadow(color: Color(red: 0.07, green: 0.11, blue: 0.29).opacity(0.12), radius: 16, x: 0, y: 24) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 12) | ||
.inset(by: 0.5) | ||
.stroke(Color(.error200), lineWidth: 1) | ||
) | ||
.padding(.bottom, 24) | ||
} | ||
} | ||
|
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
Permanent/Common/Base/SwiftUIViews/ButtonViews/RoundButtonView.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,36 @@ | ||
// | ||
// RoundButtonView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 18.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct RoundButtonView: View { | ||
var isDisabled: Bool | ||
var isLoading: Bool | ||
let text: String | ||
let action: () -> Void | ||
|
||
var body: some View { | ||
Button(action: action, label: { | ||
ZStack { | ||
Color(isDisabled ? .blue200 : .blue900) | ||
HStack() { | ||
if isLoading { | ||
ProgressView() | ||
.progressViewStyle(CircularProgressViewStyle(tint: .white)) | ||
.frame(width: 10, height: 10) | ||
} else { | ||
Text(text) | ||
.textStyle(RegularSemiBoldTextStyle()) | ||
.foregroundColor(.white) | ||
} | ||
} | ||
} | ||
.frame(height: 56) | ||
.cornerRadius(12) | ||
}) | ||
.disabled(isDisabled || isLoading) | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Permanent/Common/Base/SwiftUIViews/CustomListItemView.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,46 @@ | ||
// | ||
// CustomListItemView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 15.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct CustomListItemView: View { | ||
var image: Image | ||
var titleText: String | ||
var descText: String | ||
|
||
var body: some View { | ||
VStack { | ||
HStack(alignment: .top, spacing: 24) { | ||
image | ||
.resizable() | ||
.foregroundColor(.blue900) | ||
.scaledToFit() | ||
.frame(width: 24, height: 24) | ||
.padding(.leading, 10) | ||
VStack(alignment: .leading, spacing: 8) { | ||
HStack(spacing: 10) { | ||
Text(titleText) | ||
.textStyle(SmallXSemiBoldTextStyle()) | ||
.foregroundColor(.blue900) | ||
if titleText == "Redeem code" { | ||
NewBadgeView() | ||
} | ||
} | ||
Text(descText) | ||
.textStyle(SmallXXXRegularTextStyle()) | ||
.foregroundColor(.blue400) | ||
.lineLimit(2) | ||
.multilineTextAlignment(.leading) | ||
} | ||
Spacer() | ||
Image(systemName: "chevron.right") | ||
.foregroundColor(.blue400) | ||
.padding(.trailing, 10) | ||
} | ||
.padding(10) | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
Permanent/Common/Base/SwiftUIViews/GradientCustomBarView.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,52 @@ | ||
// | ||
// GradientCustomBarView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 15.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct GradientProgressBarView: View { | ||
var value: String | ||
var maxValue: String | ||
var sizeRatio: Double | ||
@State private var redraw = UUID() | ||
|
||
var body: some View { | ||
LazyVStack(spacing: 16) { | ||
HStack { | ||
HStack(spacing: 0) { | ||
Text("\(value) ") | ||
.textStyle(SmallXXXSemiBoldTextStyle()) | ||
.foregroundColor(.white) | ||
if value.isNotEmpty { | ||
Text("used") | ||
.textStyle(SmallXXXRegularTextStyle()) | ||
.foregroundColor(.white) | ||
} | ||
} | ||
Spacer() | ||
Text("\(maxValue)") | ||
.textStyle(SmallXXXSemiBoldTextStyle()) | ||
.foregroundColor(.white) | ||
} | ||
.padding(.horizontal) | ||
ProgressView(value: sizeRatio) | ||
.progressViewStyle(CustomBarProgressStyle(color: .white, height: 8, cornerRadius: 3)) | ||
.frame(height: 12) | ||
.padding(.horizontal) | ||
.id(redraw) | ||
} | ||
.onChange(of: sizeRatio, perform: { newValue in | ||
updateRedraw() | ||
}) | ||
.frame(maxHeight: 72) | ||
.background(Gradient.purpleYellowGradient) | ||
.cornerRadius(12) | ||
.padding(16) | ||
} | ||
|
||
func updateRedraw() { | ||
redraw = UUID() | ||
} | ||
} |
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,31 @@ | ||
// | ||
// NewBadgeView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 15.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct NewBadgeView: View { | ||
var body: some View { | ||
HStack { | ||
if #available(iOS 16, *) { | ||
Text("NEW") | ||
.textStyle(SmallXXXXXSemiBoldTextStyle()) | ||
.kerning(1.6) | ||
.multilineTextAlignment(.center) | ||
.foregroundColor(.white) | ||
} else { | ||
Text("NEW") | ||
.textStyle(SmallXXXXXSemiBoldTextStyle()) | ||
.multilineTextAlignment(.center) | ||
.foregroundColor(.white) | ||
} | ||
} | ||
.frame(height: 24) | ||
.padding(.horizontal, 8) | ||
.padding(.vertical, 0) | ||
.background(Color(.yellow)) | ||
.cornerRadius(20) | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Permanent/Common/Base/SwiftUIViews/TextFieldViews/RoundStyledTextFieldView.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,46 @@ | ||
// | ||
// RoundStyledTextFieldView.swift | ||
// Permanent | ||
// | ||
// Created by Lucian Cerbu on 19.12.2023. | ||
|
||
import SwiftUI | ||
|
||
struct RoundStyledTextFieldView: View { | ||
@Binding var text: String | ||
var placeholderText: String | ||
var invalidField: Bool | ||
var doneAction: (() -> Void) | ||
|
||
var body: some View { | ||
ZStack { | ||
Color(.white) | ||
if #available(iOS 16.0, *) { | ||
TextField(placeholderText, text: $text) | ||
.modifier(RegularTextStyle()) | ||
.foregroundColor(Color.darkBlue) | ||
.frame(height: 18) | ||
.autocorrectionDisabled(true) | ||
.autocapitalization(.none) | ||
.padding(.horizontal) | ||
.submitLabel(.done) | ||
.onSubmit(doneAction) | ||
} else { | ||
TextField(placeholderText, text: $text, onCommit: doneAction) | ||
.modifier(RegularTextStyle()) | ||
.foregroundColor(Color.darkBlue) | ||
.frame(height: 18) | ||
.autocorrectionDisabled(true) | ||
.autocapitalization(.none) | ||
.padding(.horizontal) | ||
} | ||
} | ||
.frame(minHeight: 48, maxHeight: 48, alignment: .leading) | ||
.cornerRadius(12) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 12) | ||
.inset(by: 0.5) | ||
.stroke(invalidField ? Color.error200 : Color.blue50) | ||
) | ||
} | ||
} |
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
Oops, something went wrong.