sidemenu: split out profile section

We will be adding to this and it is getting messy
This commit is contained in:
William Casarin
2023-08-23 09:52:28 -07:00
parent d34d417fcc
commit 59cf8056bd

View File

@@ -81,14 +81,9 @@ struct SideMenuView: View {
} }
} }
var MainSidemenu: some View { var TopProfile: some View {
VStack(alignment: .leading, spacing: 0) {
let profile = damus_state.profiles.lookup(id: damus_state.pubkey) let profile = damus_state.profiles.lookup(id: damus_state.pubkey)
let followers = FollowersModel(damus_state: damus_state, target: damus_state.pubkey) return HStack {
let profile_model = ProfileModel(pubkey: damus_state.pubkey, damus: damus_state)
NavigationLink(value: Route.Profile(profile: profile_model, followers: followers), label: {
HStack {
ProfilePicView(pubkey: damus_state.pubkey, size: 60, highlight: .none, profiles: damus_state.profiles, disable_animation: damus_state.settings.disable_animation) ProfilePicView(pubkey: damus_state.pubkey, size: 60, highlight: .none, profiles: damus_state.profiles, disable_animation: damus_state.settings.disable_animation)
VStack(alignment: .leading) { VStack(alignment: .leading) {
@@ -106,6 +101,16 @@ struct SideMenuView: View {
} }
} }
} }
}
var MainSidemenu: some View {
VStack(alignment: .leading, spacing: 0) {
let followers = FollowersModel(damus_state: damus_state, target: damus_state.pubkey)
let profile_model = ProfileModel(pubkey: damus_state.pubkey, damus: damus_state)
NavigationLink(value: Route.Profile(profile: profile_model, followers: followers), label: {
TopProfile
.padding(.bottom, verticalSpacing) .padding(.bottom, verticalSpacing)
}) })