mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
axed description from emoji packs
This commit is contained in:
5 files changed
+36
-54
No files matched your search
@@ -12,13 +12,11 @@ import UniformTypeIdentifiers
|
|||||||
struct EmojiPack: Identifiable, Codable, Equatable, Hashable {
|
struct EmojiPack: Identifiable, Codable, Equatable, Hashable {
|
||||||
var id: UUID
|
var id: UUID
|
||||||
var name: String
|
var name: String
|
||||||
var description: String
|
|
||||||
var items: [String]
|
var items: [String]
|
||||||
|
|
||||||
init(id: UUID, name: String, description: String, items: [String]) {
|
init(id: UUID, name: String, items: [String]) {
|
||||||
self.id = id
|
self.id = id
|
||||||
self.name = name
|
self.name = name
|
||||||
self.description = description
|
|
||||||
self.items = items
|
self.items = items
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +52,7 @@ struct EmojiPack: Identifiable, Codable, Equatable, Hashable {
|
|||||||
case "name":
|
case "name":
|
||||||
pack.name = value
|
pack.name = value
|
||||||
case "description":
|
case "description":
|
||||||
pack.description = value
|
print(value)
|
||||||
case "items":
|
case "items":
|
||||||
if let data = Data(base64Encoded: value),
|
if let data = Data(base64Encoded: value),
|
||||||
let decoded = try? JSONDecoder().decode([String].self, from: data) {
|
let decoded = try? JSONDecoder().decode([String].self, from: data) {
|
||||||
@@ -126,7 +124,6 @@ struct EmojiPack: Identifiable, Codable, Equatable, Hashable {
|
|||||||
let queries: [URLQueryItem] = [
|
let queries: [URLQueryItem] = [
|
||||||
.init(name: "id", value: id.uuidString),
|
.init(name: "id", value: id.uuidString),
|
||||||
.init(name: "name", value: name),
|
.init(name: "name", value: name),
|
||||||
.init(name: "description", value: description),
|
|
||||||
.init(name: "items", value: data.base64EncodedString())
|
.init(name: "items", value: data.base64EncodedString())
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -154,7 +151,6 @@ extension EmojiPack {
|
|||||||
EmojiPack(
|
EmojiPack(
|
||||||
id: UUID(),
|
id: UUID(),
|
||||||
name: "New Pack",
|
name: "New Pack",
|
||||||
description: "Created on \(Date().formatted())",
|
|
||||||
items: items
|
items: items
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ extension EmojiPack {
|
|||||||
EmojiPack(
|
EmojiPack(
|
||||||
id: UUID(),
|
id: UUID(),
|
||||||
name: "test pack",
|
name: "test pack",
|
||||||
description: "neon443's debug emoji pack",
|
|
||||||
items: [
|
items: [
|
||||||
"pf",
|
"pf",
|
||||||
"heavysob",
|
"heavysob",
|
||||||
@@ -134,36 +133,36 @@ extension EmojiPack {
|
|||||||
"loll",
|
"loll",
|
||||||
"bleh",
|
"bleh",
|
||||||
"uhh",
|
"uhh",
|
||||||
// "communist"
|
"communist"
|
||||||
"communist",
|
// "communist",
|
||||||
"ufahh",
|
// "ufahh",
|
||||||
"uhafh",
|
// "uhafh",
|
||||||
"uhgfh",
|
// "uhgfh",
|
||||||
"uoohh",
|
// "uoohh",
|
||||||
"ujyhgghh",
|
// "ujyhgghh",
|
||||||
"uhfgh",
|
// "uhfgh",
|
||||||
"ujg3thh",
|
// "ujg3thh",
|
||||||
"uyhh",
|
// "uyhh",
|
||||||
"ughhhh",
|
// "ughhhh",
|
||||||
"uvhh",
|
// "uvhh",
|
||||||
"ujrg3tjthhg",
|
// "ujrg3tjthhg",
|
||||||
"ujherh",
|
// "ujherh",
|
||||||
"uxhggrh",
|
// "uxhggrh",
|
||||||
"ushgrq3geallh",
|
// "ushgrq3geallh",
|
||||||
"u hrgqh",
|
// "u hrgqh",
|
||||||
"ujjjjjyhgh",
|
// "ujjjjjyhgh",
|
||||||
"uherhh",
|
// "uherhh",
|
||||||
"uhhesh",
|
// "uhhesh",
|
||||||
"hhreruhgh",
|
// "hhreruhgh",
|
||||||
"u hffh",
|
// "u hffh",
|
||||||
"uh h",
|
// "uh h",
|
||||||
"uaugerhh",
|
// "uaugerhh",
|
||||||
"u4h3h",
|
// "u4h3h",
|
||||||
"u4hh",
|
// "u4hh",
|
||||||
"ueyhh ",
|
// "ueyhh ",
|
||||||
"u erthh",
|
// "u erthh",
|
||||||
"uhujh",
|
// "uhujh",
|
||||||
"ujkkkkhh"
|
// "ujkkkkhh"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ struct EmojiPackDetailView: View {
|
|||||||
|
|
||||||
@State var edit: Bool = false
|
@State var edit: Bool = false
|
||||||
@State var editName: Bool = false
|
@State var editName: Bool = false
|
||||||
@State var editDescription: Bool = false
|
|
||||||
|
|
||||||
@State var downloading: Bool = false
|
@State var downloading: Bool = false
|
||||||
|
|
||||||
@State var showAdder: Bool = false
|
@State var showAdder: Bool = false
|
||||||
@@ -46,17 +45,6 @@ struct EmojiPackDetailView: View {
|
|||||||
TextField("", text: $pack.name)
|
TextField("", text: $pack.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button() {
|
|
||||||
editDescription.toggle()
|
|
||||||
} label: {
|
|
||||||
Text(pack.description.isEmpty ? "Description" : pack.description)
|
|
||||||
.foregroundStyle(edit ? Color.accentColor : .primary)
|
|
||||||
}
|
|
||||||
.disabled(!edit)
|
|
||||||
.alert("Edit Description", isPresented: $editDescription) {
|
|
||||||
TextField("", text: $pack.description)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pack.items.isEmpty {
|
if pack.items.isEmpty {
|
||||||
EmptyCollectionView(
|
EmptyCollectionView(
|
||||||
title: "No Emoji",
|
title: "No Emoji",
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ struct EmojiPackPreview: View {
|
|||||||
.foregroundStyle(.primary)
|
.foregroundStyle(.primary)
|
||||||
.font(.title)
|
.font(.title)
|
||||||
|
|
||||||
Text(pack.description.isEmpty ? "Description" : pack.description)
|
|
||||||
.foregroundStyle(.primary)
|
|
||||||
|
|
||||||
if pack.items.isEmpty {
|
if pack.items.isEmpty {
|
||||||
EmptyCollectionView(
|
EmptyCollectionView(
|
||||||
title: "No Emoji",
|
title: "No Emoji",
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ class EmojiPackDetailViewController: UINavigationController {
|
|||||||
target: nil,
|
target: nil,
|
||||||
action: nil
|
action: nil
|
||||||
)
|
)
|
||||||
collectionView.navigationItem.title = pack.name
|
// collectionView.navigationItem.title = pack.name
|
||||||
|
|
||||||
|
collectionView.navigationItem.titleView = UIImageView(image: UIImage(systemName: "square.and.arrow.up.circle.fill"))
|
||||||
// collectionView.toolbarItems = [editButton, downloadButton, shareButton]
|
// collectionView.toolbarItems = [editButton, downloadButton, shareButton]
|
||||||
collectionView.navigationItem.leftBarButtonItems = [editButton, adderSheetButton]
|
collectionView.navigationItem.leftBarButtonItems = [editButton, adderSheetButton]
|
||||||
collectionView.navigationItem.rightBarButtonItems = [shareButton, downloadButton]
|
collectionView.navigationItem.rightBarButtonItems = [shareButton, downloadButton]
|
||||||
|
|||||||