diff --git a/src/screens/settings/SettingsAdvancedScreen.tsx b/src/screens/settings/SettingsAdvancedScreen.tsx
index f2b2ee9d..efccde19 100644
--- a/src/screens/settings/SettingsAdvancedScreen.tsx
+++ b/src/screens/settings/SettingsAdvancedScreen.tsx
@@ -1,8 +1,15 @@
import React, { useState } from 'react';
-import { Dialog, Portal } from 'react-native-paper';
+import {
+ Dialog,
+ Modal,
+ Portal,
+ Text,
+ TextInput,
+ overlay,
+} from 'react-native-paper';
-import { useTheme } from '@hooks/persisted';
+import { useTheme, useUserAgent } from '@hooks/persisted';
import { showToast } from '@utils/showToast';
import { deleteCachedNovels } from '@database/queries/NovelQueries';
@@ -19,10 +26,13 @@ import { importEpub } from '@services/epub/import';
import { AdvancedSettingsScreenProps } from '@navigators/types';
import { useMMKVString } from 'react-native-mmkv';
import { BACKGROUND_ACTION } from '@services/constants';
+import { StyleSheet, View } from 'react-native';
+import { getUserAgentSync } from 'react-native-device-info';
const AdvancedSettings = ({ navigation }: AdvancedSettingsScreenProps) => {
const theme = useTheme();
-
+ const { userAgent, setUserAgent } = useUserAgent();
+ const [userAgentInput, setUserAgentInput] = useState(userAgent);
/**
* Confirm Clear Database Dialog
*/
@@ -40,6 +50,12 @@ const AdvancedSettings = ({ navigation }: AdvancedSettingsScreenProps) => {
setFalse: hideDeleteReadChaptersDialog,
} = useBoolean();
+ const {
+ value: userAgentModalVisible,
+ setTrue: showUserAgentModal,
+ setFalse: hideUserAgentModal,
+ } = useBoolean();
+
const [hasAction] = useMMKVString(BACKGROUND_ACTION);
return (
@@ -74,6 +90,12 @@ const AdvancedSettings = ({ navigation }: AdvancedSettingsScreenProps) => {
theme={theme}
disabled={Boolean(hasAction)}
/>
+
{
+
+
+ User Agent
+
+ {userAgent}
+ setUserAgentInput(text.trim())}
+ placeholderTextColor={theme.onSurfaceDisabled}
+ underlineColor={theme.outline}
+ style={[{ color: theme.onSurface }, styles.textInput]}
+ theme={{ colors: { ...theme } }}
+ />
+
+
+
>
);
};
export default AdvancedSettings;
+
+const styles = StyleSheet.create({
+ modalContainer: {
+ margin: 30,
+ padding: 24,
+ borderRadius: 28,
+ },
+ textInput: {
+ height: 120,
+ borderRadius: 14,
+ marginTop: 16,
+ marginBottom: 8,
+ fontSize: 12,
+ },
+ modalTitle: {
+ fontSize: 24,
+ marginBottom: 16,
+ },
+ buttonGroup: {
+ flexDirection: 'row-reverse',
+ },
+ button: {
+ marginTop: 16,
+ flex: 1,
+ marginHorizontal: 8,
+ },
+});