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..5eb47ba 100644 --- a/src/core/ui/settings/pages/Themes/index.tsx +++ b/src/core/ui/settings/pages/Themes/index.tsx @@ -30,7 +30,7 @@ import { IconButton, Stack, TableRowGroup, - TableSwitchRow, + TableCheckboxRow, TableRowIcon, Text, AlertModal, @@ -677,12 +677,67 @@ export default function Themes() { ); } - return ( - + + + {/* Changed from TableRadioGroup to individual TableSwitchRow components + for better UX - users can now toggle options individually */} + + } + checked={!colorsPref.type} + onPress={() => { + if (!colorsPref.type) { + colorsPref.type = "dark"; + } + getCurrentTheme()?.data && + updateBunnyColor(getCurrentTheme()!.data!, { + update: true, + }); + }} + /> + } + checked={colorsPref.type === "dark"} + onPress={() => { + colorsPref.type = colorsPref.type === "dark" ? undefined : "dark"; + getCurrentTheme()?.data && + updateBunnyColor(getCurrentTheme()!.data!, { + update: true, + }); + }} + /> + } + checked={colorsPref.type === "light"} + onPress={() => { + colorsPref.type = colorsPref.type === "light" ? undefined : "light"; + getCurrentTheme()?.data && + updateBunnyColor(getCurrentTheme()!.data!, { + update: true, + }); + }} + /> + + + } + checked={!colorsPref.customBackground} + onPress={() => { + colorsPref.customBackground = !colorsPref.customBackground ? "hidden" : null; + }} + /> + + + + ); + }} /> ); } diff --git a/src/core/ui/settings/pages/Themes/sheets/ThemeInfoActionSheet.tsx b/src/core/ui/settings/pages/Themes/sheets/ThemeInfoActionSheet.tsx index 3a7c147..2c61a0c 100644 --- a/src/core/ui/settings/pages/Themes/sheets/ThemeInfoActionSheet.tsx +++ b/src/core/ui/settings/pages/Themes/sheets/ThemeInfoActionSheet.tsx @@ -7,12 +7,7 @@ import React, { ComponentProps, useEffect, useState } from "react"; import { ScrollView, View, TouchableOpacity } from "react-native"; import { showToast } from "@ui/toasts"; import { showConfirmationAlert } from "@core/vendetta/alerts"; -import { - fetchTheme, - removeTheme, - selectTheme, - VdThemeInfo, -} from "@lib/addons/themes"; +import { fetchTheme, removeTheme, selectTheme, VdThemeInfo, } from "@lib/addons/themes"; import { formatString, Strings } from "@core/i18n"; import { semanticColors } from "@ui/color"; @@ -31,7 +26,7 @@ function ThemeInfoIconButton(props: ComponentProps) { 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, }} > -