From 1b1d4bd6d1e3b53c2986dfbee4cad53b9e992d64 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 10 Sep 2023 18:22:15 -0700 Subject: [PATCH] perf: use plain images for actionbar buttons The action bar is really slow to render for some reason, start removing stuff --- damus/Views/ActionBar/EventActionBar.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/damus/Views/ActionBar/EventActionBar.swift b/damus/Views/ActionBar/EventActionBar.swift index f5b453a9..08fbd928 100644 --- a/damus/Views/ActionBar/EventActionBar.swift +++ b/damus/Views/ActionBar/EventActionBar.swift @@ -149,14 +149,15 @@ struct EventActionBar: View { func EventActionButton(img: String, col: Color?, action: @escaping () -> ()) -> some View { - Button(action: action) { - Image(img) - .resizable() - .foregroundColor(col == nil ? Color.gray : col!) - .font(.footnote.weight(.medium)) - .aspectRatio(contentMode: .fit) - .frame(width: 20, height: 20) - } + Image(img) + .resizable() + .foregroundColor(col == nil ? Color.gray : col!) + .font(.footnote.weight(.medium)) + .aspectRatio(contentMode: .fit) + .frame(width: 20, height: 20) + .onTapGesture { + action() + } } struct LikeButton: View {