mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
ui updates
This commit is contained in:
3 files changed
+57
-36
No files matched your search
@@ -167,18 +167,16 @@ struct EmojiPackDetailView: View {
|
||||
}
|
||||
.animation(.spring, value: pack.items)
|
||||
.padding()
|
||||
.padding(.bottom, 32)
|
||||
}
|
||||
.transition(.scale)
|
||||
.navigationTitle(edit ? "Editing" : "Pack Details")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.overlay(alignment: .bottom) {
|
||||
|
||||
Text("\(pack.items.count) Emoji\(pack.items.count.plural)")
|
||||
.bold()
|
||||
.multilineTextAlignment(.center)
|
||||
.shadow(radius: 5)
|
||||
.padding(.bottom)
|
||||
}
|
||||
.transition(.scale)
|
||||
.navigationTitle(edit ? "Editing" : "Pack Details")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.onDisappear {
|
||||
hoarder.saveEmojiPacks()
|
||||
}
|
||||
|
||||
@@ -119,3 +119,26 @@ struct ScrollContentBackgroundHidden: ViewModifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TabViewBottomAcceessorySafe<T: View>: ViewModifier {
|
||||
var isEnabled: Bool
|
||||
@ViewBuilder var contents: () -> T
|
||||
|
||||
func body(content: Content) -> some View where Content: View {
|
||||
if #available(iOS 26.1, *) {
|
||||
content
|
||||
.tabViewBottomAccessory(isEnabled: isEnabled, content: contents)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
func tabViewBottomAccessorySafe<Content: View>(
|
||||
isEnabled: Bool = true,
|
||||
@ViewBuilder content: @escaping () -> Content
|
||||
) -> some View {
|
||||
modifier(TabViewBottomAcceessorySafe(isEnabled: isEnabled, contents: content))
|
||||
}
|
||||
}
|
||||