wip
This commit is contained in:
parent
0eeb8f7b75
commit
13b34c90de
|
@ -44,7 +44,7 @@
|
|||
"Chat.textfieldPrompt" = "Type a message";
|
||||
|
||||
"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.findGroup" = "Find public group";
|
||||
|
||||
|
|
|
@ -24,21 +24,27 @@ struct ChatsCreateMainScreen: View {
|
|||
|
||||
// List
|
||||
List {
|
||||
CreateRoomRowButton(
|
||||
ChatsCreateRowButton(
|
||||
title: L10n.Chats.Create.Main.createGroup,
|
||||
image: "person.2.square.stack",
|
||||
image: "person.2.fill",
|
||||
action: {}
|
||||
)
|
||||
CreateRoomRowButton(
|
||||
ChatsCreateRowButton(
|
||||
title: L10n.Chats.Create.Main.createPrivateGroup,
|
||||
image: "person.2.square.stack",
|
||||
image: "person.2.fill",
|
||||
action: {}
|
||||
)
|
||||
CreateRoomRowButton(
|
||||
ChatsCreateRowButton(
|
||||
title: L10n.Chats.Create.Main.findGroup,
|
||||
image: "person.2.square.stack",
|
||||
image: "magnifyingglass",
|
||||
action: {}
|
||||
)
|
||||
|
||||
// for contacts list
|
||||
let rosters = store.state.rostersState.rosters.filter { !$0.locallyDeleted }
|
||||
if rosters.isEmpty {
|
||||
ChatsCreateRowSeparator()
|
||||
}
|
||||
}
|
||||
.listStyle(.plain)
|
||||
|
||||
|
@ -48,13 +54,15 @@ struct ChatsCreateMainScreen: View {
|
|||
}
|
||||
}
|
||||
|
||||
private struct CreateRoomRowButton: View {
|
||||
private struct ChatsCreateRowButton: View {
|
||||
var title: String
|
||||
var image: String
|
||||
var action: () -> Void
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 16) {
|
||||
VStack(alignment: .center, spacing: 0) {
|
||||
Spacer()
|
||||
HStack(alignment: .center, spacing: 16) {
|
||||
Image(systemName: image)
|
||||
.font(.head2)
|
||||
.foregroundColor(.Material.Elements.active)
|
||||
|
@ -64,13 +72,26 @@ private struct CreateRoomRowButton: View {
|
|||
.foregroundColor(.Material.Text.main)
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
Rectangle()
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 1)
|
||||
.foregroundColor(.Material.Background.dark)
|
||||
}
|
||||
.sharedListRow()
|
||||
.frame(height: 48)
|
||||
.onTapGesture {
|
||||
action()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ChatsCreateRowSeparator: View {
|
||||
var body: some View {
|
||||
Text("aa")
|
||||
}
|
||||
}
|
||||
|
||||
// import SwiftUI
|
||||
//
|
||||
// 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