Skip to content

Commit 958fb79

Browse files
authored
Небольшие улучшения и рефактор (#209)
* Удалил лишний модификатор * Поменял авторизацию на модалку * Забыли пароль? -> Восстановить пароль * Отключил лишнюю проверку metal api * Убрал лишний код из превью * Рефактор + выключил анимацию смены состояния экрана с диалогами (с авторизованного на неавторизованного) * Рефактор + анимация в профиле * Поднял версию приложения до 3.5.3 (1)
1 parent f85b992 commit 958fb79

File tree

11 files changed

+44
-98
lines changed

11 files changed

+44
-98
lines changed

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
6798AA7B280BE8E200DB76F1 /* oldSportsGrounds.json in Resources */ = {isa = PBXBuildFile; fileRef = 6798AA77280BE8E200DB76F1 /* oldSportsGrounds.json */; };
5858
6798AA84280C0F7D00DB76F1 /* EditAccountScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6798AA83280C0F7D00DB76F1 /* EditAccountScreen.swift */; };
5959
679F3B03296841DD00BB3590 /* URLOpener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3B02296841DD00BB3590 /* URLOpener.swift */; };
60-
679F3B072969D4E200BB3590 /* IncognitoUserButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679F3B062969D4E200BB3590 /* IncognitoUserButton.swift */; };
6160
67A079F22A758E7D005EAF70 /* PickedPhotoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A079F12A758E7D005EAF70 /* PickedPhotoView.swift */; };
6261
67A4710D2AEED8F8004D341D /* PastEventStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67A4710C2AEED8F8004D341D /* PastEventStorage.swift */; };
6362
67A64A242AC83A0F00CBDD5F /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 67A64A232AC83A0F00CBDD5F /* Localizable.xcstrings */; };
@@ -153,7 +152,6 @@
153152
6798AA77280BE8E200DB76F1 /* oldSportsGrounds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = oldSportsGrounds.json; sourceTree = "<group>"; };
154153
6798AA83280C0F7D00DB76F1 /* EditAccountScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditAccountScreen.swift; sourceTree = "<group>"; };
155154
679F3B02296841DD00BB3590 /* URLOpener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLOpener.swift; sourceTree = "<group>"; };
156-
679F3B062969D4E200BB3590 /* IncognitoUserButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IncognitoUserButton.swift; sourceTree = "<group>"; };
157155
67A079F12A758E7D005EAF70 /* PickedPhotoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickedPhotoView.swift; sourceTree = "<group>"; };
158156
67A4710C2AEED8F8004D341D /* PastEventStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PastEventStorage.swift; sourceTree = "<group>"; };
159157
67A64A232AC83A0F00CBDD5F /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
@@ -539,7 +537,6 @@
539537
isa = PBXGroup;
540538
children = (
541539
6798AA65280B232F00DB76F1 /* IncognitoProfileView.swift */,
542-
679F3B062969D4E200BB3590 /* IncognitoUserButton.swift */,
543540
);
544541
path = Incognito;
545542
sourceTree = "<group>";
@@ -789,7 +786,6 @@
789786
671D7DEC28210D2F0068E728 /* EmptyContentView.swift in Sources */,
790787
6773111A2965FFAA003CD13A /* PreviewContent.swift in Sources */,
791788
67551C362AEC338600084A35 /* SWAddress.swift in Sources */,
792-
679F3B072969D4E200BB3590 /* IncognitoUserButton.swift in Sources */,
793789
6798AA59280AF4B100DB76F1 /* SportsGroundsMapView.swift in Sources */,
794790
6798AA68280B23B700DB76F1 /* UserDetailsView.swift in Sources */,
795791
67B78712281D654C008B104F /* DefaultsService.swift in Sources */,
@@ -1069,7 +1065,7 @@
10691065
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10701066
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
10711067
CODE_SIGN_STYLE = Automatic;
1072-
CURRENT_PROJECT_VERSION = 4;
1068+
CURRENT_PROJECT_VERSION = 1;
10731069
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
10741070
DEVELOPMENT_TEAM = CR68PP2Z3F;
10751071
ENABLE_PREVIEWS = YES;
@@ -1087,7 +1083,7 @@
10871083
"$(inherited)",
10881084
"@executable_path/Frameworks",
10891085
);
1090-
MARKETING_VERSION = 3.5.2;
1086+
MARKETING_VERSION = 3.5.3;
10911087
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
10921088
PRODUCT_NAME = WorkoutApp;
10931089
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1106,7 +1102,7 @@
11061102
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11071103
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
11081104
CODE_SIGN_STYLE = Automatic;
1109-
CURRENT_PROJECT_VERSION = 4;
1105+
CURRENT_PROJECT_VERSION = 1;
11101106
DEVELOPMENT_ASSET_PATHS = "SwiftUI-WorkoutApp/Preview\\ Content/PreviewContent.swift SwiftUI-WorkoutApp/Preview\\ Content";
11111107
DEVELOPMENT_TEAM = CR68PP2Z3F;
11121108
ENABLE_PREVIEWS = YES;
@@ -1124,7 +1120,7 @@
11241120
"$(inherited)",
11251121
"@executable_path/Frameworks",
11261122
);
1127-
MARKETING_VERSION = 3.5.2;
1123+
MARKETING_VERSION = 3.5.3;
11281124
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
11291125
PRODUCT_NAME = WorkoutApp;
11301126
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

SwiftUI-WorkoutApp.xcodeproj/xcshareddata/xcschemes/SwiftUI-WorkoutApp.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
ignoresPersistentStateOnLaunch = "NO"
6868
debugDocumentVersioning = "YES"
6969
debugServiceExtension = "internal"
70+
enableGPUValidationMode = "1"
7071
allowLocationSimulation = "YES">
7172
<BuildableProductRunnable
7273
runnableDebuggingMode = "0">

