Move composer specific designs to the composer toolbar.
This commit is contained in:
committed by
Stefan Ceriu
parent
eeff596932
commit
822f347dc2
@@ -15,5 +15,6 @@ struct ComposerDisabledView: View {
|
||||
.foregroundStyle(.compound.textDisabled)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.vertical, 10) // Matches the MessageComposerStyleModifier
|
||||
.padding(.bottom, 12)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:82285a55ec3b0f5298ce5b647aabc6ba6c972ce990dc57a4022386153b1ee853
|
||||
size 75188
|
||||
oid sha256:85e45276b103434f723b08aaf54cfe426abc13f0a7679613d5fbe8a83325ec94
|
||||
size 75323
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1c492e3a9f6ed6ce82fe30793dee376a21d65e08ebd30feb533eed847ab19eac
|
||||
size 75607
|
||||
oid sha256:7d5021fa24b1d5f192ed76bb390dbff053100b5623047a63c152f0f35e30bcbd
|
||||
size 75731
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3b4c630e998cf988d78fa47c173cd6c88a0ba62614aece13594e38b1bedb5a18
|
||||
size 34259
|
||||
oid sha256:9c35db320a8a6cc7f7fa972d7b21f22eef64c3f7c030e6851242901f4bc430e7
|
||||
size 34471
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0dbeab35fcfbe6dd91a0d6f49e034f10947a4cba8434ba4426372a5a43cc7503
|
||||
size 34683
|
||||
oid sha256:c1ef324a6f8e718d4e0aa24d40f2fd24d4bc160cab1e9fda842a9d632b15b1c1
|
||||
size 34887
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:354ae5c30f4f69ab6b937267bfdef9a90529c742713058f310243fab3aea3d4e
|
||||
size 93459
|
||||
oid sha256:e29fbc6ee608e2b8c8577ebbaa8e5e81c62178843596f27be5b880a602678ecb
|
||||
size 93521
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:95ba8bd9275db26f0d2c65ff8a0fa87554a9c4fed7c1bb7730fedc511d5e6673
|
||||
size 94331
|
||||
oid sha256:89e98c6a45920ba04a672f8870a31cc2c3a65f29598b4fc50d555fe7e1bb6d1d
|
||||
size 94425
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8c1bc355f9cf5fd9fe2d513106ba255a5ecd1d734e2804c7aca8666b2b6125c
|
||||
size 50545
|
||||
oid sha256:ce454947bab757b85d78c786f3c7da0b8e9097bcf2e830ddbf43fe7a8a8f6896
|
||||
size 50581
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2f663184357a7f25bafaae47d8a0f95a4007576bfa63e8d8a9a0f7cd693ecfb1
|
||||
size 51416
|
||||
oid sha256:beeab7135aadf7adfa80e8480e9d303daee66235fe92d7f07427fa7db9888798
|
||||
size 51446
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6481af0efc8d6db57d290462e559e8a468dcd762261d75ed689076df4ebff2a5
|
||||
size 98651
|
||||
oid sha256:95b63f112a7b3afea22dcb5e15b78d9a1f1eb450d3a577360b9efc5e2e77c2c9
|
||||
size 99035
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2fdb37f8cd26f33b98d90d5a8e522a7eb771df126d8077846d0bf99667aa4474
|
||||
size 99448
|
||||
oid sha256:24c29efa36f9caab05536b1422988a7203661ef72b6d7d75f7f2729d965f5ab8
|
||||
size 99849
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e1a00b9499279c42085e07586a13c83193a4d00e3effcd4ebcc281f5947af0b6
|
||||
size 56100
|
||||
oid sha256:7a624dd19ae7d8976591004d1142647a5e69b83c8f8fd87a0bede6c7ed95aa12
|
||||
size 56169
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:46d345b6e8846fb9a85b8cb45c233f1711ff42a7b53d0f23866bb7c4dbce4d96
|
||||
size 56927
|
||||
oid sha256:c92cdab0be98bb1de37d888ac9adcd3f29c0473f1b2220f6d52fc293465c0dd5
|
||||
size 57003
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e84f7915ecc0c4e045374e0d90076c6c7ca9474b5608638b05b3a767c6a92eac
|
||||
size 108030
|
||||
oid sha256:c70aabd1564c28b3d569804d2d8064c95f1938ec6c1dff409346f9cc59c3ed47
|
||||
size 108239
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f07c519fc76e215d8afa0353dae21250ca1b2b6784bac5b02eb8d8fd9bfcc2ea
|
||||
size 108448
|
||||
oid sha256:bc4cc5e2125cadc5b7fb0820c6d018622f5c6bacc22ea4bbf60ca114b4ebcced
|
||||
size 108655
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4a0632f05e42d37d0e664a3aff9def67a86dadc8757e4c093cc3630f8879fb3f
|
||||
size 62590
|
||||
oid sha256:efa88f31d1e27e90cc785b5ac63aa686a5334a4513fde59f6b3b3e2f7fb631c1
|
||||
size 62692
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a3d6c752d779fa96e2d70b6d7ee87456ff2ae71200b7dccc0ff60d20ddee990
|
||||
size 63005
|
||||
oid sha256:82f0df37a07c27713bd4a26a16d93132b46c3db9ecf943c908d774ccc8667dce
|
||||
size 63103
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0b04029a954554a00aa296dcbb1f97b64e403deaae862e1fedc9e3a735c299d5
|
||||
size 75293
|
||||
oid sha256:ea5b800aba78730d31cd47cafb275f9683ee9e4fe40208fa386408727c5be388
|
||||
size 75401
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3b47add2c0d7d279cb1b311aa9614911384bbbf5c1cefffe093048505241473f
|
||||
size 75711
|
||||
oid sha256:4e8778d01225ec03f6be4de5a6ead3d521b6a846f7dc930c15cdcd8c56ceffa6
|
||||
size 75812
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa9feca8c6f7644e1e1807fbda71752957c4f57ea43222e802426fc586616338
|
||||
size 34424
|
||||
oid sha256:70bc2fff42a40d63ce3d536644a26735c887b7d6af9696a9963520cb14d2a83d
|
||||
size 34626
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2d51b37198061c4bdf5fb198e16584c30f10a03a0eb0bcc9ad11bb704aa2a19
|
||||
size 34839
|
||||
oid sha256:aeea98e9077d43b967681191d5e2da15dbfa788a745c3e2f8a1752698df6d412
|
||||
size 35045
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:42ce084b1cd46ffd146b54c669bae1fa6f842e02e9f840ae92972af4f035ba3e
|
||||
size 352872
|
||||
oid sha256:0983e6d407f0e5eb0750638092860e83ee32932dbbf114d96002fc2a2e0287c0
|
||||
size 352931
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7d73de09a9fbe543821b29fa1261d5175e3a0d994b90e21b71157bd05d463a48
|
||||
size 365960
|
||||
oid sha256:37f4f1832e34b4cfe1409a3fc8c97af54033d13ff57f85422f5251c35db08799
|
||||
size 366220
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:816d2ea7bd4c6653e9c27a7735575ba05890a5f16d39d3d38db344a10e8c0ce9
|
||||
size 205525
|
||||
oid sha256:d88e1fd0fe02dd85df0b5c9fb76c8e2b433beb532dcd9d025ea68c5d6c3c2c09
|
||||
size 207618
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2a46c473e05f8b8fa538e78dc0bf33ba3867fe5b7a33fc2be325bfb75e7cd688
|
||||
size 213588
|
||||
oid sha256:440d0bdbf7541c5be001376e792ca439a0dca177c014204dffdc6193362728b7
|
||||
size 219131
|
||||
|
||||
Reference in New Issue
Block a user