mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Extract the timeline scroll to bottom button into its own view.
This commit is contained in:
committed by
Stefan Ceriu
parent
952e4f86c2
commit
e86fdaacaf
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2025 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineScrollToBottomButton: View {
|
||||
let isVisible: Bool
|
||||
let callback: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button { callback() } label: {
|
||||
Image(systemName: "chevron.down")
|
||||
.font(.compound.bodyLG)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.padding(13)
|
||||
.offset(y: 1)
|
||||
.background {
|
||||
Circle()
|
||||
.fill(Color.compound.iconOnSolidPrimary)
|
||||
// Intentionally using system primary colour to get white/black.
|
||||
.shadow(color: .primary.opacity(0.33), radius: 2.0)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.opacity(isVisible ? 0.0 : 1.0)
|
||||
.accessibilityHidden(isVisible)
|
||||
.animation(.elementDefault, value: isVisible)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user