damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

CoinosButton.swift (1365B)


      1 //
      2 //  CoinosButton.swift
      3 //  damus
      4 //
      5 //  Created by eric on 1/7/25.
      6 //
      7 
      8 import SwiftUI
      9 
     10 struct CoinosButton: 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("coinos")
     25                     .resizable()
     26                     .frame(width: 35, height: 35)
     27                 
     28                 Text("Connect to Coinos", comment:  "Button to attach a Coinos Wallet, a service that provides a Lightning wallet for zapping sats. Coinos is the name of the service and should not be translated.")
     29                     .padding()
     30                     .bold()
     31             }
     32             .frame(minWidth: 300, maxWidth: .infinity, alignment: .center)
     33             .foregroundColor(DamusColors.black)
     34             .background {
     35                 RoundedRectangle(cornerRadius: 12)
     36                     .fill(GrayGradient, strokeBorder: colorScheme == .light ? DamusColors.black.opacity(0.2) : DamusColors.white.opacity(0.2), lineWidth: 1)
     37             }
     38         }
     39     }
     40 }
     41 
     42 struct CoinosButton_Previews: PreviewProvider {
     43     static var previews: some View {
     44         CoinosButton(action: {
     45             print("mutiny button")
     46         })
     47     }
     48 }