Skip to content

Commit 13d04e7

Browse files
authored
Небольшой редизайн (#16)
* Удалил лишнюю строку * Добавил скролл на экран создания события По аналогии с редактированием * Убрал неработающую настройку шрифтов * Обновил fastfile Перед генерацией скриншотов настраиваем `tint` для корневого экрана, чтобы в тестах `tint` был не синим (дефолтным), а черным (как нужно) * Обновил скриншоты * Небольшой редизайн - Убрал шрифт title3, оставил жирный шрифт для заголовков - Сделал переиспользуемую вьюху для заголовков секций - Обновил основную иконку
1 parent 528a7d6 commit 13d04e7

35 files changed

+86
-22
lines changed

SwiftUI-Days.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@
534534
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
535535
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
536536
MACOSX_DEPLOYMENT_TARGET = 14.0;
537-
MARKETING_VERSION = 1.7;
537+
MARKETING_VERSION = 1.8;
538538
PRODUCT_BUNDLE_IDENTIFIER = "com.oleg991.SwiftUI-Days";
539539
PRODUCT_NAME = "$(TARGET_NAME)";
540540
SDKROOT = auto;
@@ -582,7 +582,7 @@
582582
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
583583
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
584584
MACOSX_DEPLOYMENT_TARGET = 14.0;
585-
MARKETING_VERSION = 1.7;
585+
MARKETING_VERSION = 1.8;
586586
PRODUCT_BUNDLE_IDENTIFIER = "com.oleg991.SwiftUI-Days";
587587
PRODUCT_NAME = "$(TARGET_NAME)";
588588
SDKROOT = auto;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import SwiftUI
2+
3+
struct SectionTitleView: View {
4+
@Environment(\.isEnabled) private var isEnabled
5+
private let title: LocalizedStringKey
6+
7+
init(_ title: LocalizedStringKey) {
8+
self.title = title
9+
}
10+
11+
var body: some View {
12+
Text(title)
13+
.bold()
14+
.foregroundStyle(isEnabled ? .primary : .secondary)
15+
.frame(maxWidth: .infinity, alignment: .leading)
16+
}
17+
}
18+
19+
#Preview(traits: .sizeThatFitsLayout) {
20+
let titleStringKeys: [LocalizedStringKey] = [
21+
"Title",
22+
"Details",
23+
"Add color tag",
24+
]
25+
VStack(spacing: 20) {
26+
ForEach(
27+
Array(zip(titleStringKeys.indices, titleStringKeys)),
28+
id: \.0
29+
) { _, title in
30+
SectionTitleView(title)
31+
SectionTitleView(title)
32+
.disabled(true)
33+
}
34+
}
35+
}

SwiftUI-Days/Screens/Detail/EditItemScreen.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ struct EditItemScreen: View {
8787
}
8888
),
8989
label: {
90-
Text("Add color tag")
91-
.font(.title3.bold())
90+
SectionTitleView("Add color tag")
9291
}
9392
)
9493
if let colorTag {

SwiftUI-Days/Screens/Detail/EditSectionView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct EditSectionView: View {
77

88
var body: some View {
99
VStack(alignment: .leading, spacing: 8) {
10-
Text(headerText).font(.title3.bold())
10+
SectionTitleView(headerText)
1111
.accessibilityHidden(true)
1212
TextField(placeholder, text: $text, axis: .vertical)
1313
.textFieldStyle(.roundedBorder)

SwiftUI-Days/Screens/Detail/ItemDatePicker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct ItemDatePicker: View {
99
selection: $date,
1010
displayedComponents: .date
1111
)
12-
.font(.title3.bold())
12+
.bold()
1313
}
1414
}
1515

SwiftUI-Days/Screens/Detail/ItemDisplayOptionPicker.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ struct ItemDisplayOptionPicker: View {
55

66
var body: some View {
77
HStack(spacing: 12) {
8-
Text("Display format")
9-
.font(.title3.bold())
10-
.frame(maxWidth: .infinity, alignment: .leading)
8+
SectionTitleView("Display format")
119
.accessibilityHidden(true)
1210
Picker("Display format", selection: $displayOption) {
1311
ForEach(DisplayOption.allCases, id: \.self) { option in

SwiftUI-Days/Screens/Detail/ItemScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct ItemScreen: View {
8080
"Color tag",
8181
selection: .constant(colorTag)
8282
)
83-
.font(.title3.bold())
83+
.bold()
8484
.disabled(true)
8585
.padding(.bottom, 4)
8686
}

SwiftUI-Days/Screens/Detail/ReadSectionView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct ReadSectionView: View {
66

77
var body: some View {
88
VStack(alignment: .leading, spacing: 8) {
9-
Text(headerText).font(.title3.bold())
9+
SectionTitleView(headerText)
1010
.accessibilityIdentifier("sectionHeader")
1111
Text(bodyText)
1212
.accessibilityIdentifier("sectionBody")

SwiftUI-Days/Screens/Main/MainScreen.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ struct MainScreen: View {
2424
}
2525
.sheet(isPresented: $showAddItemSheet) {
2626
NavigationStack {
27-
EditItemScreen { showAddItemSheet.toggle() }
27+
ScrollView {
28+
EditItemScreen { showAddItemSheet.toggle() }
29+
}
30+
.scrollBounceBehavior(.basedOnSize)
2831
}
2932
}
3033
}

SwiftUI-Days/Screens/More/ThemeIcon/ThemeIconScreen.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ struct ThemeIconScreen: View {
2020

2121
private var themePicker: some View {
2222
HStack(spacing: 12) {
23-
Text("App theme")
24-
.bold()
25-
.frame(maxWidth: .infinity, alignment: .leading)
23+
SectionTitleView("App theme")
2624
.accessibilityHidden(true)
2725
Picker(
2826
"App theme",
@@ -42,9 +40,7 @@ struct ThemeIconScreen: View {
4240

4341
private var iconsGrid: some View {
4442
VStack(spacing: 16) {
45-
Text("App Icon")
46-
.bold()
47-
.frame(maxWidth: .infinity, alignment: .leading)
43+
SectionTitleView("App Icon")
4844
LazyVGrid(
4945
columns: [GridItem(.adaptive(minimum: 65), spacing: 32, alignment: .leading)],
5046
spacing: 32

0 commit comments

Comments
 (0)