[UI] Open invite in modal (#28)
* [Metro > Common] Have url find openDeeplink * [Constants] Make invite a URL * [UI > General] Open invite modal
This commit is contained in:
parent
7d36903b2c
commit
6dff7f7119
3 changed files with 4 additions and 4 deletions
|
@ -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 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()@:%_\+.~#?&\/=]*)$/;
|
export const HTTP_REGEX = /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/;
|
|
@ -4,7 +4,7 @@ import { find, findByProps } from "@metro/filters";
|
||||||
export { constants } from "@metro/hoist";
|
export { constants } from "@metro/hoist";
|
||||||
export const channels = findByProps("getVoiceChannelId");
|
export const channels = findByProps("getVoiceChannelId");
|
||||||
export const i18n = findByProps("Messages");
|
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 toasts = find(m => m.open && m.close && !m.startDrag && !m.init && !m.openReplay && !m.setAlwaysOnTop);
|
||||||
export const stylesheet = findByProps("createThemedStyleSheet");
|
export const stylesheet = findByProps("createThemedStyleSheet");
|
||||||
export const clipboard = findByProps("setString", "getString", "hasString") as typeof import("@react-native-clipboard/clipboard").default;
|
export const clipboard = findByProps("setString", "getString", "hasString") as typeof import("@react-native-clipboard/clipboard").default;
|
||||||
|
|
|
@ -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 { getAssetIDByName } from "@ui/assets";
|
||||||
import { Forms, Summary } from "@ui/components";
|
import { Forms, Summary } from "@ui/components";
|
||||||
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
|
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
|
||||||
|
@ -88,7 +88,7 @@ export default function General() {
|
||||||
label="Discord Server"
|
label="Discord Server"
|
||||||
leading={<FormRow.Icon source={getAssetIDByName("Discord")} />}
|
leading={<FormRow.Icon source={getAssetIDByName("Discord")} />}
|
||||||
trailing={FormRow.Arrow}
|
trailing={FormRow.Arrow}
|
||||||
onPress={() => invites.acceptInviteAndTransitionToInviteChannel({ inviteKey: DISCORD_SERVER })}
|
onPress={() => url.openDeeplink(DISCORD_SERVER)}
|
||||||
/>
|
/>
|
||||||
<FormDivider />
|
<FormDivider />
|
||||||
<FormRow
|
<FormRow
|
||||||
|
|
Loading…
Reference in a new issue