Skip to content

Commit a0486f5

Browse files
authored
Merge pull request #38 from OlegEremenko991/develop/updatePhotoSection
Обновил секцию с фотографиями
2 parents 768592c + 99f0c22 commit a0486f5

File tree

4 files changed

+31
-53
lines changed

4 files changed

+31
-53
lines changed

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
675462FB282F8CBF005BC86A /* ChatBubble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 675462FA282F8CBF005BC86A /* ChatBubble.swift */; };
5151
675462FF282FC6E6005BC86A /* MainUserForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 675462FE282FC6E6005BC86A /* MainUserForm.swift */; };
5252
6758463B2965B0F6000BA5E0 /* UIImage+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6758463A2965B0F6000BA5E0 /* UIImage+.swift */; };
53-
6758463D2965B74A000BA5E0 /* FullscreenImageSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6758463C2965B74A000BA5E0 /* FullscreenImageSheet.swift */; };
5453
6758463F2965B7F2000BA5E0 /* ImageDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6758463E2965B7F2000BA5E0 /* ImageDetailView.swift */; };
5554
675846422965CC55000BA5E0 /* ContentInSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 675846412965CC55000BA5E0 /* ContentInSheet.swift */; };
5655
6758B92A281D8FD7001D83D8 /* SportsGroundDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6758B929281D8FD7001D83D8 /* SportsGroundDetailViewModel.swift */; };
@@ -211,7 +210,6 @@
211210
675462FA282F8CBF005BC86A /* ChatBubble.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatBubble.swift; sourceTree = "<group>"; };
212211
675462FE282FC6E6005BC86A /* MainUserForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainUserForm.swift; sourceTree = "<group>"; };
213212
6758463A2965B0F6000BA5E0 /* UIImage+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+.swift"; sourceTree = "<group>"; };
214-
6758463C2965B74A000BA5E0 /* FullscreenImageSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullscreenImageSheet.swift; sourceTree = "<group>"; };
215213
6758463E2965B7F2000BA5E0 /* ImageDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageDetailView.swift; sourceTree = "<group>"; };
216214
675846412965CC55000BA5E0 /* ContentInSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentInSheet.swift; sourceTree = "<group>"; };
217215
6758B929281D8FD7001D83D8 /* SportsGroundDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SportsGroundDetailViewModel.swift; sourceTree = "<group>"; };
@@ -818,7 +816,6 @@
818816
children = (
819817
67BAF3F328361BC400DB40D9 /* PhotoSectionView.swift */,
820818
67C87FD52843892D00D6377D /* DeletablePhotoCell.swift */,
821-
6758463C2965B74A000BA5E0 /* FullscreenImageSheet.swift */,
822819
6758463E2965B7F2000BA5E0 /* ImageDetailView.swift */,
823820
);
824821
path = PhotoSection;
@@ -1100,7 +1097,6 @@
11001097
674D0625282AB832007E75C6 /* SearchUsersViewModel.swift in Sources */,
11011098
67B78718281D8792008B104F /* ChangePasswordViewModel.swift in Sources */,
11021099
6798AA3E280AEDC900DB76F1 /* SwiftUI_WorkoutAppApp.swift in Sources */,
1103-
6758463D2965B74A000BA5E0 /* FullscreenImageSheet.swift in Sources */,
11041100
6798AA57280AF48C00DB76F1 /* JournalsScreen.swift in Sources */,
11051101
67B7871A281D88CB008B104F /* ProfileSettingsViewModel.swift in Sources */,
11061102
67E4266F28218B6E00DF82A7 /* ShortAddressService.swift in Sources */,
@@ -1343,7 +1339,7 @@
13431339
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
13441340
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
13451341
CODE_SIGN_STYLE = Automatic;
1346-
CURRENT_PROJECT_VERSION = 8;
1342+
CURRENT_PROJECT_VERSION = 9;
13471343
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
13481344
DEVELOPMENT_TEAM = CR68PP2Z3F;
13491345
ENABLE_PREVIEWS = YES;
@@ -1379,7 +1375,7 @@
13791375
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
13801376
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
13811377
CODE_SIGN_STYLE = Automatic;
1382-
CURRENT_PROJECT_VERSION = 8;
1378+
CURRENT_PROJECT_VERSION = 9;
13831379
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
13841380
DEVELOPMENT_TEAM = CR68PP2Z3F;
13851381
ENABLE_PREVIEWS = YES;

SwiftUI-WorkoutApp/Screens/Common/PhotoSection/FullscreenImageSheet.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

SwiftUI-WorkoutApp/Screens/Common/PhotoSection/ImageDetailView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import SwiftUI
22
import PDFKit
33

44
struct ImageDetailView: UIViewRepresentable {
5+
@Environment(\.colorScheme) private var colorScheme
56
let image: UIImage
67

78
func makeUIView(context: Context) -> PDFView {
@@ -13,7 +14,9 @@ struct ImageDetailView: UIViewRepresentable {
1314
return view
1415
}
1516

16-
func updateUIView(_ uiView: PDFView, context: Context) {}
17+
func updateUIView(_ view: PDFView, context: Context) {
18+
view.backgroundColor = colorScheme == .dark ? .black : .white
19+
}
1720
}
1821

1922
#if DEBUG

SwiftUI-WorkoutApp/Screens/Common/PhotoSection/PhotoSectionView.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,32 @@ struct PhotoSectionView: View {
2424

2525
var body: some View {
2626
Section("Фотографии") {
27-
ScrollView {
28-
LazyVGrid(
29-
columns: .init(
30-
repeating: .init(
31-
.flexible(minimum: 150, maximum: .infinity),
32-
spacing: 12,
33-
alignment: .top
34-
),
35-
count: columns
27+
LazyVGrid(
28+
columns: .init(
29+
repeating: .init(
30+
.flexible(minimum: 150, maximum: .infinity),
31+
spacing: 12,
32+
alignment: .top
3633
),
37-
spacing: 12
38-
) {
39-
ForEach(items) { photo in
40-
DeletablePhotoCell(
41-
photo: photo,
42-
canDelete: canDelete,
43-
reportClbk: reportPhotoClbk,
44-
onTapClbk: openImage,
45-
deleteClbk: deletePhotoClbk
46-
)
47-
}
34+
count: columns
35+
),
36+
spacing: 12
37+
) {
38+
ForEach(items) { photo in
39+
DeletablePhotoCell(
40+
photo: photo,
41+
canDelete: canDelete,
42+
reportClbk: reportPhotoClbk,
43+
onTapClbk: openImage,
44+
deleteClbk: deletePhotoClbk
45+
)
4846
}
49-
.fullScreenCover(item: $fullscreenImage) {
50-
fullscreenImage = nil
51-
} content: {
52-
FullScreenImageSheet(image: $0)
47+
}
48+
.fullScreenCover(item: $fullscreenImage) {
49+
fullscreenImage = nil
50+
} content: { image in
51+
ContentInSheet(title: "Фото") {
52+
ImageDetailView(image: image)
5353
}
5454
}
5555
}
@@ -65,7 +65,7 @@ private extension PhotoSectionView {
6565
#if DEBUG
6666
struct PhotoSectionView_Previews: PreviewProvider {
6767
static var previews: some View {
68-
Form {
68+
List {
6969
PhotoSectionView(
7070
with: [.preview, .preview, .preview],
7171
canDelete: true,

0 commit comments

Comments
 (0)