on master help sign in
Fix Grid sizing and reformat conversation list items in ViewConversations
ebc16ebiko
client/ViewConversations.fs+9−7
@@ -40,23 +40,25 @@ module ViewConversations =
40 let preview =
40 let preview =
41 messagesFor c.Pubkey model.Messages
41 messagesFor c.Pubkey model.Messages
42 |> List.tryLast
42 |> List.tryLast
43+ |> Option.map (fun m ->
43− |> Option.map (fun m -> if m.Body.Length > 40 then m.Body.[..39] + "..." else m.Body)
44+ if m.Body.Length > 40 then m.Body.[..39] + "..." else m.Body)
44 |> Option.defaultValue ""
45 |> Option.defaultValue ""
45
46
46 Border(
47 Border(
47 (HStack(8.) {
48 (HStack(8.) {
48
49
49− Grid() {
50+ (Grid() {
50 (match c.Photo with
51 (match c.Photo with
52+ | None ->
51− | None -> Image("avares://Skrepka/Assets/Images/user.png", Stretch.Uniform)
53+ Image("avares://Skrepka/Assets/Images/user.png", Stretch.Uniform)
54+ .margin (8.)
52 | Some i -> Image(cachedBitmap i, Stretch.UniformToFill))
55 | Some i -> Image(cachedBitmap i, Stretch.UniformToFill))
53− .width(16.)
54− .height(16.)
55− .margin(8.)
56 .clipToBounds (true)
56 .clipToBounds (true)
57
57
58 Rectangle().stroke(Colors.Black).strokeThickness (4.)
58 Rectangle().stroke(Colors.Black).strokeThickness (4.)
59− }
59+ })
60+ .width(40.)
61+ .height (40.)
60
62
61 VStack(2.) {
63 VStack(2.) {
62 TextBlock(name)
64 TextBlock(name)