[UI > Settings] Use Summary component
This commit is contained in:
parent
23e00b6237
commit
67b501b974
2 changed files with 26 additions and 23 deletions
|
@ -1,5 +0,0 @@
|
||||||
import { findByDisplayName, findByProps } from "@metro/filters";
|
|
||||||
|
|
||||||
export const Forms = findByProps("Form", "FormSection");
|
|
||||||
export const General = findByProps("Button", "Text", "View");
|
|
||||||
export const Search = findByDisplayName("StaticSearchBarContainer");
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ReactNative as RN, url, invites } from "@metro/common";
|
import { ReactNative as RN, url, invites } from "@metro/common";
|
||||||
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
|
import { DISCORD_SERVER, GITHUB } from "@lib/constants";
|
||||||
import { getAssetIDByName } from "@ui/assets";
|
import { getAssetIDByName } from "@ui/assets";
|
||||||
import { Forms } from "@ui/components";
|
import { Forms, Summary } from "@ui/components";
|
||||||
import { getDebugInfo } from "@lib/debug";
|
import { getDebugInfo } from "@lib/debug";
|
||||||
import { useProxy } from "@lib/storage";
|
import { useProxy } from "@lib/storage";
|
||||||
import settings from "@lib/settings";
|
import settings from "@lib/settings";
|
||||||
|
@ -17,7 +17,7 @@ export default function General() {
|
||||||
{
|
{
|
||||||
label: "Vendetta",
|
label: "Vendetta",
|
||||||
version: debugInfo.vendetta.version,
|
version: debugInfo.vendetta.version,
|
||||||
icon: "ic_progress_wrench_24px"
|
icon: "ic_progress_wrench_24px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Discord",
|
label: "Discord",
|
||||||
|
@ -42,6 +42,11 @@ export default function General() {
|
||||||
];
|
];
|
||||||
|
|
||||||
const platformInfo = [
|
const platformInfo = [
|
||||||
|
{
|
||||||
|
label: "Loader",
|
||||||
|
version: debugInfo.vendetta.loader,
|
||||||
|
icon: "ic_download_24px",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "Operating System",
|
label: "Operating System",
|
||||||
version: `${debugInfo.os.name} ${debugInfo.os.version}`,
|
version: `${debugInfo.os.name} ${debugInfo.os.version}`,
|
||||||
|
@ -91,22 +96,6 @@ export default function General() {
|
||||||
onPress={() => url.openURL(GITHUB)}
|
onPress={() => url.openURL(GITHUB)}
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection title="Versions">
|
|
||||||
{versions.map((v, i) => (
|
|
||||||
<>
|
|
||||||
<Version label={v.label} version={v.version} icon={v.icon} />
|
|
||||||
{i !== versions.length - 1 && <FormDivider />}
|
|
||||||
</>
|
|
||||||
))}
|
|
||||||
</FormSection>
|
|
||||||
<FormSection title="Platform Info">
|
|
||||||
{platformInfo.map((p, i) => (
|
|
||||||
<>
|
|
||||||
<Version label={p.label} version={p.version} icon={p.icon} />
|
|
||||||
{i !== platformInfo.length - 1 && <FormDivider />}
|
|
||||||
</>
|
|
||||||
))}
|
|
||||||
</FormSection>
|
|
||||||
<FormSection title="Actions">
|
<FormSection title="Actions">
|
||||||
<FormRow
|
<FormRow
|
||||||
label="Reload Discord"
|
label="Reload Discord"
|
||||||
|
@ -123,6 +112,25 @@ export default function General() {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
<FormSection title="Info">
|
||||||
|
<Summary label="Versions" icon="ic_information_filled_24px">
|
||||||
|
{versions.map((v, i) => (
|
||||||
|
<>
|
||||||
|
<Version label={v.label} version={v.version} icon={v.icon} />
|
||||||
|
{i !== versions.length - 1 && <FormDivider />}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</Summary>
|
||||||
|
<FormDivider />
|
||||||
|
<Summary label="Platform" icon="ic_mobile_device">
|
||||||
|
{platformInfo.map((p, i) => (
|
||||||
|
<>
|
||||||
|
<Version label={p.label} version={p.version} icon={p.icon} />
|
||||||
|
{i !== platformInfo.length - 1 && <FormDivider />}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</Summary>
|
||||||
|
</FormSection>
|
||||||
</RN.ScrollView>
|
</RN.ScrollView>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
Reference in a new issue