wip
This commit is contained in:
parent
0aafcf6362
commit
c8fa4a85b9
|
@ -13,8 +13,8 @@ struct ChatsListScreen: View {
|
|||
VStack(spacing: 0) {
|
||||
// Header
|
||||
SharedNavigationBar(
|
||||
centerText: SharedNavBarText(text: L10n.Chats.title),
|
||||
rightButton: SharedNavBarButton(
|
||||
centerText: .init(text: L10n.Chats.title),
|
||||
rightButton: .init(
|
||||
image: Image(systemName: "square.and.pencil"),
|
||||
action: {
|
||||
store.dispatch(.changeFlow(.createConversation))
|
||||
|
|
|
@ -17,7 +17,15 @@ struct ContactsScreen: View {
|
|||
// Content
|
||||
VStack(spacing: 0) {
|
||||
// Header
|
||||
ContactsScreenHeader(addPanelPresented: $addPanelPresented)
|
||||
SharedNavigationBar(
|
||||
centerText: .init(text: L10n.Contacts.title),
|
||||
rightButton: .init(
|
||||
image: Image(systemName: "plus"),
|
||||
action: {
|
||||
addPanelPresented = true
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
// Contacts list
|
||||
let rosters = store.state.rostersState.rosters.filter { !$0.locallyDeleted }
|
||||
|
@ -56,34 +64,6 @@ struct ContactsScreen: View {
|
|||
}
|
||||
}
|
||||
|
||||
private struct ContactsScreenHeader: View {
|
||||
@Binding var addPanelPresented: Bool
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// bg
|
||||
Color.Material.Background.dark
|
||||
.ignoresSafeArea()
|
||||
|
||||
// title
|
||||
Text(L10n.Contacts.title)
|
||||
.font(.head2)
|
||||
.foregroundColor(Color.Material.Text.main)
|
||||
|
||||
HStack {
|
||||
Spacer()
|
||||
Image(systemName: "plus")
|
||||
.foregroundColor(Color.Material.Elements.active)
|
||||
.tappablePadding(.symmetric(12)) {
|
||||
addPanelPresented = true
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.frame(height: 44)
|
||||
}
|
||||
}
|
||||
|
||||
private struct ContactsScreenRow: View {
|
||||
@EnvironmentObject var store: AppStore
|
||||
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
import SwiftUI
|
||||
|
||||
struct ConversationHeader: View {
|
||||
@EnvironmentObject var store: AppStore
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// bg
|
||||
Color.Material.Background.dark
|
||||
.ignoresSafeArea()
|
||||
|
||||
// title
|
||||
let name = (
|
||||
store.state.conversationsState.currentRoster?.name ??
|
||||
store.state.conversationsState.currentRoster?.contactBareJid
|
||||
) ?? L10n.Chat.title
|
||||
Text(name)
|
||||
.font(.head2)
|
||||
.foregroundColor(.Material.Text.main)
|
||||
|
||||
HStack {
|
||||
Image(systemName: "chevron.left")
|
||||
.foregroundColor(.Material.Elements.active)
|
||||
.tappablePadding(.symmetric(12)) {
|
||||
store.dispatch(.changeFlow(store.state.previousFlow))
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.frame(height: 44)
|
||||
}
|
||||
}
|
|
@ -18,7 +18,19 @@ struct ConversationScreen: View {
|
|||
// Content
|
||||
VStack(spacing: 0) {
|
||||
// Header
|
||||
ConversationHeader()
|
||||
let name = (
|
||||
store.state.conversationsState.currentRoster?.name ??
|
||||
store.state.conversationsState.currentRoster?.contactBareJid
|
||||
) ?? L10n.Chat.title
|
||||
SharedNavigationBar(
|
||||
leftButton: .init(
|
||||
image: Image(systemName: "chevron.left"),
|
||||
action: {
|
||||
store.dispatch(.changeFlow(store.state.previousFlow))
|
||||
}
|
||||
),
|
||||
centerText: .init(text: name)
|
||||
)
|
||||
|
||||
// Msg list
|
||||
let messages = store.state.conversationsState.currentMessages
|
||||
|
|
|
@ -27,7 +27,21 @@ struct AddContactOrChannelScreen: View {
|
|||
// Content
|
||||
VStack(spacing: 0) {
|
||||
// Header
|
||||
AddContactsScreenHeader(isPresented: $isPresented)
|
||||
SharedNavigationBar(
|
||||
leftButton: .init(
|
||||
image: Image(systemName: "chevron.left"),
|
||||
action: {
|
||||
isPresented = false
|
||||
}
|
||||
),
|
||||
centerText: .init(text: L10n.Contacts.Add.title),
|
||||
rightButton: .init(
|
||||
image: Image(systemName: "plus.viewfinder"),
|
||||
action: {
|
||||
print("Scan QR-code")
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
VStack(spacing: 16) {
|
||||
// Explanation text
|
||||
|
@ -132,36 +146,3 @@ struct AddContactOrChannelScreen: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct AddContactsScreenHeader: View {
|
||||
@Binding var isPresented: Bool
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// bg
|
||||
Color.Material.Background.dark
|
||||
.ignoresSafeArea()
|
||||
|
||||
// title
|
||||
Text(L10n.Contacts.Add.title)
|
||||
.font(.head2)
|
||||
.foregroundColor(.Material.Text.main)
|
||||
|
||||
HStack {
|
||||
Image(systemName: "chevron.left")
|
||||
.foregroundColor(Color.Material.Elements.active)
|
||||
.tappablePadding(.symmetric(12)) {
|
||||
isPresented = false
|
||||
}
|
||||
Spacer()
|
||||
Image(systemName: "plus.viewfinder")
|
||||
.foregroundColor(Color.Material.Elements.active)
|
||||
.tappablePadding(.symmetric(12)) {
|
||||
print("Scan QR-code")
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.frame(height: 44)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
import SwiftUI
|
||||
|
||||
struct SharingHeader: View {
|
||||
@EnvironmentObject var store: AppStore
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// bg
|
||||
Color.Material.Background.dark
|
||||
.ignoresSafeArea()
|
||||
|
||||
// title
|
||||
Text(L10n.Attachment.Prompt.main)
|
||||
.font(.head2)
|
||||
.foregroundColor(Color.Material.Text.main)
|
||||
|
||||
HStack {
|
||||
Spacer()
|
||||
Image(systemName: "xmark")
|
||||
.foregroundColor(Color.Material.Elements.active)
|
||||
.tappablePadding(.symmetric(12)) {
|
||||
store.dispatch(.sharingAction(.showSharing(false)))
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.frame(height: 44)
|
||||
}
|
||||
}
|
|
@ -14,7 +14,15 @@ struct AttachmentPickerScreen: View {
|
|||
// Content
|
||||
VStack(spacing: 0) {
|
||||
// Header
|
||||
SharingHeader()
|
||||
SharedNavigationBar(
|
||||
centerText: .init(text: L10n.Attachment.Prompt.main),
|
||||
rightButton: .init(
|
||||
image: Image(systemName: "xmark"),
|
||||
action: {
|
||||
store.dispatch(.sharingAction(.showSharing(false)))
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
// Pickers
|
||||
switch selectedTab {
|
||||
|
|
Loading…
Reference in a new issue