view Simoleon/Helpers/CurrencyRow.swift @ 186:1ebd1c5dd302

finish ConversionView
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Thu, 23 Dec 2021 11:30:38 +0100
parents 2fc95efcb1ee
children 13d5a8deb6c2
line wrap: on
line source

//
//  CurrencyRow.swift
//  Simoleon
//
//  Created by Dennis Concepción Martín on 20/12/21.
//

import SwiftUI

struct CurrencyRow: View {
    var currency: SupportedCurrencyResult
    
    var body: some View {
        HStack {
            let flagName = getFlagName(currency: currency)
            Flag(flagName: flagName)
            
            VStack(alignment: .leading) {
                Text(currency.code)
                    .font(.headline)
                
                Text(currency.name)
                    .font(.callout)
                    .opacity(0.6)
            }
            .foregroundColor(.primary)
            .padding(.leading)
        }
    }
}

struct CurrencyRow_Previews: PreviewProvider {
    static var previews: some View {
        CurrencyRow(
            currency:
                SupportedCurrencyResult(code: "EUR", name: "Euro", isCrypto: 0)
        )
    }
}