Skip to content

Instantly share code, notes, and snippets.

@avielg
Last active August 22, 2022 15:26
Show Gist options
  • Save avielg/8928a9b0fc9e518f4e3b68bfd053ecb4 to your computer and use it in GitHub Desktop.
Save avielg/8928a9b0fc9e518f4e3b68bfd053ecb4 to your computer and use it in GitHub Desktop.
struct AvatarButton: View {
let user: User
@EnvironmentObject private var navigation: AppNavigation
var body: some View {
Button {
navigation.commit(.profile(user.id)) // "open profile" action
} label: {
AsyncImage(url: user.avatarUrl)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment