WalletView.swift 1.56 KB
//
//  WalletView.swift
//  WarplySDKFrameworkIOS
//
//  Created by Βασιλης Σκουρας on 20/4/22.
//

import SwiftUI

extension WalletView {
    struct headerView: View {
        var goBack: () -> ()
        var uiscreen = UIScreen.main.bounds
        
        
        var body: some View {
            HStack {
               Button(action: goBack) {
                   HStack {
                       Image("ic_back", bundle: Bundle(for: MyEmptyClass.self))
                           .resizable()
                           .frame(width: self.uiscreen.height * 0.022, height: self.uiscreen.height * 0.02)
                           .offset(y: self.uiscreen.height * 0.015)
                   }
               }
                Text("Wallet")
                    .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.025, alignment: .center)
                    .offset( y:  self.uiscreen.height * 0.02)
                    .font(.system(size: 15))
            }
            .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.1)
        }
    }
}

struct WalletView: View {
    var parentView: UIView
    
    var uiscreen = UIScreen.main.bounds
    
    func goBack(){
        for subview in parentView.subviews {
            if(subview.tag == 1) {
                subview.removeFromSuperview()
            }
        }
    }
    
    var body: some View {
        headerView(goBack: goBack)
        Text("Wallet View")
    }
}

struct WalletView_Previews: PreviewProvider {
    static var previews: some View {
        WalletView()
    }
}