Skip to content

Commit

Permalink
feat(ui): update icons in About page
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Dec 26, 2024
1 parent 0817e53 commit ad9e05c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
23 changes: 12 additions & 11 deletions src/core/ui/settings/pages/General/About.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Strings } from "@core/i18n";
import { PyoncordIcon } from "@core/ui/settings";
import Version from "@core/ui/settings/pages/General/Version";
import { useProxy } from "@core/vendetta/storage";
import { getDebugInfo } from "@lib/api/debug";
Expand All @@ -14,7 +15,7 @@ export default function About() {
{
label: Strings.BUNNY,
version: debugInfo.bunny.version,
icon: "ic_progress_wrench_24px",
icon: { uri: PyoncordIcon },
},
{
label: "Discord",
Expand All @@ -24,55 +25,55 @@ export default function About() {
{
label: "React",
version: debugInfo.react.version,
icon: "ic_category_16px",
icon: "ScienceIcon",
},
{
label: "React Native",
version: debugInfo.react.nativeVersion,
icon: "mobile",
icon: "MobilePhoneIcon",
},
{
label: Strings.BYTECODE,
version: debugInfo.hermes.bytecodeVersion,
icon: "ic_server_security_24px",
icon: "TopicsIcon",
},
];

const platformInfo = [
{
label: Strings.LOADER,
version: `${debugInfo.bunny.loader.name} (${debugInfo.bunny.loader.version})`,
icon: "ic_download_24px",
icon: "DownloadIcon",
},
{
label: Strings.OPERATING_SYSTEM,
version: `${debugInfo.os.name} ${debugInfo.os.version}`,
icon: "ic_cog_24px"
icon: "ScreenIcon"
},
...(debugInfo.os.sdk ? [{
label: "SDK",
version: debugInfo.os.sdk,
icon: "pencil"
icon: "StaffBadgeIcon"
}] : []),
{
label: Strings.MANUFACTURER,
version: debugInfo.device.manufacturer,
icon: "ic_badge_staff"
icon: "WrenchIcon"
},
{
label: Strings.BRAND,
version: debugInfo.device.brand,
icon: "ic_settings_boost_24px"
icon: "SparklesIcon"
},
{
label: Strings.MODEL,
version: debugInfo.device.model,
icon: "ic_phonelink_24px"
icon: "MobilePhoneIcon"
},
{
label: Platform.select({ android: Strings.CODENAME, ios: Strings.MACHINE_ID })!,
version: debugInfo.device.codename,
icon: "ic_compose_24px"
icon: "TagIcon"
}
];

Expand Down
5 changes: 3 additions & 2 deletions src/core/ui/settings/pages/General/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import { findAssetId } from "@lib/api/assets";
import { clipboard } from "@metro/common";
import { LegacyFormText, TableRow } from "@metro/common/components";
import { showToast } from "@ui/toasts";
import { ImageURISource } from "react-native";

interface VersionProps {
label: string;
version: string;
icon: string;
icon: string | ImageURISource;
}

export default function Version({ label, version, icon }: VersionProps) {
return (
<TableRow
label={label}
icon={<TableRow.Icon source={findAssetId(icon)} />}
icon={<TableRow.Icon source={typeof icon === "string" ? findAssetId(icon) : icon} />}
trailing={<LegacyFormText>{version}</LegacyFormText>}
onPress={() => {
clipboard.setString(`${label} - ${version}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ export default function PluginInfoActionSheet({ plugin, navigation }: PluginInfo
/>
<ActionSheetRow
label={Strings.COPY_URL}
icon={<TableRow.Icon source={findAssetId("copy")} />}
icon={<TableRow.Icon source={findAssetId("LinkIcon")} />}
onPress={() => {
clipboard.setString(plugin.id);
showToast.showCopyToClipboard();
}}
/>
<ActionSheetRow
label={vdPlugin.update ? Strings.DISABLE_UPDATES : Strings.ENABLE_UPDATES}
icon={<TableRow.Icon source={findAssetId("ic_download_24px")} />}
icon={<TableRow.Icon source={findAssetId("DownloadIcon")} />}
onPress={() => {
vdPlugin.update = !vdPlugin.update;
showToast(formatString("TOASTS_PLUGIN_UPDATE", {
Expand All @@ -78,7 +78,8 @@ export default function PluginInfoActionSheet({ plugin, navigation }: PluginInfo
/>
<ActionSheetRow
label={Strings.CLEAR_DATA}
icon={<TableRow.Icon source={findAssetId("ic_duplicate")} />}
icon={<TableRow.Icon variant="danger" source={findAssetId("CopyIcon")} />}
variant="danger"
onPress={() => showConfirmationAlert({
title: Strings.HOLD_UP,
content: formatString("ARE_YOU_SURE_TO_CLEAR_DATA", { name: plugin.name }),
Expand Down Expand Up @@ -115,7 +116,8 @@ export default function PluginInfoActionSheet({ plugin, navigation }: PluginInfo
/>
<ActionSheetRow
label={Strings.DELETE}
icon={<TableRow.Icon source={findAssetId("ic_message_delete")} />}
icon={<TableRow.Icon variant="danger" source={findAssetId("TrashIcon")} />}
variant="danger"
onPress={() => showConfirmationAlert({
title: Strings.HOLD_UP,
content: formatString("ARE_YOU_SURE_TO_DELETE_PLUGIN", { name: plugin.name }),
Expand Down

0 comments on commit ad9e05c

Please sign in to comment.