6open type Fabulous.Avalonia.View
16 let private qrBytes (text: string) =
17 use qr = new QRCoder.QRCodeGenerator()
18 use data = qr.CreateQrCode(text, QRCoder.QRCodeGenerator.ECCLevel.M)
19 use png = new QRCoder.PngByteQRCode(data)
20 png.GetGraphic(8, [| 0uy; 0uy; 0uy |], [| 255uy; 255uy; 255uy |])
22 let viewAddContact model (cpk: string) =
27 h2 ("Share your address")
30 | Identified(id, _) ->
31 let ob = hexToOb id.PubKeyHex
33 Image(Styles.cachedBitmap (qrBytes ob), Stretch.Uniform).maxWidth(200.).centerHorizontal ()
35 body(ob).fontSize(12.).centerText ()
37 smallButton Primary "Copy Address" CopyPubKey
40 h2 "Enter someone else's address"
42 let cpkTrimmed: string = cpk.Trim()
45 Phonemic.fromOb cpkTrimmed
46 |> Option.orElseWith (fun () -> Crypto.tryFromHex cpkTrimmed)
47 |> Option.filter (fun bytes -> bytes.Length = 32)
50 let hasError = cpkTrimmed <> "" && not isValid
53 errorTextField cpk (fun key -> SetPage(AddContact(key)))
55 textField cpk (fun key -> SetPage(AddContact(key)))
59 smallButton Primary "Add" DoSaveContact
61 disabledSmallButton Primary "Add" DoSaveContact
66 let bar = HStack(8.) { backButton (SetPage Conversations) }
68 withBottomBar bar content
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list