Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
ui: general to show info
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Jan 14, 2024
1 parent d43fb65 commit d0439e5
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions src/core/ui/screens/General.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,30 @@
import { settings as settingsDef } from "@index";
import { Tables } from "@metro/common";
import { resolveAssets } from "@utils/assets";

const { ScrollView } = ReactNative;
const { Stack, TableRow, TableSwitchRow, TableRowGroup } = Tables;
const { Stack, TableRow, TableRowGroup } = Tables;

const icons = resolveAssets({
StaffBadge: "ic_badge_staff",
Gift: "ic_gift_24px",
Idle: "StatusIdle"
});
import commitHash from "~commit-hash";

const ClientInfo = nativeModuleProxy.RTNClientInfoManager;

export default function General() {
const settings = settingsDef.useStorage();

return (
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 38 }}>
<Stack style={{ paddingVertical: 24, paddingHorizontal: 12 }} spacing={24}>
<TableRowGroup title="Settings">
<TableSwitchRow
label="Enable Discord's experiments menu"
subLabel="Enables the experiments menu in Discord's settings, which only staff has access to."
icon={<TableRow.Icon source={icons.StaffBadge} />}
value={settings.experiments}
onValueChange={(v: boolean) => settings.experiments = v}
/>
<TableSwitchRow
label="Hide gift button on chat input"
subLabel="Hides the gift button on the chat input."
icon={<TableRow.Icon source={icons.Gift} />}
value={settings.hideGiftButton}
onValueChange={(v: boolean) => settings.hideGiftButton = v}
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 16, alignItems: "center" }}>
<Stack>
<TableRowGroup>
<TableRow
label={"Pyoncord"}
trailing={<TableRow.TrailingText text={commitHash} />}
/>
<TableSwitchRow
label="Hide idle status"
subLabel="Hides the idling status when app is backgrounded."
icon={<TableRow.Icon source={icons.Idle} />}
value={settings.hideIdling}
onValueChange={(v: boolean) => settings.hideIdling = v}
<TableRow
label={"Discord"}
trailing={<TableRow.TrailingText text={`${ClientInfo.Version} (${ClientInfo.Build})`} />}
/>
</TableRowGroup>
</Stack>
</ScrollView>
</ScrollView >
);
}

0 comments on commit d0439e5

Please sign in to comment.