refactor sidemenu items
This commit is contained in:
@@ -42,14 +42,37 @@ struct SideMenuView: View {
|
||||
}
|
||||
}
|
||||
|
||||
var content: some View {
|
||||
HStack(alignment: .top) {
|
||||
ZStack(alignment: .top) {
|
||||
fillColor()
|
||||
.ignoresSafeArea()
|
||||
func SidemenuItems(profile_model: ProfileModel, followers: FollowersModel) -> some View {
|
||||
return VStack(spacing: verticalSpacing) {
|
||||
NavigationLink(destination: ProfileView(damus_state: damus_state, profile: profile_model, followers: followers)) {
|
||||
navLabel(title: NSLocalizedString("Profile", comment: "Sidebar menu label for Profile view."), systemImage: "person")
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
/*
|
||||
NavigationLink(destination: EmptyView()) {
|
||||
navLabel(title: NSLocalizedString("Wallet", comment: "Sidebar menu label for Wallet view."), systemImage: "bolt")
|
||||
}
|
||||
*/
|
||||
|
||||
NavigationLink(destination: MutelistView(damus_state: damus_state, users: get_mutelist_users(damus_state.contacts.mutelist) )) {
|
||||
navLabel(title: NSLocalizedString("Muted", comment: "Sidebar menu label for muted users view."), systemImage: "exclamationmark.octagon")
|
||||
}
|
||||
|
||||
NavigationLink(destination: RelayConfigView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Relays", comment: "Sidebar menu label for Relays view."), systemImage: "network")
|
||||
}
|
||||
|
||||
NavigationLink(destination: BookmarksView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Bookmarks", comment: "Sidebar menu label for Bookmarks view."), systemImage: "bookmark")
|
||||
}
|
||||
|
||||
NavigationLink(destination: ConfigView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), systemImage: "gear")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var MainSidemenu: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
let profile = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||
let followers = FollowersModel(damus_state: damus_state, target: damus_state.pubkey)
|
||||
@@ -81,37 +104,21 @@ struct SideMenuView: View {
|
||||
Divider()
|
||||
|
||||
ScrollView {
|
||||
VStack(spacing: verticalSpacing) {
|
||||
NavigationLink(destination: ProfileView(damus_state: damus_state, profile: profile_model, followers: followers)) {
|
||||
navLabel(title: NSLocalizedString("Profile", comment: "Sidebar menu label for Profile view."), systemImage: "person")
|
||||
}
|
||||
|
||||
/*
|
||||
NavigationLink(destination: EmptyView()) {
|
||||
navLabel(title: NSLocalizedString("Wallet", comment: "Sidebar menu label for Wallet view."), systemImage: "bolt")
|
||||
}
|
||||
*/
|
||||
|
||||
NavigationLink(destination: MutelistView(damus_state: damus_state, users: get_mutelist_users(damus_state.contacts.mutelist) )) {
|
||||
navLabel(title: NSLocalizedString("Muted", comment: "Sidebar menu label for muted users view."), systemImage: "exclamationmark.octagon")
|
||||
}
|
||||
|
||||
NavigationLink(destination: RelayConfigView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Relays", comment: "Sidebar menu label for Relays view."), systemImage: "network")
|
||||
}
|
||||
|
||||
NavigationLink(destination: BookmarksView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Bookmarks", comment: "Sidebar menu label for Bookmarks view."), systemImage: "bookmark")
|
||||
}
|
||||
|
||||
NavigationLink(destination: ConfigView(state: damus_state)) {
|
||||
navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), systemImage: "gear")
|
||||
}
|
||||
}
|
||||
SidemenuItems(profile_model: profile_model, followers: followers)
|
||||
.labelStyle(SideMenuLabelStyle())
|
||||
.padding([.top, .bottom], verticalSpacing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var content: some View {
|
||||
HStack(alignment: .top) {
|
||||
ZStack(alignment: .top) {
|
||||
fillColor()
|
||||
.ignoresSafeArea()
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
MainSidemenu
|
||||
.simultaneousGesture(TapGesture().onEnded {
|
||||
isSidebarVisible = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user