Fix: failed merge

This commit is contained in:
kmmiio99o 2026-01-16 22:14:58 +01:00
parent 9b2a7ab0ba
commit bbc3b9bcb7
No known key found for this signature in database
GPG key ID: 163FE39F7772D2EC

View file

@ -17,7 +17,6 @@ import { settings } from "@lib/api/settings";
import { useObservable } from "@lib/api/storage"; import { useObservable } from "@lib/api/storage";
import { lazyDestructure } from "@lib/utils/lazy"; import { lazyDestructure } from "@lib/utils/lazy";
import safeFetch from "@lib/utils/safeFetch"; import safeFetch from "@lib/utils/safeFetch";
import Search from "@ui/components/Search";
import { findByProps } from "@metro"; import { findByProps } from "@metro";
import { NavigationNative, React, clipboard } from "@metro/common"; import { NavigationNative, React, clipboard } from "@metro/common";
import { showSheet } from "@lib/ui/sheets"; import { showSheet } from "@lib/ui/sheets";
@ -26,16 +25,12 @@ import {
BottomSheetTitleHeader, BottomSheetTitleHeader,
Button, Button,
Card, Card,
FlashList,
IconButton, IconButton,
Stack, Stack,
TableRowGroup, TableRowGroup,
TableCheckboxRow, TableCheckboxRow,
TableRowIcon, TableRowIcon,
Text, Text,
AlertModal,
AlertActions,
AlertActionButton,
} from "@metro/common/components"; } from "@metro/common/components";
import { View, Image } from "react-native"; import { View, Image } from "react-native";
@ -296,9 +291,7 @@ function BrowserThemeCard({
loading={isInstalling} loading={isInstalling}
icon={ icon={
isInstalling ? ( isInstalling ? (
<View <View style={{ transform: [{ rotate: `${rotation}deg` }] }}>
style={{ transform: [{ rotate: `${rotation}deg` }] }}
>
<Image <Image
source={findAssetId("RetryIcon")} source={findAssetId("RetryIcon")}
style={{ width: 16, height: 16 }} style={{ width: 16, height: 16 }}
@ -410,15 +403,15 @@ export default function Themes() {
<ActionSheet> <ActionSheet>
<BottomSheetTitleHeader title="Options" /> <BottomSheetTitleHeader title="Options" />
<View style={{ paddingVertical: 20, gap: 12 }}> <View style={{ paddingVertical: 20, gap: 12 }}>
{/* Changed from TableRadioGroup to individual TableSwitchRow components
for better UX - users can now toggle options individually */}
<TableRowGroup title="Override Theme Type"> <TableRowGroup title="Override Theme Type">
<TableSwitchRow <TableCheckboxRow
label="Auto" label="Auto"
icon={<TableRowIcon source={findAssetId("RobotIcon")} />} icon={<TableRowIcon source={findAssetId("RobotIcon")} />}
value={!colorsPref.type} checked={!colorsPref.type}
onValueChange={(enabled: boolean) => { onPress={() => {
if (enabled) { if (!colorsPref.type) {
colorsPref.type = undefined;
} else {
colorsPref.type = "dark"; colorsPref.type = "dark";
} }
getCurrentTheme()?.data && getCurrentTheme()?.data &&
@ -427,28 +420,24 @@ export default function Themes() {
}); });
}} }}
/> />
<TableSwitchRow <TableCheckboxRow
label="Dark" label="Dark"
icon={ icon={<TableRowIcon source={findAssetId("ThemeDarkIcon")} />}
<TableRowIcon source={findAssetId("ThemeDarkIcon")} /> checked={colorsPref.type === "dark"}
} onPress={() => {
value={colorsPref.type === "dark"} colorsPref.type = colorsPref.type === "dark" ? undefined : "dark";
onValueChange={(enabled: boolean) => {
colorsPref.type = enabled ? "dark" : undefined;
getCurrentTheme()?.data && getCurrentTheme()?.data &&
updateBunnyColor(getCurrentTheme()!.data!, { updateBunnyColor(getCurrentTheme()!.data!, {
update: true, update: true,
}); });
}} }}
/> />
<TableSwitchRow <TableCheckboxRow
label="Light" label="Light"
icon={ icon={<TableRowIcon source={findAssetId("ThemeLightIcon")} />}
<TableRowIcon source={findAssetId("ThemeLightIcon")} /> checked={colorsPref.type === "light"}
} onPress={() => {
value={colorsPref.type === "light"} colorsPref.type = colorsPref.type === "light" ? undefined : "light";
onValueChange={(enabled: boolean) => {
colorsPref.type = enabled ? "light" : undefined;
getCurrentTheme()?.data && getCurrentTheme()?.data &&
updateBunnyColor(getCurrentTheme()!.data!, { updateBunnyColor(getCurrentTheme()!.data!, {
update: true, update: true,
@ -457,20 +446,13 @@ export default function Themes() {
/> />
</TableRowGroup> </TableRowGroup>
<TableRowGroup title="Chat Background"> <TableRowGroup title="Chat Background">
<TableSwitchRow <TableCheckboxRow
label="Show Background" label="Show Background"
subLabel="Enable or disable themes background on chat"
icon={<TableRowIcon source={findAssetId("ImageIcon")} />} icon={<TableRowIcon source={findAssetId("ImageIcon")} />}
value={!colorsPref.customBackground} checked={!colorsPref.customBackground}
onValueChange={(enabled: boolean) => { onPress={() => {
colorsPref.customBackground = enabled ? null : "hidden"; colorsPref.customBackground = !colorsPref.customBackground ? "hidden" : null;
}}
/>
<TableSwitchRow
label="Hide Background"
icon={<TableRowIcon source={findAssetId("DenyIcon")} />}
value={colorsPref.customBackground === "hidden"}
onValueChange={(enabled: boolean) => {
colorsPref.customBackground = enabled ? "hidden" : null;
}} }}
/> />
</TableRowGroup> </TableRowGroup>
@ -479,7 +461,7 @@ export default function Themes() {
); );
}) })
} }
/>, />
); );
navigation.setOptions({ navigation.setOptions({
@ -677,67 +659,13 @@ export default function Themes() {
); );
} }
return ( // Normal browse listing
<ActionSheet> return (
<BottomSheetTitleHeader title="Options" /> <BrowseThemePage
<View style={{ paddingVertical: 20, gap: 12 }}> themes={themesList}
{/* Changed from TableRadioGroup to individual TableSwitchRow components installing={installing}
for better UX - users can now toggle options individually */} setInstalling={setInstalling}
<TableRowGroup title="Override Theme Type"> setRefreshTick={setRefreshTick}
<TableCheckboxRow
label="Auto"
icon={<TableRowIcon source={findAssetId("RobotIcon")} />}
checked={!colorsPref.type}
onPress={() => {
if (!colorsPref.type) {
colorsPref.type = "dark";
}
getCurrentTheme()?.data &&
updateBunnyColor(getCurrentTheme()!.data!, {
update: true,
});
}}
/>
<TableCheckboxRow
label="Dark"
icon={<TableRowIcon source={findAssetId("ThemeDarkIcon")} />}
checked={colorsPref.type === "dark"}
onPress={() => {
colorsPref.type = colorsPref.type === "dark" ? undefined : "dark";
getCurrentTheme()?.data &&
updateBunnyColor(getCurrentTheme()!.data!, {
update: true,
});
}}
/>
<TableCheckboxRow
label="Light"
icon={<TableRowIcon source={findAssetId("ThemeLightIcon")} />}
checked={colorsPref.type === "light"}
onPress={() => {
colorsPref.type = colorsPref.type === "light" ? undefined : "light";
getCurrentTheme()?.data &&
updateBunnyColor(getCurrentTheme()!.data!, {
update: true,
});
}}
/>
</TableRowGroup>
<TableRowGroup title="Chat Background">
<TableCheckboxRow
label="Show Background"
subLabel="Enable or disable themes background on chat"
icon={<TableRowIcon source={findAssetId("ImageIcon")} />}
checked={!colorsPref.customBackground}
onPress={() => {
colorsPref.customBackground = !colorsPref.customBackground ? "hidden" : null;
}}
/>
</TableRowGroup>
</View>
</ActionSheet>
);
}}
/> />
); );
} }