Skip to content

Commit b8301f2

Browse files
committed
IOS-5280 Add labels
1 parent 80c2576 commit b8301f2

File tree

7 files changed

+36
-14
lines changed

7 files changed

+36
-14
lines changed

Anytype/Sources/PresentationLayer/AuthNew/Join/JoinView/JoinSelectionView/JoinSelectionView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ struct JoinSelectionView: View {
4040
}
4141
)
4242
.disabled(model.selectedOptions.isEmpty)
43+
.accessibilityLabel("Continue")
4344

4445
StandardButton(
4546
Loc.skip,
@@ -48,6 +49,7 @@ struct JoinSelectionView: View {
4849
model.onSkipAction()
4950
}
5051
)
52+
.accessibilityLabel("Skip")
5153
}
5254
}
5355
}

Anytype/Sources/PresentationLayer/Common/SwiftUI/Navigation/PageNavigationBackButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct PageNavigationBackButton: View {
2121
.if(pageNavigationHiddenBackButton) {
2222
$0.hidden()
2323
}
24+
.accessibilityLabel("NavigationBack")
2425
}
2526
}
2627

Anytype/Sources/PresentationLayer/Common/SwiftUI/RoundedTextFieldWithTitle/FramedTextField.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct FramedTextField<LeadingView: View>: View {
3232
if let title {
3333
AnytypeText(title, style: .uxCalloutRegular)
3434
.foregroundColor(.Text.secondary)
35+
.accessibilityLabel("Title")
3536
}
3637

3738
HStack(alignment: .center, spacing: 8) {
@@ -68,6 +69,7 @@ struct FramedTextField<LeadingView: View>: View {
6869
RoundedRectangle(cornerRadius: 26)
6970
.stroke(Color.Shape.transperentSecondary, lineWidth: 1)
7071
)
72+
.accessibilityLabel("TextFieldContainer")
7173
}
7274
}
7375

Anytype/Sources/PresentationLayer/Modules/SpaceCreate/SpaceCreateView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct SpaceCreateView: View {
2727
axis: .vertical,
2828
text: $model.spaceName
2929
)
30+
.accessibilityLabel("SpaceNameTextField")
3031

3132
if !FeatureFlags.spaceUxTypes {
3233
SectionHeaderView(title: Loc.typeLabel)

Anytype/Sources/PresentationLayer/Modules/SpaceHub/SpaceHubView.swift

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import DesignKit
55

66
struct SpaceHubView: View {
77
@StateObject private var model: SpaceHubViewModel
8-
@StateObject var spaceCreationTip = SpaceCreationTipWrapper()
98

109
@State private var draggedSpace: ParticipantSpaceViewDataWithPreview?
1110
@State private var draggedInitialIndex: Int?
@@ -27,6 +26,7 @@ struct SpaceHubView: View {
2726
SpaceDeleteAlert(spaceId: spaceId.value)
2827
}
2928
.handleChatCreationTip()
29+
.accessibilityLabel("SpaceHub")
3030
}
3131

3232
@ViewBuilder
@@ -119,21 +119,9 @@ struct SpaceHubView: View {
119119
}
120120

121121
ToolbarItem(placement: .topBarTrailing) {
122-
Button {
123-
spaceCreationTip.invalidate()
122+
SpaceHubNewSpaceButton {
124123
model.onTapCreateSpace()
125124
}
126-
label: {
127-
Image(asset: .X32.addFilled)
128-
.foregroundStyle(Color.Control.secondary)
129-
.frame(width: 32, height: 32)
130-
.overlay(alignment: .bottomLeading) {
131-
if spaceCreationTip.shouldDisplay {
132-
AttentionDotView()
133-
}
134-
}
135-
.padding(.vertical, 6)
136-
}
137125
}
138126
}
139127

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import SwiftUI
2+
3+
struct SpaceHubNewSpaceButton: View {
4+
5+
@StateObject var spaceCreationTip = SpaceCreationTipWrapper()
6+
7+
let onTap: () -> Void
8+
9+
var body: some View {
10+
Button {
11+
spaceCreationTip.invalidate()
12+
onTap()
13+
}
14+
label: {
15+
Image(asset: .X32.addFilled)
16+
.foregroundStyle(Color.Control.secondary)
17+
.frame(width: 32, height: 32)
18+
.overlay(alignment: .bottomLeading) {
19+
if spaceCreationTip.shouldDisplay {
20+
AttentionDotView()
21+
}
22+
}
23+
.padding(.vertical, 6)
24+
}
25+
.accessibilityLabel("NewSpaceButton")
26+
}
27+
}

Modules/DesignKit/Sources/DesignKit/Components/AnytypeTextField.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public struct AnytypeTextField: View {
2323
}
2424
.font(AnytypeFontBuilder.font(anytypeFont: font))
2525
.kerning(font.config.kern)
26+
.accessibilityLabel("TextField")
2627
}
2728
}
2829
}

0 commit comments

Comments
 (0)