[Cleanup] Small tidying
This commit is contained in:
parent
1679b51889
commit
b4f5bdc996
6 changed files with 17 additions and 10 deletions
|
@ -5,6 +5,7 @@ import * as common from "@metro/common";
|
|||
import initSettings from "./ui/settings";
|
||||
|
||||
console.log("Hello from Vendetta!");
|
||||
let erroredOnLoad = false;
|
||||
|
||||
try {
|
||||
initSettings();
|
||||
|
@ -14,8 +15,9 @@ try {
|
|||
metro: { ...metro, common: common },
|
||||
logger: logger,
|
||||
};
|
||||
|
||||
logger.log("Vendetta is ready!");
|
||||
} catch (e: Error | any) {
|
||||
erroredOnLoad = true;
|
||||
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!erroredOnLoad) logger.log("Vendetta is ready!");
|
4
src/ui/components.ts
Normal file
4
src/ui/components.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { findByProps } from "@metro/filters";
|
||||
|
||||
// TODO: Type individual props
|
||||
export const Forms = findByProps("FormSection");
|
|
@ -1,8 +1,8 @@
|
|||
import { React, ReactNative as RN } from "@metro/common";
|
||||
import { findByProps } from "@metro/filters";
|
||||
import { Forms } from "@ui/components";
|
||||
import Version from "./Version";
|
||||
|
||||
const { FormRow, FormSection, FormText } = findByProps("FormSection");
|
||||
const { FormRow, FormSection } = Forms;
|
||||
const hermesProps = window.HermesInternal.getRuntimeProperties();
|
||||
const rnVer = RN.Platform.constants.reactNativeVersion;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { React } from "@metro/common";
|
||||
import { findByProps } from "@metro/filters";
|
||||
import { Forms } from "@ui/components";
|
||||
|
||||
const { FormRow, FormSection } = findByProps("FormSection");
|
||||
const { FormRow, FormSection } = Forms;
|
||||
|
||||
interface SettingsSectionProps {
|
||||
navigation: any;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { React } from "@metro/common";
|
||||
import { findByProps } from "@metro/filters";
|
||||
import { Forms } from "@ui/components";
|
||||
|
||||
interface VersionProps {
|
||||
label: string;
|
||||
version: string
|
||||
}
|
||||
|
||||
const { FormRow, FormText } = findByProps("FormSection");
|
||||
const { FormRow, FormText } = Forms;
|
||||
|
||||
export default function Version({ label, version }: VersionProps) {
|
||||
return (
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
"@types": ["src/def.d.ts"],
|
||||
"@lib/*": ["src/lib/*"],
|
||||
"@metro/*": ["src/lib/metro/*"],
|
||||
"@utils/*": ["src/lib/utils/*"]
|
||||
"@utils/*": ["src/lib/utils/*"],
|
||||
"@ui/*": ["src/ui/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue