From 3c274bba14451282f390bf2bbd7fdc0ed3c7f9cd Mon Sep 17 00:00:00 2001 From: Diogo Date: Thu, 12 Dec 2024 16:13:59 +0000 Subject: [PATCH] worst emoji picker ever --- .../Views/ChatList/ChatListNavLink.swift | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift index 1e13242f1c..846936c204 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift @@ -681,8 +681,16 @@ struct CreateChatListTag: View { var body: some View { List { HStack { - Button { - emoji = "🚀" + Menu { + let emojis = allEmojis() + ForEach(emojis, id: \.self) { emj in + Button(action: { + emoji = emj + }) { + Text(emj) + .font(.largeTitle) + } + } } label: { if emoji.isEmpty { Image(systemName: "face.smiling") @@ -736,6 +744,16 @@ struct CreateChatListTag: View { } } } + + func allEmojis() -> [String] { + var emojis: [String] = [] + for scalar in (0x1F300...0x1FAFF) { + if let unicodeScalar = UnicodeScalar(scalar), unicodeScalar.properties.isEmoji { + emojis.append(String(unicodeScalar)) + } + } + return emojis + } } func rejectContactRequestAlert(_ contactRequest: UserContactRequest) -> Alert {