MutinyButton.swift (1347B)
1 // 2 // MutinyButton.swift 3 // damus 4 // 5 // Created by eric on 3/9/24. 6 // 7 8 import SwiftUI 9 10 struct MutinyButton: View { 11 let action: () -> () 12 13 @Environment(\.colorScheme) var colorScheme 14 15 init(action: @escaping () -> ()) { 16 self.action = action 17 } 18 19 var body: some View { 20 Button(action: { 21 action() 22 }) { 23 HStack { 24 Image("mutiny") 25 .resizable() 26 .frame(width: 45, height: 45) 27 28 Text("Connect to Mutiny Wallet", comment: "Button to attach an Mutiny Wallet, a service that provides a Lightning wallet for zapping sats. Mutiny is the name of the service and should not be translated.") 29 .padding() 30 } 31 .frame(minWidth: 300, maxWidth: .infinity, alignment: .center) 32 .foregroundColor(DamusColors.white) 33 .background { 34 RoundedRectangle(cornerRadius: 12) 35 .fill(MutinyGradient, strokeBorder: colorScheme == .light ? DamusColors.black.opacity(0.2) : DamusColors.white.opacity(0.2), lineWidth: 1) 36 } 37 } 38 } 39 } 40 41 struct MutinyButton_Previews: PreviewProvider { 42 static var previews: some View { 43 MutinyButton(action: { 44 print("mutiny button") 45 }) 46 } 47 }