Skip to content

Commit 93757b4

Browse files
committed
Рефактор
- Убрал неактуальные модификаторы `previewLayout(.sizeThatFits)` - Убрал неиспользуемые иконки и обновил пару используемых в `Icons`
1 parent 3ddd845 commit 93757b4

14 files changed

+15
-26
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SWDesignSystem
22

3-
Дизайн-система для приложения [Street Workout: Площадки](http://workout.su/ios), [ссылка на фигму](https://clck.ru/36D7Sd)
3+
Дизайн-система для приложения [Street Workout: Площадки](http://workout.su/ios)
4+
[Ссылка на фигму](https://clck.ru/36D7Sd)
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import SwiftUI
22

33
/// Дефолтная картинка `Workout`, можно задать размер в инициализаторе
4-
public struct RoundedDefaultImage: View {
4+
struct DefaultWorkoutImage: View {
55
private let size: CGSize
66

77
/// Инициализирует `RoundedDefaultImage`
88
/// - Parameter size: Размер картинки
9-
public init(size: CGSize) {
9+
init(size: CGSize) {
1010
self.size = size
1111
}
1212

13-
public var body: some View {
13+
var body: some View {
1414
Image.defaultWorkout
1515
.resizable()
1616
.scaledToFit()
@@ -21,10 +21,9 @@ public struct RoundedDefaultImage: View {
2121
#if DEBUG
2222
#Preview {
2323
VStack(spacing: 16) {
24-
RoundedDefaultImage(size: .init(width: 45, height: 45))
25-
RoundedDefaultImage(size: .init(width: 60, height: 60))
24+
DefaultWorkoutImage(size: .init(width: 45, height: 45))
25+
DefaultWorkoutImage(size: .init(width: 60, height: 60))
2626
}
2727
.padding()
28-
.previewLayout(.sizeThatFits)
2928
}
3029
#endif

Diff for: Sources/SWDesignSystem/Public/BorderedClipshapeModifier.swift

-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ public extension BorderedClipshapeModifier {
4747
.frame(width: 120, height: 120)
4848
.borderedClipshape(.roundedRectangle)
4949
}
50-
.previewLayout(.sizeThatFits)
5150
}
5251
#endif

Diff for: Sources/SWDesignSystem/Public/CachedImage/CachedImage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public struct CachedImage: View {
2626
.scaledToFill()
2727
.onTapGesture { didTapImage?(uiImage) }
2828
} placeholder: {
29-
RoundedDefaultImage(size: mode.size)
29+
DefaultWorkoutImage(size: mode.size)
3030
}
3131
.frame(width: mode.size.width, height: mode.size.height)
3232
.clipped()

Diff for: Sources/SWDesignSystem/Public/Icons.swift

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ public enum Icons {
1818

1919
/// Названия остальных иконок
2020
public enum Regular: String, CaseIterable {
21-
case info = "info.circle"
22-
case plus = "plus.circle"
21+
case plusCircle = "plus.circle"
22+
case plus
23+
case share = "square.and.arrow.up"
24+
case noSignal = "wifi.exclamationmark"
2325
case gearshape
2426
case refresh = "arrow.triangle.2.circlepath"
2527
case exclamation = "exclamationmark.triangle"
2628
case exclamationArrowCircle = "exclamationmark.arrow.circlepath"
2729
case xmarkCircle = "xmark.circle"
28-
case xmark
29-
case filterOff = "line.3.horizontal.decrease.circle"
30-
case filterOn = "line.3.horizontal.decrease.circle.fill"
30+
case filter = "line.3.horizontal.decrease.circle"
3131
case magnifyingglass
3232
case trash
3333
case pencil
@@ -40,9 +40,7 @@ public enum Icons {
4040
case deletePerson = "person.crop.circle.badge.minus"
4141
case signPost = "signpost.right"
4242
case key = "key.fill"
43-
case envelope
4443
case globe = "globe.europe.africa"
45-
case person = "person.fill"
4644
case personQuestion = "person.fill.questionmark"
4745
case calendar
4846
}

Diff for: Sources/SWDesignSystem/Public/ProfileView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,5 @@ public struct ProfileView: View {
6363
countryAndCity: "Россия, Краснодар"
6464
)
6565
.padding(.horizontal, 40)
66-
.previewLayout(.sizeThatFits)
6766
}
6867
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/ChatBubbleRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,5 @@ public extension ChatBubbleRowView {
8080
)
8181
}
8282
.padding(.horizontal)
83-
.previewLayout(.sizeThatFits)
8483
}
8584
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/CheckmarkRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ public struct TextWithCheckmarkRowView: View {
3131
TextWithCheckmarkRowView(text: "Checked text", isChecked: true)
3232
.insideCardBackground(padding: 0)
3333
.padding()
34-
.previewLayout(.sizeThatFits)
3534
}
3635
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/CommentRowView.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private extension CommentRowView {
6565
Menu {
6666
if isCommentByMainUser {
6767
Button(action: editAction) {
68-
Label("Изменить", systemImage: "rectangle.and.pencil.and.ellipsis")
68+
Label("Изменить", systemImage: Icons.Regular.pencil.rawValue)
6969
}
7070
Button(role: .destructive, action: deleteAction) {
7171
Label("Удалить", systemImage: "trash")
@@ -119,6 +119,5 @@ private extension CommentRowView {
119119
deleteAction: {}
120120
)
121121
.padding()
122-
.previewLayout(.sizeThatFits)
123122
}
124123
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/DialogRowView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ private extension DialogRowView {
9393
unreadCount: 3
9494
)
9595
)
96-
.previewLayout(.sizeThatFits)
96+
.padding()
9797
}
9898
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/EventRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,5 @@ private extension EventRowView {
9292
.environment(\.colorScheme, .dark)
9393
}
9494
.padding()
95-
.previewLayout(.sizeThatFits)
9695
}
9796
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/FormRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,5 @@ public extension FormRowView {
8787
.previewDisplayName(scheme == .dark ? "Dark" : "Light")
8888
}
8989
}
90-
.previewLayout(.sizeThatFits)
9190
}
9291
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/JournalRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,5 @@ private extension JournalRowView {
171171
.environment(\.colorScheme, .dark)
172172
}
173173
.padding()
174-
.previewLayout(.sizeThatFits)
175174
}
176175
#endif

Diff for: Sources/SWDesignSystem/Public/Rows/SportsGroundRowView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,5 @@ private extension SportsGroundRowView {
106106
.previewDisplayName(scheme == .dark ? "Dark" : "Light")
107107
}
108108
}
109-
.previewLayout(.sizeThatFits)
110109
}
111110
#endif

0 commit comments

Comments
 (0)