1
0
mirror of git://jb55.com/damus synced 2024-10-06 11:43:21 +00:00

Custom iconography for the left navigation.

ChangeLog-Added: Custom iconography for the left navigation.
This commit is contained in:
Ben Weeks 2023-05-27 00:41:57 +01:00 committed by William Casarin
parent 156d885e6e
commit d12281fcc5

View File

@ -46,36 +46,38 @@ struct SideMenuView: View {
func SidemenuItems(profile_model: ProfileModel, followers: FollowersModel) -> some View { func SidemenuItems(profile_model: ProfileModel, followers: FollowersModel) -> some View {
return VStack(spacing: verticalSpacing) { return VStack(spacing: verticalSpacing) {
NavigationLink(destination: ProfileView(damus_state: damus_state, profile: profile_model, followers: followers)) { 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") navLabel(title: NSLocalizedString("Profile", comment: "Sidebar menu label for Profile view."), img: "user")
} }
NavigationLink(destination: WalletView(damus_state: damus_state, model: damus_state.wallet)) { NavigationLink(destination: WalletView(damus_state: damus_state, model: damus_state.wallet)) {
navLabel(title: NSLocalizedString("Wallet", comment: "Sidebar menu label for Wallet view."), img: "wallet")
/*
HStack { HStack {
Image("wallet") Image("wallet")
.tint(DamusColors.adaptableBlack) .tint(DamusColors.adaptableBlack)
Text(NSLocalizedString("Wallet", comment: "Sidebar menu label for Wallet view.")) Text(NSLocalizedString("wallet", comment: "Sidebar menu label for Wallet view."))
.font(.title2) .font(.title2)
.foregroundColor(textColor()) .foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.dynamicTypeSize(.xSmall) .dynamicTypeSize(.xSmall)
} }*/
} }
NavigationLink(destination: MutelistView(damus_state: damus_state, users: get_mutelist_users(damus_state.contacts.mutelist) )) { 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") navLabel(title: NSLocalizedString("Muted", comment: "Sidebar menu label for muted users view."), img: "mute")
} }
NavigationLink(destination: RelayConfigView(state: damus_state)) { NavigationLink(destination: RelayConfigView(state: damus_state)) {
navLabel(title: NSLocalizedString("Relays", comment: "Sidebar menu label for Relays view."), systemImage: "network") navLabel(title: NSLocalizedString("Relays", comment: "Sidebar menu label for Relays view."), img: "world-relays")
} }
NavigationLink(destination: BookmarksView(state: damus_state)) { NavigationLink(destination: BookmarksView(state: damus_state)) {
navLabel(title: NSLocalizedString("Bookmarks", comment: "Sidebar menu label for Bookmarks view."), systemImage: "bookmark") navLabel(title: NSLocalizedString("Bookmarks", comment: "Sidebar menu label for Bookmarks view."), img: "bookmark")
} }
NavigationLink(destination: ConfigView(state: damus_state)) { NavigationLink(destination: ConfigView(state: damus_state)) {
navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), systemImage: "gear") navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), img: "settings")
} }
} }
} }
@ -142,7 +144,7 @@ struct SideMenuView: View {
confirm_logout = true confirm_logout = true
} }
}, label: { }, label: {
Label(NSLocalizedString("Sign out", comment: "Sidebar menu label to sign out of the account."), systemImage: "pip.exit") Label(NSLocalizedString("Sign out", comment: "Sidebar menu label to sign out of the account."), image: "logout")
.font(.title3) .font(.title3)
.foregroundColor(textColor()) .foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@ -154,7 +156,7 @@ struct SideMenuView: View {
Button(action: { Button(action: {
showQRCode.toggle() showQRCode.toggle()
}, label: { }, label: {
Label("", systemImage: "qrcode") Image("qr-code")
.font(.title) .font(.title)
.foregroundColor(textColor()) .foregroundColor(textColor())
.dynamicTypeSize(.xSmall) .dynamicTypeSize(.xSmall)
@ -187,8 +189,11 @@ struct SideMenuView: View {
@ViewBuilder @ViewBuilder
func navLabel(title: String, systemImage: String) -> some View { func navLabel(title: String, img: String) -> some View {
Label(title, systemImage: systemImage) Image(img)
.tint(DamusColors.adaptableBlack)
Text(title)
.font(.title2) .font(.title2)
.foregroundColor(textColor()) .foregroundColor(textColor())
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)