mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
TimelineKind refactor (#3193)
This commit is contained in:
+12
-11
@@ -54,19 +54,20 @@ struct PinnedItemsBannerView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private var viewAllButton: some View {
|
||||
switch state {
|
||||
case .loaded:
|
||||
Button { onViewAllButtonTap() } label: {
|
||||
Text(L10n.screenRoomPinnedBannerViewAllButtonTitle)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundStyle(Color.compound.textPrimary)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 5)
|
||||
}
|
||||
case .loading:
|
||||
ProgressView()
|
||||
Button { onViewAllButtonTap() } label: {
|
||||
Text(state.isLoading ? "" : L10n.screenRoomPinnedBannerViewAllButtonTitle)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundStyle(Color.compound.textPrimary)
|
||||
.opacity(state.isLoading ? 0 : 1)
|
||||
// Use overlay instead otherwise the sliding animation would not work
|
||||
.overlay(alignment: .trailing) {
|
||||
ProgressView()
|
||||
.opacity(state.isLoading ? 1 : 0)
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 5)
|
||||
}
|
||||
.disabled(state.isLoading)
|
||||
}
|
||||
|
||||
private var content: some View {
|
||||
|
||||
@@ -220,7 +220,6 @@ struct RoomScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let roomViewModel = RoomScreenViewModel.mock(roomProxyMock: roomProxyMock)
|
||||
static let timelineViewModel = TimelineViewModel(roomProxy: roomProxyMock,
|
||||
timelineController: MockRoomTimelineController(),
|
||||
isPinnedEventsTimeline: false,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
mediaPlayerProvider: MediaPlayerProviderMock(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock(),
|
||||
|
||||
Reference in New Issue
Block a user