diff --git a/src/ui/settings/components/PluginCard.tsx b/src/ui/settings/components/PluginCard.tsx index 505813b..af3f25d 100644 --- a/src/ui/settings/components/PluginCard.tsx +++ b/src/ui/settings/components/PluginCard.tsx @@ -1,13 +1,12 @@ -import { ReactNative as RN, stylesheet } from "@metro/common"; +import { ReactNative as RN, stylesheet, navigation } from "@metro/common"; import { Forms, General } from "@ui/components"; import { Plugin } from "@types"; import { getAssetIDByName } from "@ui/assets"; import { getSettings, startPlugin, stopPlugin } from "@lib/plugins"; -import { findByProps } from "@metro/filters"; +import PluginSettings from "@ui/settings/components/PluginSettings"; const { FormRow, FormSwitch } = Forms; const { TouchableOpacity, Image } = General; -const navigation = findByProps("pushLazy"); const styles = stylesheet.createThemedStyleSheet({ card: { @@ -62,7 +61,10 @@ export default function PluginCard({ plugin }: PluginCardProps) { {Settings && { - navigation.push(Settings); + navigation.push(PluginSettings, { + plugin: plugin, + children: Settings, + }); }} > diff --git a/src/ui/settings/components/PluginSettings.tsx b/src/ui/settings/components/PluginSettings.tsx new file mode 100644 index 0000000..aa1248f --- /dev/null +++ b/src/ui/settings/components/PluginSettings.tsx @@ -0,0 +1,73 @@ +import { Plugin } from "@types"; +import { navigation, navigationStack, NavigationNative, stylesheet, constants } from "@metro/common"; +import { General } from "@ui/components"; +import { getAssetIDByName } from "@ui/assets"; + +interface PluginSettingsProps { + plugin: Plugin; + children: JSX.Element; +} + +const styles = stylesheet.createThemedStyleSheet({ + container: { + backgroundColor: stylesheet.ThemeColorMap.BACKGROUND_MOBILE_SECONDARY, + flex: 1, + }, + cardStyle: { + backgroundColor: stylesheet.ThemeColorMap.BACKGROUND_MOBILE_PRIMARY, + color: stylesheet.ThemeColorMap.TEXT_NORMAL, + }, + header: { + backgroundColor: stylesheet.ThemeColorMap.BACKGROUND_MOBILE_SECONDARY, + shadowColor: "transparent", + elevation: 0, + }, + headerTitleContainer: { + color: stylesheet.ThemeColorMap.HEADER_PRIMARY, + }, + headerTitle: { + fontFamily: constants.Fonts.PRIMARY_BOLD, + color: stylesheet.ThemeColorMap.HEADER_PRIMARY, + }, + backIcon: { + tintColor: stylesheet.ThemeColorMap.INTERACTIVE_ACTIVE, + marginLeft: 15, + marginRight: 20, + } +}); + +export const Settings = navigationStack.createStackNavigator(); +const { TouchableOpacity, Image } = General; + +export default function PluginSettings({ plugin, children }: PluginSettingsProps) { + return ( + + + ( + navigation.pop()} + > + + + ), + }} + /> + + + ) +} \ No newline at end of file