This commit is contained in:
kmmiio99o 2025-10-01 19:48:03 +02:00
parent 711ea59e63
commit a0dab0c9f6

View file

@ -127,7 +127,7 @@ function Header() {
); );
} }
// Facts Commands Settings Page - Fixed with nexpid's approach // Facts Commands Settings Page
function FactsSettingsPage() { function FactsSettingsPage() {
useProxy(storage); useProxy(storage);
@ -147,14 +147,18 @@ function FactsSettingsPage() {
subLabel="Send facts as a reply to the command message" subLabel="Send facts as a reply to the command message"
leading={<FormRow.Icon source={getAssetIDByName("ArrowAngleLeftUpIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("ArrowAngleLeftUpIcon")} />}
value={storage.factSettings?.sendAsReply ?? true} value={storage.factSettings?.sendAsReply ?? true}
onValueChange={() => (storage.factSettings.sendAsReply = !storage.factSettings.sendAsReply)} onValueChange={() => {
storage.factSettings.sendAsReply = !storage.factSettings.sendAsReply;
}}
/> />
<FormSwitchRow <FormSwitchRow
label="Include Source Citation" label="Include Source Citation"
subLabel="Include the source of facts when available" subLabel="Include the source of facts when available"
leading={<FormRow.Icon source={getAssetIDByName("LinkIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("LinkIcon")} />}
value={storage.factSettings?.includeCitation ?? false} value={storage.factSettings?.includeCitation ?? false}
onValueChange={() => (storage.factSettings.includeCitation = !storage.factSettings.includeCitation)} onValueChange={() => {
storage.factSettings.includeCitation = !storage.factSettings.includeCitation;
}}
/> />
</BetterTableRowGroup> </BetterTableRowGroup>
@ -195,7 +199,7 @@ function FactsSettingsPage() {
); );
} }
// Gary API Settings Page - Fixed with nexpid's approach // Gary API Settings Page with proper reactivity
function GaryAPIPage() { function GaryAPIPage() {
useProxy(storage); useProxy(storage);
@ -399,7 +403,7 @@ function GaryAPIPage() {
); );
} }
// List Commands Settings Page - Fixed with nexpid's approach // List Commands Settings Page
function ListSettingsPage() { function ListSettingsPage() {
useProxy(storage); useProxy(storage);
@ -419,14 +423,18 @@ function ListSettingsPage() {
subLabel="Always use detailed mode when listing plugins" subLabel="Always use detailed mode when listing plugins"
leading={<FormRow.Icon source={getAssetIDByName("PuzzlePieceIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("PuzzlePieceIcon")} />}
value={storage.listSettings?.pluginListAlwaysDetailed ?? false} value={storage.listSettings?.pluginListAlwaysDetailed ?? false}
onValueChange={() => (storage.listSettings.pluginListAlwaysDetailed = !storage.listSettings.pluginListAlwaysDetailed)} onValueChange={() => {
storage.listSettings.pluginListAlwaysDetailed = !storage.listSettings.pluginListAlwaysDetailed;
}}
/> />
<FormSwitchRow <FormSwitchRow
label="Always Send Detailed Theme List" label="Always Send Detailed Theme List"
subLabel="Always use detailed mode when listing themes" subLabel="Always use detailed mode when listing themes"
leading={<FormRow.Icon source={getAssetIDByName("PaintPaletteIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("PaintPaletteIcon")} />}
value={storage.listSettings?.themeListAlwaysDetailed ?? false} value={storage.listSettings?.themeListAlwaysDetailed ?? false}
onValueChange={() => (storage.listSettings.themeListAlwaysDetailed = !storage.listSettings.themeListAlwaysDetailed)} onValueChange={() => {
storage.listSettings.themeListAlwaysDetailed = !storage.listSettings.themeListAlwaysDetailed;
}}
/> />
</BetterTableRowGroup> </BetterTableRowGroup>
@ -457,7 +465,7 @@ function ListSettingsPage() {
); );
} }
// Image Commands Settings Page - Fixed with nexpid's approach // Image Commands Settings Page
function ImageSettingsPage() { function ImageSettingsPage() {
useProxy(storage); useProxy(storage);
@ -511,7 +519,7 @@ function ImageSettingsPage() {
); );
} }
// Spotify Commands Settings Page - Fixed with nexpid's approach // Spotify Commands Settings Page
function SpotifySettingsPage() { function SpotifySettingsPage() {
useProxy(storage); useProxy(storage);
@ -584,7 +592,7 @@ function SpotifySettingsPage() {
); );
} }
// Other Commands Settings Page - Fixed with nexpid's approach // Other Commands Settings Page
function OtherSettingsPage() { function OtherSettingsPage() {
useProxy(storage); useProxy(storage);
@ -628,7 +636,7 @@ function OtherSettingsPage() {
); );
} }
// UPDATED Credits Page with requested changes // FIXED Credits Page - changed "contributor" to "developer"
function CreditsPage() { function CreditsPage() {
const styles = stylesheet.createThemedStyleSheet({ const styles = stylesheet.createThemedStyleSheet({
container: { container: {
@ -753,7 +761,7 @@ function CreditsPage() {
<BetterTableRowGroup title="Plugin Authors" icon={getAssetIDByName("HeartIcon")} padding={true}> <BetterTableRowGroup title="Plugin Authors" icon={getAssetIDByName("HeartIcon")} padding={true}>
<RN.Text style={styles.infoText}> <RN.Text style={styles.infoText}>
Thanks to this developers for creating such a nice plugins!{'\n'} Thanks to this developers for creating such a nice plugins!{'\n'}
Tap on any contributor to visit their GitHub profile. Tap on any developer to visit their GitHub profile.
</RN.Text> </RN.Text>
</BetterTableRowGroup> </BetterTableRowGroup>
@ -832,10 +840,9 @@ if (!storage.pendingRestart) {
storage.pendingRestart = false; storage.pendingRestart = false;
} }
// Main Settings Component - Fixed with nexpid's approach // Main Settings Component - COMPLETELY FIXED
export default function Settings() { export default function Settings() {
useProxy(storage); useProxy(storage);
const [rerender, forceRerender] = React.useReducer((x) => x + 1, 0);
const navigation = NavigationNative.useNavigation(); const navigation = NavigationNative.useNavigation();
const styles = stylesheet.createThemedStyleSheet({ const styles = stylesheet.createThemedStyleSheet({
@ -861,13 +868,6 @@ export default function Settings() {
}; };
}, []); }, []);
const navigateToPage = (title: string, component: React.ComponentType<any>) => {
navigation.push("VendettaCustomPage", {
title,
render: component,
});
};
return ( return (
<RN.View style={styles.container}> <RN.View style={styles.container}>
<ScrollView <ScrollView
@ -884,21 +884,30 @@ export default function Settings() {
subLabel="Cat facts, dog facts, and useless facts" subLabel="Cat facts, dog facts, and useless facts"
leading={<FormRow.Icon source={getAssetIDByName("BookmarkIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("BookmarkIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Facts Commands", FactsSettingsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Facts Commands",
render: FactsSettingsPage,
})}
/> />
<FormRow <FormRow
label="List Commands" label="List Commands"
subLabel="Plugin lists and theme lists" subLabel="Plugin lists and theme lists"
leading={<FormRow.Icon source={getAssetIDByName("ListViewIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("ListViewIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("List Commands", ListSettingsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "List Commands",
render: ListSettingsPage,
})}
/> />
<FormRow <FormRow
label="Image Commands" label="Image Commands"
subLabel="PetPet, KonoChan, and image utilities" subLabel="PetPet, KonoChan, and image utilities"
leading={<FormRow.Icon source={getAssetIDByName("ImageIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("ImageIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Image Commands", ImageSettingsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Image Commands",
render: ImageSettingsPage,
})}
/> />
<FormRow <FormRow
label="Gary Commands" label="Gary Commands"
@ -908,21 +917,30 @@ export default function Settings() {
storage.garySettings?.imageSource === "goober" ? "Goober API" : "Gary API"}`} storage.garySettings?.imageSource === "goober" ? "Goober API" : "Gary API"}`}
leading={<FormRow.Icon source={getAssetIDByName("CameraIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("CameraIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Gary Commands", GaryAPIPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Gary Commands",
render: GaryAPIPage,
})}
/> />
<FormRow <FormRow
label="Spotify Commands" label="Spotify Commands"
subLabel="Share your Spotify activity" subLabel="Share your Spotify activity"
leading={<FormRow.Icon source={getAssetIDByName("SpotifyNeutralIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("SpotifyNeutralIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Spotify Commands", SpotifySettingsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Spotify Commands",
render: SpotifySettingsPage,
})}
/> />
<FormRow <FormRow
label="Other Commands" label="Other Commands"
subLabel="System info and miscellaneous" subLabel="System info and miscellaneous"
leading={<FormRow.Icon source={getAssetIDByName("MoreHorizontalIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("MoreHorizontalIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Other Commands", OtherSettingsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Other Commands",
render: OtherSettingsPage,
})}
/> />
</BetterTableRowGroup> </BetterTableRowGroup>
@ -933,7 +951,10 @@ export default function Settings() {
subLabel="View original authors of the plugins" subLabel="View original authors of the plugins"
leading={<FormRow.Icon source={getAssetIDByName("HeartIcon")} />} leading={<FormRow.Icon source={getAssetIDByName("HeartIcon")} />}
trailing={<FormRow.Arrow />} trailing={<FormRow.Arrow />}
onPress={() => navigateToPage("Credits", CreditsPage)} onPress={() => navigation.push("VendettaCustomPage", {
title: "Credits",
render: CreditsPage,
})}
/> />
</BetterTableRowGroup> </BetterTableRowGroup>
</ScrollView> </ScrollView>