More space tweaks (#4584)
* Remove the room count everywhere. * Remove the parent name from restricted spaces.
This commit is contained in:
@@ -63,7 +63,7 @@ struct SpaceHeaderView: View {
|
||||
|
||||
var spaceDetails: some View {
|
||||
Label {
|
||||
Text(L10n.screenSpaceListDetails(spaceDetailsVisibilityTitle, L10n.commonRooms(spaceRoomProxy.childrenCount)))
|
||||
Text(spaceDetailsVisibilityTitle)
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundStyle(.compound.textSecondary)
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -77,7 +77,7 @@ struct SpaceHeaderView: View {
|
||||
switch spaceRoomProxy.visibility {
|
||||
case .public: L10n.commonPublicSpace
|
||||
case .private: L10n.commonPrivateSpace
|
||||
case .restricted(let parentName): L10n.screenSpaceListParentSpace(parentName)
|
||||
case .restricted: L10n.commonSharedSpace
|
||||
case .none: L10n.commonPrivateSpace
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,6 @@ struct SpaceHeaderView_Previews: PreviewProvider, TestablePreview {
|
||||
SpaceRoomProxyMock(.init(id: "!space3:matrix.org",
|
||||
name: "Subspace",
|
||||
isSpace: true,
|
||||
parent: SpaceRoomProxyMock(.init(name: "Foundation", isSpace: true)),
|
||||
childrenCount: 30,
|
||||
joinedMembersCount: 123,
|
||||
heroes: [.mockDan, .mockBob, .mockCharlie, .mockVerbose],
|
||||
|
||||
@@ -28,7 +28,7 @@ struct SpaceRoomCell: View {
|
||||
switch spaceRoomProxy.visibility {
|
||||
case .public: L10n.commonPublicSpace
|
||||
case .private: L10n.commonPrivateSpace
|
||||
case .restricted(let parentName): L10n.screenSpaceListParentSpace(parentName)
|
||||
case .restricted: L10n.commonSharedSpace
|
||||
case .none: L10n.commonPrivateSpace
|
||||
}
|
||||
} else {
|
||||
@@ -47,8 +47,7 @@ struct SpaceRoomCell: View {
|
||||
|
||||
private var details: String {
|
||||
if spaceRoomProxy.isSpace {
|
||||
L10n.screenSpaceListDetails(L10n.commonRooms(spaceRoomProxy.childrenCount),
|
||||
L10n.commonMemberCount(spaceRoomProxy.joinedMembersCount))
|
||||
L10n.commonMemberCount(spaceRoomProxy.joinedMembersCount)
|
||||
} else {
|
||||
spaceRoomProxy.topic ?? " " // Use a single space to reserve a consistent amount of space.
|
||||
}
|
||||
|
||||
@@ -21,14 +21,6 @@ struct SpaceListScreenViewState: BindableState {
|
||||
var selectedSpaceID: String?
|
||||
|
||||
var bindings: SpaceListScreenViewStateBindings
|
||||
|
||||
var subtitle: String {
|
||||
L10n.screenSpaceListDetails(L10n.commonSpaces(joinedSpaces.count), L10n.commonRooms(joinedRoomsCount))
|
||||
}
|
||||
|
||||
var joinedRoomsCount: Int {
|
||||
joinedSpaces.map(\.childrenCount).reduce(0, +)
|
||||
}
|
||||
}
|
||||
|
||||
struct SpaceListScreenViewStateBindings {
|
||||
|
||||
@@ -39,7 +39,7 @@ struct SpaceListScreen: View {
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Text(context.viewState.subtitle)
|
||||
Text(L10n.commonSpaces(context.viewState.joinedSpaces.count))
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundStyle(.compound.textSecondary)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
@@ -153,7 +153,6 @@ struct LeaveSpaceView_Previews: PreviewProvider, TestablePreview {
|
||||
static let spaceRoomProxy = SpaceRoomProxyMock(.init(id: "!eng-space:matrix.org",
|
||||
name: "Engineering Team",
|
||||
isSpace: true,
|
||||
parent: SpaceRoomProxyMock(.init(name: "MegaGroup", isSpace: true)),
|
||||
childrenCount: 30,
|
||||
joinedMembersCount: 76,
|
||||
heroes: [.mockDan, .mockBob, .mockCharlie, .mockVerbose],
|
||||
|
||||
@@ -89,7 +89,6 @@ struct SpaceScreen_Previews: PreviewProvider, TestablePreview {
|
||||
let spaceRoomProxy = SpaceRoomProxyMock(.init(id: "!eng-space:matrix.org",
|
||||
name: "Engineering Team",
|
||||
isSpace: true,
|
||||
parent: SpaceRoomProxyMock(.init(name: "MegaGroup", isSpace: true)),
|
||||
childrenCount: 30,
|
||||
joinedMembersCount: 76,
|
||||
heroes: [.mockDan, .mockBob, .mockCharlie, .mockVerbose],
|
||||
|
||||
Reference in New Issue
Block a user