diff --git a/src/core/ui/components/Card.tsx b/src/core/ui/components/Card.tsx index b19e8fd..cd9b7a7 100644 --- a/src/core/ui/components/Card.tsx +++ b/src/core/ui/components/Card.tsx @@ -1,5 +1,4 @@ import { getAssetIDByName } from "@lib/api/assets"; -import { settings } from "@lib/settings"; import { FormRow } from "@lib/ui/components/discord/Forms"; import { FormCheckbox, FormSwitch, IconButton } from "@lib/ui/components/discord/Redesign"; import { createStyles, TextStyleSheet } from "@lib/ui/styles"; @@ -12,7 +11,7 @@ const { hideActionSheet } = findByProps("openLazy", "hideActionSheet"); const { showSimpleActionSheet } = findByProps("showSimpleActionSheet"); // TODO: These styles work weirdly. iOS has cramped text, Android with low DPI probably does too. Fix? -const useStyles = createStyles(() => ({ +const useStyles = createStyles({ card: { backgroundColor: semanticColors?.CARD_SECONDARY_BG, borderRadius: 12, @@ -58,7 +57,7 @@ const useStyles = createStyles(() => ({ right: "30%", top: "-10%" } -})); +}); interface Action { icon: string; @@ -90,8 +89,6 @@ interface CardProps { overflowActions?: OverflowAction[]; } -const reverseIfNeeded = (arr: any[]) => settings.__unfunnyJoke24 !== false ? arr.reverse() : arr; - export default function Card(props: CardProps) { const styles = useStyles(); @@ -102,70 +99,66 @@ export default function Card(props: CardProps) { resizeMode="cover" imageStyle={styles.iconStyle} > - { - reverseIfNeeded([ - - {props.headerLabel} - {props.headerSublabel && ( - {props.headerSublabel} - )} - - } - trailing={ - - - {props.overflowActions && - showSimpleActionSheet({ - key: "CardOverflow", - header: { - title: props.overflowTitle, - icon: props.headerIcon && , - onClose: () => hideActionSheet(), - }, - options: props.overflowActions?.map(i => ({ ...i, icon: getAssetIDByName(i.icon) })), - })} - size="sm" - variant="secondary" - icon={getAssetIDByName("CircleInformationIcon")} - />} - {props.actions?.map(({ icon, onPress, disabled }) => ( - - ))} - - {props.toggleType && (props.toggleType === "switch" ? - - : - { - props.onToggleChange?.(!props.toggleValue); - }}> - - - )} - - } - />, - - {props.descriptionLabel} - - } - />, - ]) - } + + {props.headerLabel} + {props.headerSublabel && ( + {props.headerSublabel} + )} + + } + trailing={ + + + {props.overflowActions && + showSimpleActionSheet({ + key: "CardOverflow", + header: { + title: props.overflowTitle, + icon: props.headerIcon && , + onClose: () => hideActionSheet(), + }, + options: props.overflowActions?.map(i => ({ ...i, icon: getAssetIDByName(i.icon) })), + })} + size="sm" + variant="secondary" + icon={getAssetIDByName("CircleInformationIcon")} + />} + {props.actions?.map(({ icon, onPress, disabled }) => ( + + ))} + + {props.toggleType && (props.toggleType === "switch" ? + + : + { + props.onToggleChange?.(!props.toggleValue); + }}> + + + )} + + } + /> + + {props.descriptionLabel} + + } + /> ); diff --git a/src/core/ui/settings/pages/General.tsx b/src/core/ui/settings/pages/General.tsx index 5b7ae3e..0972ef7 100644 --- a/src/core/ui/settings/pages/General.tsx +++ b/src/core/ui/settings/pages/General.tsx @@ -63,17 +63,6 @@ export default function General() { onPress={() => url.openURL(GITHUB)} /> - - } - value={settings.__unfunnyJoke24 !== false} - onValueChange={(v: boolean) => { - settings.__unfunnyJoke24 = v; - }} - /> - find(m => m[prop] && Object.keys(m).length === 1)?.[prop]; @@ -15,20 +14,6 @@ export const FormSwitch = findSingular("FormSwitch"); export const FormRadio = findSingular("FormRadio"); export const FormCheckbox = findSingular("FormCheckbox"); -export function TableRowGroup(...args: any[]) { - if (settings.__unfunnyJoke24 !== false && Array.isArray(args[0]?.children)) { - args[0].children = args[0].children.reverse(); - } - return Redesign.TableRowGroup(...args); -} - -export function Stack(...args: any[]) { - if (settings.__unfunnyJoke24 !== false && Array.isArray(args[0]?.children)) { - args[0].children = args[0].children.reverse(); - } - return Redesign.Stack(...args); -} - export const { AlertActionButton, AlertModal, @@ -75,7 +60,7 @@ export const { SegmentedControl, SegmentedControlPages, Slider, - // Stack, + Stack, StepModal, StickyContext, StickyHeader, @@ -84,7 +69,7 @@ export const { TableRadioGroup, TableRadioRow, TableRow, - // TableRowGroup, + TableRowGroup, TableRowGroupTitle, TableRowIcon, TableSwitchRow, diff --git a/src/lib/ui/settings/patches/tabs.tsx b/src/lib/ui/settings/patches/tabs.tsx index 09e6789..9af415a 100644 --- a/src/lib/ui/settings/patches/tabs.tsx +++ b/src/lib/ui/settings/patches/tabs.tsx @@ -1,6 +1,5 @@ import { findByName, findByProps } from "@lib/metro"; import { i18n } from "@lib/metro/common"; -import { settings } from "@lib/settings"; import { registeredSections } from "@lib/ui/settings"; import { findInReactTree } from "@lib/utils"; import { after } from "spitroast"; @@ -58,12 +57,10 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) { const { sections } = findInReactTree(ret, i => i.props?.sections).props; let index = -~sections.findIndex((i: any) => i.label === i18n.Messages.ACCOUNT_SETTINGS) || 1; - const reverseIfNeeded = (arr: any[]) => settings.__unfunnyJoke24 !== false ? arr.reverse() : arr; - Object.keys(registeredSections).forEach(sect => { sections.splice(index++, 0, { label: sect, - settings: reverseIfNeeded(registeredSections[sect].map(a => a.key)) + settings: registeredSections[sect].map(a => a.key) }); }); }));