SwiftUI-WorkoutApp/Resources/Localizable.xcstrings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,18 +1552,18 @@
15521552
}
15531553
}
15541554
},
1555-
"Забыли пароль?" : {
1555+
"Восстановить пароль" : {
15561556
"localizations" : {
15571557
"en" : {
15581558
"stringUnit" : {
15591559
"state" : "translated",
1560-
"value" : "Forgot your password?"
1560+
"value" : "Restore your password"
15611561
}
15621562
},
15631563
"ru" : {
15641564
"stringUnit" : {
15651565
"state" : "translated",
1566-
"value" : "Забыли пароль?"
1566+
"value" : "Восстановить пароль"
15671567
}
15681568
}
15691569
}
@@ -4077,4 +4077,4 @@
40774077
}
40784078
},
40794079
"version" : "1.0"
4080-
}
4080+
}

SwiftUI-WorkoutApp/Screens/Common/EmptyContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,5 @@ private extension EmptyContentView.Mode {
112112
action: {}
113113
)
114114
}
115-
.previewLayout(.sizeThatFits)
116115
}
117116
#endif

SwiftUI-WorkoutApp/Screens/Common/Incognito/IncognitoProfileView.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@ import SWModels
44

55
/// Заглушка для неавторизованного пользователя
66
struct IncognitoProfileView: View {
7+
@State private var showAuthScreen = false
8+
79
var body: some View {
810
VStack(spacing: 16) {
911
authInvitation
10-
IncognitoUserButton()
12+
goToLoginButton
1113
registrationInfo
1214
}
1315
.frame(maxWidth: .infinity, maxHeight: .infinity)
1416
.padding()
1517
.background(Color.swBackground)
18+
.sheet(isPresented: $showAuthScreen) {
19+
ContentInSheet(title: "Авторизация") {
20+
LoginView()
21+
}
22+
}
1623
}
1724
}
1825

@@ -23,6 +30,14 @@ private extension IncognitoProfileView {
2330
.foregroundColor(.swMainText)
2431
.padding(.bottom, 6)
2532
}
33+
34+
var goToLoginButton: some View {
35+
Button("Авторизация") {
36+
showAuthScreen = true
37+
}
38+
.buttonStyle(SWButtonStyle(mode: .filled, size: .large))
39+
.accessibilityIdentifier("authorizeButton")
40+
}
2641

2742
var registrationInfo: some View {
2843
Text(.init(Constants.registrationInfoText))
@@ -35,6 +50,5 @@ private extension IncognitoProfileView {
3550
#if DEBUG
3651
#Preview {
3752
IncognitoProfileView()
38-
.previewLayout(.sizeThatFits)
3953
}
4054
#endif

SwiftUI-WorkoutApp/Screens/Common/Incognito/IncognitoUserButton.swift

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,5 @@ private extension PhotoSectionView {
116116
.padding()
117117
.background(Color.swBackground)
118118
}
119-
.previewLayout(.sizeThatFits)
120119
}
121120
#endif

SwiftUI-WorkoutApp/Screens/Messages/DialogsScreen.swift

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import SWDesignSystem
12
import SwiftUI
23

34
/// Экран с диалогами
@@ -6,29 +7,22 @@ struct DialogsScreen: View {
67

78
var body: some View {
89
NavigationView {
9-
contentView
10-
.navigationTitle("Сообщения")
11-
.navigationBarTitleDisplayMode(titleDisplayMode)
10+
ZStack {
11+
if defaults.isAuthorized {
12+
DialogListView()
13+
} else {
14+
IncognitoProfileView()
15+
}
16+
}
17+
.background(Color.swBackground)
18+
.animation(nil)
19+
.navigationTitle("Сообщения")
20+
.navigationBarTitleDisplayMode(defaults.isAuthorized ? .inline : .large)
1221
}
1322
.navigationViewStyle(.stack)
1423
}
1524
}
1625

17-
private extension DialogsScreen {
18-
var titleDisplayMode: NavigationBarItem.TitleDisplayMode {
19-
defaults.isAuthorized ? .inline : .large
20-
}
21-
22-
@ViewBuilder
23-
var contentView: some View {
24-
if defaults.isAuthorized {
25-
DialogListView()
26-
} else {
27-
IncognitoProfileView()
28-
}
29-
}
30-
}
31-
3226
#if DEBUG
3327
#Preview {
3428
DialogsScreen()

SwiftUI-WorkoutApp/Screens/Profile/Journals/JournalCell.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,5 @@ private extension JournalCell {
7979
mainUserID: nil,
8080
isJournalOwner: true
8181
)
82-
.previewLayout(.sizeThatFits)
8382
}
8483
#endif

SwiftUI-WorkoutApp/Screens/Profile/ProfileScreen.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import SWDesignSystem
12
import SwiftUI
23

34
/// Экран профиля пользователя
@@ -9,16 +10,16 @@ struct ProfileScreen: View {
910
ZStack {
1011
if defaults.isAuthorized {
1112
UserDetailsView(for: defaults.mainUserInfo)
12-
.navigationBarTitleDisplayMode(.inline)
13+
.transition(.move(edge: .trailing).combined(with: .opacity))
1314
} else {
1415
IncognitoProfileView()
15-
.navigationTitle("Профиль")
16-
.navigationBarTitleDisplayMode(.large)
1716
}
1817
}
18+
.background(Color.swBackground)
19+
.navigationTitle("Профиль")
20+
.navigationBarTitleDisplayMode(defaults.isAuthorized ? .inline : .large)
1921
}
2022
.navigationViewStyle(.stack)
21-
.ignoresSafeArea()
2223
}
2324
}
2425

0 commit comments

Comments
 (0)