From 6dff7f71193d4fb4924766983d52c21bb3291b94 Mon Sep 17 00:00:00 2001
From: Jack <30497388+FieryFlames@users.noreply.github.com>
Date: Sat, 4 Mar 2023 16:32:30 -0500
Subject: [PATCH] [UI] Open invite in modal (#28)
* [Metro > Common] Have url find openDeeplink
* [Constants] Make invite a URL
* [UI > General] Open invite modal
---
src/lib/constants.ts | 2 +-
src/lib/metro/common.ts | 2 +-
src/ui/settings/pages/General.tsx | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index a35589e..2fca598 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -1,3 +1,3 @@
-export const DISCORD_SERVER = "n9QQ4XhhJP";
+export const DISCORD_SERVER = "https://discord.gg/n9QQ4XhhJP";
export const GITHUB = "https://github.com/vendetta-mod";
export const HTTP_REGEX = /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/;
\ No newline at end of file
diff --git a/src/lib/metro/common.ts b/src/lib/metro/common.ts
index bb701f0..20eb0d2 100644
--- a/src/lib/metro/common.ts
+++ b/src/lib/metro/common.ts
@@ -4,7 +4,7 @@ import { find, findByProps } from "@metro/filters";
export { constants } from "@metro/hoist";
export const channels = findByProps("getVoiceChannelId");
export const i18n = findByProps("Messages");
-export const url = findByProps("openURL");
+export const url = findByProps("openDeeplink");
export const toasts = find(m => m.open && m.close && !m.startDrag && !m.init && !m.openReplay && !m.setAlwaysOnTop);
export const stylesheet = findByProps("createThemedStyleSheet");
export const clipboard = findByProps("setString", "getString", "hasString") as typeof import("@react-native-clipboard/clipboard").default;
diff --git a/src/ui/settings/pages/General.tsx b/src/ui/settings/pages/General.tsx
index a6b19bd..400f481 100644
--- a/src/ui/settings/pages/General.tsx
+++ b/src/ui/settings/pages/General.tsx
@@ -1,4 +1,4 @@
-import { ReactNative as RN, url, invites } from "@metro/common";
+import { ReactNative as RN, url } from "@metro/common";
import { getAssetIDByName } from "@ui/assets";
import { Forms, Summary } from "@ui/components";
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
@@ -88,7 +88,7 @@ export default function General() {
label="Discord Server"
leading={}
trailing={FormRow.Arrow}
- onPress={() => invites.acceptInviteAndTransitionToInviteChannel({ inviteKey: DISCORD_SERVER })}
+ onPress={() => url.openDeeplink(DISCORD_SERVER)}
/>