File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
GoInfoGame/GoInfoGame/UI/Profile Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,27 @@ struct ProfileView: View {
4747
4848 }
4949
50+ @ViewBuilder
5051 private var profileImage : some View {
51- AsyncImage ( url: self . viewModel. imageUrl) { image in
52- image. resizable ( )
53- } placeholder: {
52+ if self . viewModel. imageUrl == nil {
5453 Image ( systemName: " person.circle.fill " )
5554 . resizable ( )
55+ . frame ( width: 120 , height: 120 , alignment: . center)
56+ . cornerRadius ( 60 )
57+ } else {
58+ AsyncImage ( url: self . viewModel. imageUrl) { phase in
59+ if let image = phase. image {
60+ image. resizable ( )
61+ } else if phase. error != nil {
62+ Image ( systemName: " person.circle.fill " )
63+ . resizable ( )
64+ } else {
65+ ProgressView ( ) . progressViewStyle ( . circular)
66+ }
67+ }
68+ . frame ( width: 120 , height: 120 , alignment: . center)
69+ . cornerRadius ( 60 )
5670 }
57- . frame ( width: 120 , height: 120 , alignment: . center)
58- . cornerRadius ( 60 )
5971 }
6072
6173 private var profileButton : some View {
You can’t perform that action at this time.
0 commit comments