mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Move composer specific designs to the composer toolbar.
This commit is contained in:
committed by
Stefan Ceriu
parent
a4398b45fa
commit
4072031f4e
@@ -39,6 +39,14 @@ struct ComposerToolbar: View {
|
||||
}
|
||||
.padding(.leading, 5)
|
||||
.padding(.trailing, 8)
|
||||
.padding(.bottom, context.composerFormattingEnabled ? 8 : 12)
|
||||
.background {
|
||||
if context.composerFormattingEnabled {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.stroke(Color.compound.borderInteractiveSecondary, lineWidth: 0.5)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
.readFrame($frame)
|
||||
.overlay(alignment: .bottom) {
|
||||
if verticalSizeClass != .compact, !context.composerExpanded {
|
||||
|
||||
@@ -12,7 +12,6 @@ import WysiwygComposer
|
||||
struct RoomScreen: View {
|
||||
@ObservedObject private var context: RoomScreenViewModelType.Context
|
||||
@ObservedObject private var timelineContext: TimelineViewModelType.Context
|
||||
@ObservedObject private var composerToolbarContext: ComposerToolbarViewModelType.Context
|
||||
let composerToolbar: ComposerToolbar
|
||||
|
||||
init(context: RoomScreenViewModelType.Context,
|
||||
@@ -21,7 +20,6 @@ struct RoomScreen: View {
|
||||
self.context = context
|
||||
self.timelineContext = timelineContext
|
||||
self.composerToolbar = composerToolbar
|
||||
composerToolbarContext = composerToolbar.context
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -48,14 +46,6 @@ struct RoomScreen: View {
|
||||
}
|
||||
|
||||
composer
|
||||
.padding(.bottom, composerToolbarContext.composerFormattingEnabled ? 8 : 12)
|
||||
.background {
|
||||
if composerToolbarContext.composerFormattingEnabled {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.stroke(Color.compound.borderInteractiveSecondary, lineWidth: 0.5)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.environmentObject(timelineContext)
|
||||
@@ -66,7 +56,6 @@ struct RoomScreen: View {
|
||||
}
|
||||
.navigationTitle(L10n.screenRoomTitle) // Hidden but used for back button text.
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarHidden(isNavigationBarHidden)
|
||||
.toolbar { toolbar }
|
||||
.toolbarBackground(.visible, for: .navigationBar) // Fix the toolbar's background.
|
||||
.overlay { loadingIndicator }
|
||||
@@ -147,7 +136,7 @@ struct RoomScreen: View {
|
||||
}
|
||||
.padding(.top, 16)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.bottom, 8)
|
||||
.padding(.bottom, 12)
|
||||
.highlight(borderColor: .compound.borderInfoSubtle,
|
||||
primaryColor: .compound.bgInfoSubtle,
|
||||
secondaryColor: .compound.bgCanvasDefault)
|
||||
@@ -213,10 +202,6 @@ struct RoomScreen: View {
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.joinCall)
|
||||
}
|
||||
}
|
||||
|
||||
private var isNavigationBarHidden: Bool {
|
||||
composerToolbarContext.composerFormattingEnabled && composerToolbarContext.composerExpanded && UIDevice.current.userInterfaceIdiom == .pad
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@@ -11,7 +11,6 @@ import SwiftUI
|
||||
struct ThreadTimelineScreen: View {
|
||||
@ObservedObject private var context: ThreadTimelineScreenViewModelType.Context
|
||||
@ObservedObject private var timelineContext: TimelineViewModelType.Context
|
||||
@ObservedObject private var composerToolbarContext: ComposerToolbarViewModelType.Context
|
||||
private let composerToolbar: ComposerToolbar
|
||||
|
||||
init(context: ThreadTimelineScreenViewModelType.Context,
|
||||
@@ -20,7 +19,6 @@ struct ThreadTimelineScreen: View {
|
||||
self.context = context
|
||||
self.timelineContext = timelineContext
|
||||
self.composerToolbar = composerToolbar
|
||||
composerToolbarContext = composerToolbar.context
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -37,14 +35,6 @@ struct ThreadTimelineScreen: View {
|
||||
}
|
||||
.safeAreaInset(edge: .bottom, spacing: 0) {
|
||||
composer
|
||||
.padding(.bottom, composerToolbarContext.composerFormattingEnabled ? 8 : 12)
|
||||
.background {
|
||||
if composerToolbarContext.composerFormattingEnabled {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.stroke(Color.compound.borderInteractiveSecondary, lineWidth: 0.5)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.environmentObject(timelineContext)
|
||||
|
||||
Reference in New Issue
Block a user