diff --git a/src/core/ui/settings/pages/Themes/ThemeCard.tsx b/src/core/ui/settings/pages/Themes/ThemeCard.tsx index d5b5406..c3fb5db 100644 --- a/src/core/ui/settings/pages/Themes/ThemeCard.tsx +++ b/src/core/ui/settings/pages/Themes/ThemeCard.tsx @@ -1,4 +1,3 @@ -import { Strings } from "@core/i18n"; import AddonCard, { CardWrapper } from "@core/ui/components/AddonCard"; import { VdThemeInfo, themes, selectTheme } from "@lib/addons/themes"; import { findAssetId } from "@lib/api/assets"; @@ -36,8 +35,6 @@ export default function ThemeCard({ item: theme }: CardWrapper) { { icon: "CircleInformationIcon-primary", onPress: () => { - // Using dynamic import directly (without wrapping in function) - // This returns a Promise that resolves to the module const importPromise = import("./sheets/ThemeInfoActionSheet"); showSheet("ThemeInfoActionSheet", importPromise, { theme, diff --git a/src/core/ui/settings/pages/Themes/index.tsx b/src/core/ui/settings/pages/Themes/index.tsx index e4dca26..9af6fed 100644 --- a/src/core/ui/settings/pages/Themes/index.tsx +++ b/src/core/ui/settings/pages/Themes/index.tsx @@ -17,7 +17,6 @@ import { settings } from "@lib/api/settings"; import { useObservable } from "@lib/api/storage"; import { lazyDestructure } from "@lib/utils/lazy"; import safeFetch from "@lib/utils/safeFetch"; -import Search from "@ui/components/Search"; import { findByProps } from "@metro"; import { NavigationNative, React, clipboard } from "@metro/common"; import { showSheet } from "@lib/ui/sheets"; @@ -26,16 +25,12 @@ import { BottomSheetTitleHeader, Button, Card, - FlashList, IconButton, Stack, TableRowGroup, - TableSwitchRow, + TableCheckboxRow, TableRowIcon, Text, - AlertModal, - AlertActions, - AlertActionButton, } from "@metro/common/components"; import { View, Image } from "react-native"; @@ -296,9 +291,7 @@ function BrowserThemeCard({ loading={isInstalling} icon={ isInstalling ? ( - + + {/* Changed from TableRadioGroup to individual TableSwitchRow components + for better UX - users can now toggle options individually */} - } - value={!colorsPref.type} - onValueChange={(enabled: boolean) => { - if (enabled) { - colorsPref.type = undefined; - } else { + checked={!colorsPref.type} + onPress={() => { + if (!colorsPref.type) { colorsPref.type = "dark"; } getCurrentTheme()?.data && @@ -427,28 +420,24 @@ export default function Themes() { }); }} /> - - } - value={colorsPref.type === "dark"} - onValueChange={(enabled: boolean) => { - colorsPref.type = enabled ? "dark" : undefined; + icon={} + checked={colorsPref.type === "dark"} + onPress={() => { + colorsPref.type = colorsPref.type === "dark" ? undefined : "dark"; getCurrentTheme()?.data && updateBunnyColor(getCurrentTheme()!.data!, { update: true, }); }} /> - - } - value={colorsPref.type === "light"} - onValueChange={(enabled: boolean) => { - colorsPref.type = enabled ? "light" : undefined; + icon={} + checked={colorsPref.type === "light"} + onPress={() => { + colorsPref.type = colorsPref.type === "light" ? undefined : "light"; getCurrentTheme()?.data && updateBunnyColor(getCurrentTheme()!.data!, { update: true, @@ -457,20 +446,13 @@ export default function Themes() { /> - } - value={!colorsPref.customBackground} - onValueChange={(enabled: boolean) => { - colorsPref.customBackground = enabled ? null : "hidden"; - }} - /> - } - value={colorsPref.customBackground === "hidden"} - onValueChange={(enabled: boolean) => { - colorsPref.customBackground = enabled ? "hidden" : null; + checked={!colorsPref.customBackground} + onPress={() => { + colorsPref.customBackground = !colorsPref.customBackground ? "hidden" : null; }} /> @@ -479,7 +461,7 @@ export default function Themes() { ); }) } - />, + /> ); navigation.setOptions({ @@ -677,6 +659,7 @@ export default function Themes() { ); } + // Normal browse listing return ( ) { return ; } -// Theme title component for header +// theme title component for header function TitleComponent({ theme }: { theme: VdThemeInfo }) { const { authors } = theme.data; @@ -68,11 +63,11 @@ export default function ThemeInfoActionSheet({ theme, navigation, }: ThemeInfoActionSheetProps) { - // Use component state to track theme data + // use component state to track theme data const [themeState, setThemeState] = useState({ ...theme }); const [loading, setLoading] = useState(false); - // Periodic refresh to detect external changes to theme state + // periodic refresh to detect external changes to theme state useEffect(() => { const interval = setInterval(() => { setThemeState({ ...theme }); @@ -159,31 +154,25 @@ export default function ThemeInfoActionSheet({ justifyContent: "center", alignItems: "center", flexWrap: "wrap", - gap: 16, - paddingHorizontal: 4, + gap: 65, + paddingHorizontal: 8, }} > -