Skip to content

Commit 315c04d

Browse files
authored
feat: Update iOS Demo app navigation (#184)
* feat: Standardize iOS navigation Remove duplicative actions. Disable unsupported actions. * feat: iOS Demo app close button uses "X" icon rather than "Back" text Match the WordPress mobile app design.
1 parent b21dd88 commit 315c04d

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

ios/Demo-iOS/Sources/EditorView.swift

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,34 @@ import GutenbergKit
33

44
struct EditorView: View {
55
private let configuration: EditorConfiguration
6+
@Environment(\.dismiss) private var dismiss
67

78
init(configuration: EditorConfiguration) {
89
self.configuration = configuration
910
}
1011

1112
var body: some View {
1213
_EditorView(configuration: configuration)
14+
.navigationBarBackButtonHidden(true)
1315
.toolbar {
14-
ToolbarItemGroup(placement: .topBarLeading) {
15-
Button(action: {}, label: {
16+
ToolbarItem(placement: .topBarLeading) {
17+
Button(action: {
18+
dismiss()
19+
}, label: {
1620
Image(systemName: "xmark")
1721
})
1822
}
23+
1924
ToolbarItemGroup(placement: .topBarTrailing) {
2025
Button(action: {}, label: {
2126
Image(systemName: "arrow.uturn.backward")
22-
})
27+
}).disabled(true)
2328
Button(action: {}, label: {
2429
Image(systemName: "arrow.uturn.forward")
2530
}).disabled(true)
2631
}
2732

2833
ToolbarItemGroup(placement: .topBarTrailing) {
29-
Button(action: {}, label: {
30-
Image(systemName: "safari")
31-
})
32-
3334
moreMenu
3435
}
3536
}
@@ -40,25 +41,19 @@ struct EditorView: View {
4041
Section {
4142
Button(action: {}, label: {
4243
Label("Code Editor", systemImage: "curlybraces")
43-
})
44-
Button(action: {}, label: {
45-
Label("Outline", systemImage: "list.bullet.indent")
46-
})
44+
}).disabled(true)
4745
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
4846
Label("Preview", systemImage: "safari")
49-
})
50-
}
51-
Section {
47+
}).disabled(true)
5248
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
5349
Label("Revisions (42)", systemImage: "clock.arrow.circlepath")
54-
})
50+
}).disabled(true)
5551
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
5652
Label("Post Settings", systemImage: "gearshape")
57-
})
58-
53+
}).disabled(true)
5954
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
6055
Label("Help", systemImage: "questionmark.circle")
61-
})
56+
}).disabled(true)
6257
}
6358
Section {
6459
Text("Blocks: 4, Words: 8, Characters: 15")
@@ -68,7 +63,6 @@ struct EditorView: View {
6863
} label: {
6964
Image(systemName: "ellipsis")
7065
}
71-
.tint(Color.primary)
7266
}
7367
}
7468

0 commit comments

Comments
 (0)