import { storage } from "@vendetta/plugin"; import { useProxy } from "@vendetta/storage"; import { React, ReactNative, stylesheet } from "@vendetta/metro/common"; import { NavigationNative } from "@vendetta/metro/common"; import { semanticColors } from "@vendetta/ui"; import { getAssetIDByName } from "@vendetta/ui/assets"; import { Forms } from "@vendetta/ui/components"; import { alerts } from "@vendetta/ui"; import { showToast } from "@vendetta/ui/toasts"; import Header from "./components/Header"; import BetterTableRowGroup from "./components/BetterTableRowGroup"; // Import all pages directly import FactsSettingsPage from "./pages/FactsSettingsPage"; import ListSettingsPage from "./pages/ListSettingsPage"; import ImageSettingsPage from "./pages/ImageSettingsPage"; import GaryAPIPage from "./pages/GaryAPIPage"; import SpotifySettingsPage from "./pages/SpotifySettingsPage"; import AliucordPage from "./pages/AliucordPage"; import OtherSettingsPage from "./pages/OtherSettingsPage"; import HiddenSettingsPage from "./pages/HiddenSettingsPage"; import CreditsPage from "./pages/CreditsPage"; const { FormRow } = Forms; // Initialize storage with default values storage.factSettings ??= { sendAsReply: true, includeCitation: false, }; storage.listSettings ??= { pluginListAlwaysDetailed: false, themeListAlwaysDetailed: false, }; storage.garySettings ??= { imageSource: "gary", }; storage.enabledCommands ??= { catfact: true, dogfact: true, useless: true, petpet: true, pluginList: true, themeList: true, konoself: true, konosend: true, firstmessage: true, sysinfo: true, spotifyTrack: true, spotifyAlbum: true, spotifyArtists: true, spotifyCover: true, gary: true, ip: true, lovefemboys: false, nekoslife: false, friendInviteCreate: true, friendInviteView: true, friendInviteRevoke: true, }; storage.pendingRestart ??= false; // Hidden settings storage with NSFW bypass option storage.hiddenSettings ??= { enabled: false, visible: false, konochanBypassNsfw: false, }; // Sidebar setting (enabled by default) storage.sidebarEnabled ??= true; // MAIN SETTINGS COMPONENT export default function Settings() { useProxy(storage); const navigation = NavigationNative.useNavigation(); React.useEffect(() => { return () => { if (storage.pendingRestart) { storage.pendingRestart = false; alerts.showConfirmationAlert({ title: "Restart Required", content: "You have made changes to commands. Please restart Discord to apply these changes.", confirmText: "Okay", cancelText: null, onConfirm: () => {}, }); } }; }, []); return (
} trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Facts Commands", render: FactsSettingsPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "List Commands", render: ListSettingsPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Image Commands", render: ImageSettingsPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Gary Commands", render: GaryAPIPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Spotify Commands", render: SpotifySettingsPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Aliucord", render: AliucordPage, }) } /> } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Other Commands", render: OtherSettingsPage, }) } /> {storage.hiddenSettings?.visible && ( } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Hidden Settings", render: HiddenSettingsPage, }) } /> )} } trailing={} onPress={() => navigation.push("VendettaCustomPage", { title: "Credits", render: CreditsPage, }) } /> {/* Add sufficient bottom padding for scrolling */} ); }