Skip to content

Commit

Permalink
findByName-ification
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryFlames committed Mar 27, 2023
1 parent 7c35590 commit dbae901
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/patches/MessageLongPressActionSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { findByDisplayName, findByProps } from "@vendetta/metro";
import { findByProps } from "@vendetta/metro";
import { React } from "@vendetta/metro/common";
import { after, before } from "@vendetta/patcher";
import { storage } from "@vendetta/plugin";
import { getAssetIDByName } from "@vendetta/ui/assets";
Expand All @@ -8,8 +9,7 @@ import { showToast } from "@vendetta/ui/toasts";
const LazyActionSheet = findByProps("openLazy", "hideActionSheet");

// Components
const { FormRow } = Forms;
const Icon = findByDisplayName("Icon");
const { FormRow: { default: FormRow, Icon } } = Forms;

const JSON_CODEBLOCK_PATTERN = /^```(?:json)\n([\s\S]*?)```$/gm

Expand Down
5 changes: 2 additions & 3 deletions src/ui/components/AddRuleButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { General } from "@vendetta/ui/components";
import { Forms, General } from "@vendetta/ui/components";
import { getAssetIDByName } from "@vendetta/ui/assets";
import { findByDisplayName } from "@vendetta/metro";

// Components
const { TouchableOpacity } = General;
const Icon = findByDisplayName("Icon");
const { FormRow: { Icon } } = Forms;

const Add = getAssetIDByName("ic_add_24px");

Expand Down
4 changes: 2 additions & 2 deletions src/ui/pages/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { findByDisplayName, findByProps } from "@vendetta/metro";
import { findByName } from "@vendetta/metro";
import { constants as Constants, NavigationNative, React, stylesheet as StyleSheet } from "@vendetta/metro/common";
import { storage } from "@vendetta/plugin";
import { useProxy } from "@vendetta/storage";
Expand All @@ -24,7 +24,7 @@ const styles = StyleSheet.createThemedStyleSheet({
}
})

const useIsFocused = findByDisplayName("useIsFocused");
const useIsFocused = findByName("useIsFocused");

export default function Settings() {
const [newRule, setNewRule] = React.useState("")
Expand Down

0 comments on commit dbae901

Please sign in to comment.