diff Simoleon/UI/Flag.swift @ 156:84137052813d

Refactor code
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Sat, 28 Aug 2021 11:15:25 +0100
parents
children 0c589138a6f3
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Simoleon/UI/Flag.swift	Sat Aug 28 11:15:25 2021 +0100
@@ -0,0 +1,27 @@
+//
+//  Flag.swift
+//  Simoleon
+//
+//  Created by Dennis Concepción Martín on 24/8/21.
+//
+
+import SwiftUI
+
+struct Flag: View {
+    var flag: String
+    
+    var body: some View {
+        Image(flag)
+            .resizable()
+            .aspectRatio(contentMode: .fill)
+            .frame(width: 30, height: 30)
+            .clipShape(Circle())
+            .overlay(Circle().stroke(Color(.secondaryLabel), lineWidth: 1))
+    }
+}
+
+struct Flag_Previews: PreviewProvider {
+    static var previews: some View {
+        Flag(flag: "GB")
+    }
+}