mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
no emojis hinter in pack detail view
This commit is contained in:
2 files changed
+33
-4
No files matched your search
@@ -19,7 +19,7 @@ extension EmojiPack {
|
||||
EmojiPack(
|
||||
id: UUID(),
|
||||
name: "New Pack",
|
||||
description: "Emoji Pack at \(Date().formatted())",
|
||||
description: "Created on \(Date().formatted())",
|
||||
emojiNames: []
|
||||
)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ struct EmojiPackDetailView: View {
|
||||
Button() {
|
||||
editName.toggle()
|
||||
} label: {
|
||||
Text(pack.name)
|
||||
Text(pack.name.isEmpty ? "Name" : pack.name)
|
||||
.bold()
|
||||
.foregroundStyle(edit ? .blue : .primary)
|
||||
.font(.title)
|
||||
@@ -46,7 +46,7 @@ struct EmojiPackDetailView: View {
|
||||
Button() {
|
||||
editDescription.toggle()
|
||||
} label: {
|
||||
Text(pack.description)
|
||||
Text(pack.description.isEmpty ? "Description" : pack.description)
|
||||
.foregroundStyle(edit ? .blue : .primary)
|
||||
}
|
||||
.disabled(!edit)
|
||||
@@ -54,6 +54,35 @@ struct EmojiPackDetailView: View {
|
||||
TextField("", text: $pack.description)
|
||||
}
|
||||
|
||||
if pack.emojiNames.isEmpty {
|
||||
VStack(alignment: .center) {
|
||||
HStack {
|
||||
Image(systemName: "exclamationmark.triangle.fill")
|
||||
Text("No Emoji")
|
||||
.bold()
|
||||
Image(systemName: "exclamationmark.triangle.fill")
|
||||
}
|
||||
.foregroundStyle(.yellow)
|
||||
Text("This pack contians no emojis 😭")
|
||||
.padding(.vertical, 5)
|
||||
.foregroundStyle(.foreground)
|
||||
Text("Add emojis to this pack by editing it using the pencil button in the toolbar.")
|
||||
Text("You can also change the name and description by tapping it in edit mode.")
|
||||
.padding(.vertical, 5)
|
||||
}
|
||||
.foregroundStyle(.gray)
|
||||
.multilineTextAlignment(.center)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding()
|
||||
.background {
|
||||
Color.purple.opacity(0.2)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 10))
|
||||
.blur(radius: 5)
|
||||
.shadow(color: .purple, radius: 5)
|
||||
}
|
||||
// .padding(.vertical)
|
||||
}
|
||||
|
||||
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
|
||||
let layout = Array(repeating: col, count: columns)
|
||||
LazyVGrid(columns: layout, spacing: spacing) {
|
||||
@@ -145,7 +174,7 @@ struct EmojiPackDetailView: View {
|
||||
|
||||
@available(iOS 17, *)
|
||||
#Preview {
|
||||
@Previewable @State var pack: EmojiPack = .test
|
||||
@Previewable @State var pack: EmojiPack = .new()
|
||||
EmojiPackDetailView(
|
||||
hoarder: EmojiHoarder(localOnly: true, skipIndex: false),
|
||||
pack: $pack
|
||||
|
||||