Mercurial > public > geoquiz
comparison GeoQuiz/ProfileModalView.swift @ 21:b145c408f791
refactor code
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 25 Oct 2022 15:30:01 +0200 |
parents | e281791e0494 |
children | 56add5561261 |
comparison
equal
deleted
inserted
replaced
20:e281791e0494 | 21:b145c408f791 |
---|---|
28 userController: userController, | 28 userController: userController, |
29 storeKitController: storeKitController, | 29 storeKitController: storeKitController, |
30 isShowing: $showingEditModalView | 30 isShowing: $showingEditModalView |
31 ) | 31 ) |
32 | 32 |
33 VStack(spacing: 20) { | 33 if !playedGames.isEmpty { |
34 HStack { | 34 VStack(spacing: 20) { |
35 Text("Latest games") | 35 HStack { |
36 .foregroundColor(.secondary) | 36 Text("Latest games") |
37 .foregroundColor(.secondary) | |
38 | |
39 Spacer() | |
40 | |
41 NavigationLink { | |
42 PlayedGamesList() | |
43 } label: { | |
44 HStack { | |
45 Text("Show all") | |
46 Image(systemName: "chevron.right") | |
47 } | |
48 } | |
49 .disabled(playedGames.isEmpty) | |
50 } | |
37 | 51 |
38 Spacer() | |
39 | |
40 NavigationLink { | |
41 PlayedGamesList(playedGames: playedGames) | |
42 } label: { | |
43 Text("Show all") | |
44 } | |
45 .disabled(playedGames.isEmpty) | |
46 } | |
47 | |
48 if playedGames.isEmpty { | |
49 Spacer() | |
50 LatestGamesPlaceholder() | |
51 } else { | |
52 ForEach(playedGames.prefix(8)) { playedGame in | 52 ForEach(playedGames.prefix(8)) { playedGame in |
53 RecentGame(game: playedGame) | 53 RecentGame(game: playedGame) |
54 .padding() | 54 .padding() |
55 .background(Color(.secondarySystemGroupedBackground)) | 55 .background(Color(.secondarySystemGroupedBackground)) |
56 .cornerRadius(20) | 56 .cornerRadius(20) |
73 } | 73 } |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 .sheet(isPresented: $showingEditModalView) { | 77 .sheet(isPresented: $showingEditModalView) { |
78 ProfileEditModalView(user: userController) | 78 ProfileEditModalView(userController: userController) |
79 } | 79 } |
80 | |
81 #if DEBUG | |
82 .onAppear { | |
83 | |
84 } | |
85 #endif | |
80 } | 86 } |
81 } | 87 } |
82 } | 88 } |
83 | 89 |
84 struct ProfileView_Previews: PreviewProvider { | 90 struct ProfileView_Previews: PreviewProvider { |