wip
This commit is contained in:
parent
0eeb8f7b75
commit
13b34c90de
|
@ -44,7 +44,7 @@
|
||||||
"Chat.textfieldPrompt" = "Type a message";
|
"Chat.textfieldPrompt" = "Type a message";
|
||||||
|
|
||||||
"Chats.Create.Main.title" = "Create";
|
"Chats.Create.Main.title" = "Create";
|
||||||
"Chats.Create.Main.createGroup" = "Create puplic group";
|
"Chats.Create.Main.createGroup" = "Create public group";
|
||||||
"Chats.Create.Main.createPrivateGroup" = "Create private group";
|
"Chats.Create.Main.createPrivateGroup" = "Create private group";
|
||||||
"Chats.Create.Main.findGroup" = "Find public group";
|
"Chats.Create.Main.findGroup" = "Find public group";
|
||||||
|
|
||||||
|
|
|
@ -24,21 +24,27 @@ struct ChatsCreateMainScreen: View {
|
||||||
|
|
||||||
// List
|
// List
|
||||||
List {
|
List {
|
||||||
CreateRoomRowButton(
|
ChatsCreateRowButton(
|
||||||
title: L10n.Chats.Create.Main.createGroup,
|
title: L10n.Chats.Create.Main.createGroup,
|
||||||
image: "person.2.square.stack",
|
image: "person.2.fill",
|
||||||
action: {}
|
action: {}
|
||||||
)
|
)
|
||||||
CreateRoomRowButton(
|
ChatsCreateRowButton(
|
||||||
title: L10n.Chats.Create.Main.createPrivateGroup,
|
title: L10n.Chats.Create.Main.createPrivateGroup,
|
||||||
image: "person.2.square.stack",
|
image: "person.2.fill",
|
||||||
action: {}
|
action: {}
|
||||||
)
|
)
|
||||||
CreateRoomRowButton(
|
ChatsCreateRowButton(
|
||||||
title: L10n.Chats.Create.Main.findGroup,
|
title: L10n.Chats.Create.Main.findGroup,
|
||||||
image: "person.2.square.stack",
|
image: "magnifyingglass",
|
||||||
action: {}
|
action: {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// for contacts list
|
||||||
|
let rosters = store.state.rostersState.rosters.filter { !$0.locallyDeleted }
|
||||||
|
if rosters.isEmpty {
|
||||||
|
ChatsCreateRowSeparator()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.plain)
|
.listStyle(.plain)
|
||||||
|
|
||||||
|
@ -48,13 +54,15 @@ struct ChatsCreateMainScreen: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct CreateRoomRowButton: View {
|
private struct ChatsCreateRowButton: View {
|
||||||
var title: String
|
var title: String
|
||||||
var image: String
|
var image: String
|
||||||
var action: () -> Void
|
var action: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 16) {
|
VStack(alignment: .center, spacing: 0) {
|
||||||
|
Spacer()
|
||||||
|
HStack(alignment: .center, spacing: 16) {
|
||||||
Image(systemName: image)
|
Image(systemName: image)
|
||||||
.font(.head2)
|
.font(.head2)
|
||||||
.foregroundColor(.Material.Elements.active)
|
.foregroundColor(.Material.Elements.active)
|
||||||
|
@ -64,13 +72,26 @@ private struct CreateRoomRowButton: View {
|
||||||
.foregroundColor(.Material.Text.main)
|
.foregroundColor(.Material.Text.main)
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
Spacer()
|
||||||
|
Rectangle()
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.frame(height: 1)
|
||||||
|
.foregroundColor(.Material.Background.dark)
|
||||||
|
}
|
||||||
.sharedListRow()
|
.sharedListRow()
|
||||||
|
.frame(height: 48)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
action()
|
action()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct ChatsCreateRowSeparator: View {
|
||||||
|
var body: some View {
|
||||||
|
Text("aa")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// import SwiftUI
|
// import SwiftUI
|
||||||
//
|
//
|
||||||
// struct CreateConversationMainScreen: View {
|
// struct CreateConversationMainScreen: View {
|
||||||
|
@ -134,3 +155,28 @@ private struct CreateRoomRowButton: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// Preview
|
||||||
|
#if DEBUG
|
||||||
|
struct ChatsCreateMainScreen_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
ChatsCreateMainScreen(isPresented: .constant(true))
|
||||||
|
.environmentObject(pStore)
|
||||||
|
}
|
||||||
|
|
||||||
|
static var pStore: AppStore {
|
||||||
|
let state = pState
|
||||||
|
return AppStore(initialState: state, reducer: AppState.reducer, middlewares: [])
|
||||||
|
}
|
||||||
|
|
||||||
|
static var pState: AppState {
|
||||||
|
var state = AppState()
|
||||||
|
|
||||||
|
state.rostersState.rosters = [
|
||||||
|
.init(contactBareJid: "test@me.com", subscription: "both", ask: true, data: .init(groups: [], annotations: []))
|
||||||
|
]
|
||||||
|
|
||||||
|
return state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue