diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/Contents.json b/Resources/Assets.xcassets/SlackGlyph.imageset/Contents.json
new file mode 100644
index 0000000..d1bb1fb
--- /dev/null
+++ b/Resources/Assets.xcassets/SlackGlyph.imageset/Contents.json
@@ -0,0 +1,56 @@
+{
+ "images" : [
+ {
+ "filename" : "SlackGlyph Light 3.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "filename" : "SlackGlyph.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "SlackGlyph Light 1.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "filename" : "SlackGlyph 1.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "SlackGlyph Light.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ },
+ {
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "filename" : "SlackGlyph 2.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 1.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 1.png
new file mode 100644
index 0000000..ddca45c
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 1.png differ
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 2.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 2.png
new file mode 100644
index 0000000..ddca45c
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph 2.png differ
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 1.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 1.png
new file mode 100644
index 0000000..be3e4d1
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 1.png differ
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 3.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 3.png
new file mode 100644
index 0000000..be3e4d1
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light 3.png differ
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light.png
new file mode 100644
index 0000000..be3e4d1
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph Light.png differ
diff --git a/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph.png b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph.png
new file mode 100644
index 0000000..ddca45c
Binary files /dev/null and b/Resources/Assets.xcassets/SlackGlyph.imageset/SlackGlyph.png differ
diff --git a/Resources/Assets.xcassets/thing.symbolset/Contents.json b/Resources/Assets.xcassets/thing.symbolset/Contents.json
new file mode 100644
index 0000000..3bb3f10
--- /dev/null
+++ b/Resources/Assets.xcassets/thing.symbolset/Contents.json
@@ -0,0 +1,12 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ },
+ "symbols" : [
+ {
+ "filename" : "square.and.arrow.up.svg",
+ "idiom" : "universal"
+ }
+ ]
+}
diff --git a/Resources/Assets.xcassets/thing.symbolset/square.and.arrow.up.svg b/Resources/Assets.xcassets/thing.symbolset/square.and.arrow.up.svg
new file mode 100644
index 0000000..fd118a9
--- /dev/null
+++ b/Resources/Assets.xcassets/thing.symbolset/square.and.arrow.up.svg
@@ -0,0 +1,115 @@
+
+
+
diff --git a/Resources/Icon.pxd b/Resources/Icon.pxd
index 34bb47d..86970d6 100644
Binary files a/Resources/Icon.pxd and b/Resources/Icon.pxd differ
diff --git a/Resources/SlackGlyph Light.png b/Resources/SlackGlyph Light.png
new file mode 100644
index 0000000..be3e4d1
Binary files /dev/null and b/Resources/SlackGlyph Light.png differ
diff --git a/Resources/SlackGlyph Light.pxd b/Resources/SlackGlyph Light.pxd
new file mode 100644
index 0000000..c0c0a5b
Binary files /dev/null and b/Resources/SlackGlyph Light.pxd differ
diff --git a/Resources/SlackGlyph.png b/Resources/SlackGlyph.png
new file mode 100644
index 0000000..ddca45c
Binary files /dev/null and b/Resources/SlackGlyph.png differ
diff --git a/Resources/SlackGlyph.pxd b/Resources/SlackGlyph.pxd
new file mode 100644
index 0000000..dbe27ae
Binary files /dev/null and b/Resources/SlackGlyph.pxd differ
diff --git a/Resources/square.and.arrow.up.pxd b/Resources/square.and.arrow.up.pxd
new file mode 100644
index 0000000..0e0dfc4
Binary files /dev/null and b/Resources/square.and.arrow.up.pxd differ
diff --git a/Resources/square.and.arrow.up.svg b/Resources/square.and.arrow.up.svg
new file mode 100644
index 0000000..fd118a9
--- /dev/null
+++ b/Resources/square.and.arrow.up.svg
@@ -0,0 +1,115 @@
+
+
+
diff --git a/StickerSlack/Gifs/GifHoarder.swift b/StickerSlack/Gifs/GifHoarder.swift
index ea10cdd..7a080c9 100644
--- a/StickerSlack/Gifs/GifHoarder.swift
+++ b/StickerSlack/Gifs/GifHoarder.swift
@@ -29,7 +29,7 @@ class GifHoarder: Hoarder, ObservableObject {
// <#code#>
}
- init() {
+ init(localOnly: Bool = false) {
var components = URLComponents(url: endpoint, resolvingAgainstBaseURL: false)
components?.queryItems = [
URLQueryItem(name: "api_key", value: GifHoarder.apiKey),
diff --git a/StickerSlack/SwiftUI/BrowseView.swift b/StickerSlack/SwiftUI/BrowseView.swift
index 0796e22..9dee48d 100644
--- a/StickerSlack/SwiftUI/BrowseView.swift
+++ b/StickerSlack/SwiftUI/BrowseView.swift
@@ -23,6 +23,7 @@ struct BrowseView: View {
case .slackEmoji:
ForEach(hoarder.emojis, id: \.self) { emoji in
EmojiRow(hoarder: hoarder, emoji: emoji)
+ .listRowSeparator(.hidden)
}
case .giphyGifs:
Text("hi")
diff --git a/StickerSlack/SwiftUI/Emoji/EmojiRow.swift b/StickerSlack/SwiftUI/Emoji/EmojiRow.swift
index 8f2f829..c5a9795 100644
--- a/StickerSlack/SwiftUI/Emoji/EmojiRow.swift
+++ b/StickerSlack/SwiftUI/Emoji/EmojiRow.swift
@@ -11,6 +11,7 @@ import Haptics
struct EmojiRow: View {
@ObservedObject var hoarder: EmojiHoarder
@State var emoji: Emoji
+ @State var showTooltip: Bool = false
var isLocal: Bool {
return hoarder.downloadedEmojis.contains(emoji.name)
@@ -21,30 +22,45 @@ struct EmojiRow: View {
EmojiPreview(hoarder: hoarder, emoji: emoji)
.frame(width: 100, height: 100)
- VStack(alignment: .leading, spacing: 5) {
- ZStack {
- RoundedRectangle(cornerRadius: 5)
- .foregroundStyle(.gray.opacity(0.1))
- .shadow(radius: 2)
- Text(emoji.name)
- .font(.caption)
- .bold(isLocal)
- .foregroundColor(isLocal ? .green : .primary)
- .padding(3)
- .lineLimit(nil)
- .layoutPriority(1)
- .multilineTextAlignment(.leading)
- }
- if isLocal {
- Image(systemName: "arrow.down.circle.fill")
- .resizable().scaledToFit()
- .frame(width: 20, height: 20)
- .symbolRenderingMode(.hierarchical)
- .foregroundStyle(.gray)
- .transition(.scale)
+ let alignment: HorizontalAlignment = emoji.name.count < 7 ? .center : .leading
+ VStack(alignment: alignment, spacing: 5) {
+ Text(emoji.name)
+ .font(.caption)
+ .bold(isLocal)
+ .foregroundColor(isLocal ? .green : .primary)
+ .lineLimit(nil)
+ .layoutPriority(1)
+ .multilineTextAlignment(.leading)
+ .fixedSize()
+ HStack(spacing: 5) {
+ Button() {
+ showTooltip.toggle()
+ } label: {
+ Image("thing")
+ .resizable().scaledToFit()
+ .frame(width: 20, height: 20)
+ .foregroundStyle(.gray)
+ }
+ .buttonStyle(.borderless)
+ .alert("From Slack", isPresented: $showTooltip) {
+ Button("OK") {}
+ }
+ if isLocal {
+ Image(systemName: "arrow.down.circle.fill")
+ .resizable().scaledToFit()
+ .frame(width: 20, height: 20)
+ .symbolRenderingMode(.hierarchical)
+ .foregroundStyle(.gray)
+ .transition(.scale)
+ }
}
}
- .padding(.horizontal, 5)
+ .padding(5)
+ .background(
+ RoundedRectangle(cornerRadius: 15)
+ .foregroundStyle(.gray.opacity(0.1))
+ .shadow(radius: 2)
+ )
Spacer()
@@ -75,8 +91,18 @@ struct EmojiRow: View {
List {
EmojiRow(hoarder: hoarder, emoji: .test)
EmojiRow(hoarder: hoarder, emoji: .testLongName)
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "a", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "ab", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abc", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcd", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcde", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdef", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdefg", url: Emoji.test.remoteImageURL))
+ EmojiRow(hoarder: hoarder, emoji: Emoji(name: "abcdefgh", url: Emoji.test.remoteImageURL))
ForEach(hoarder.downloadedEmojisArr, id: \.self) { name in
- EmojiRow(hoarder: hoarder, emoji: hoarder.trie.dict[name]!)
+ if let emoji = hoarder.trie.dict[name] {
+ EmojiRow(hoarder: hoarder, emoji: emoji)
+ }
}
}
}