Vasilis

fix of uibuttons

......@@ -93,6 +93,9 @@ extension WalletView {
struct myCoupons: View {
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
var instanceOfMySwiftApi = swiftApi()
// var couponsLength = instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count
var body: some View {
......@@ -103,11 +106,19 @@ extension WalletView {
.foregroundColor(Color.white)
.fontWeight(.medium)
Spacer()
Button {
let instanceOfMyApi = MyApi()
let oldCouponsView = instanceOfMyApi.openOldCoupons(parentView)!
oldCouponsView.view.tag = 9
oldCouponsView.view.frame = parentView.frame
parentView.addSubview(oldCouponsView.view)
} label: {
Text("Παλαιότερα κουπόνια ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
}
}
.padding(.leading, self.uiscreen.width * 0.05)
.padding(.trailing, self.uiscreen.width * 0.05)
HStack {
......@@ -117,10 +128,18 @@ extension WalletView {
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
.font(.system(size: 17))
Spacer()
Button {
let instanceOfMyApi = MyApi()
let couponsView = instanceOfMyApi.openCoupons(parentView)!
couponsView.view.tag = 1
couponsView.view.frame = parentView.frame
parentView.addSubview(couponsView.view)
} label: {
Text("Δες τα όλα ->")
.font(.system(size: 12))
.fontWeight(.medium)
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
}
Spacer()
}
.padding(.leading, self.uiscreen.width * 0.1)
......@@ -150,9 +169,18 @@ extension WalletView {
struct myRewards: View {
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
var instanceOfMySwiftApi = swiftApi()
var body: some View {
Button {
let instanceOfMyApi = MyApi()
let allGiftsViewController = instanceOfMyApi.openAllGifts(parentView)!
allGiftsViewController.view.tag = 8
allGiftsViewController.view.frame = parentView.frame
parentView.addSubview(allGiftsViewController.view)
} label: {
VStack {
HStack {
Text("My rewards")
......@@ -199,12 +227,15 @@ extension WalletView {
.padding(.top, self.uiscreen.height * 0.02)
}
}
}
struct linearView: View {
var data: NSDictionary
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
var body: some View {
VStack{
HStack {
......@@ -236,8 +267,8 @@ extension WalletView {
.cornerRadius(3)
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.04)
myCoupons()
myRewards()
myCoupons(parentView: parentView)
myRewards(parentView: parentView)
HStack {
Text("Ανάλυση")
.font(.system(size: 14))
......@@ -335,7 +366,7 @@ struct WalletView: View {
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.02)
ScrollView(showsIndicators: false) {
linearView(data: data)
linearView(data: data, parentView: parentView)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.edgesIgnoringSafeArea([.bottom])
......