From 3ee75c4df32f5ce1edde4183ad10e5bbf02bc4eb Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 16 Apr 2020 14:05:42 +0500 Subject: [PATCH] remove unused views --- apps/mobile/src/utils/storage.js | 2 - .../mobile/src/views/AccountSettings/index.js | 113 --------- .../src/views/AppearanceSettings/index.js | 225 ------------------ apps/mobile/src/views/EditorSettings/index.js | 94 -------- 4 files changed, 434 deletions(-) delete mode 100644 apps/mobile/src/views/AccountSettings/index.js delete mode 100644 apps/mobile/src/views/AppearanceSettings/index.js delete mode 100644 apps/mobile/src/views/EditorSettings/index.js diff --git a/apps/mobile/src/utils/storage.js b/apps/mobile/src/utils/storage.js index c17d5ab8b..0bc4dc5cb 100644 --- a/apps/mobile/src/utils/storage.js +++ b/apps/mobile/src/utils/storage.js @@ -2,8 +2,6 @@ import MMKV from 'react-native-mmkv-storage'; import Sodium from "react-native-sodium"; async function read(key, isArray = false) { - - //console.log("DATA_VAULT", await MMKV.getMapAsync('vaultKey')) let data; if (isArray) { try { diff --git a/apps/mobile/src/views/AccountSettings/index.js b/apps/mobile/src/views/AccountSettings/index.js deleted file mode 100644 index 70eb56577..000000000 --- a/apps/mobile/src/views/AccountSettings/index.js +++ /dev/null @@ -1,113 +0,0 @@ -import React from 'react'; -import {FlatList, Text, TouchableOpacity, View} from 'react-native'; -import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; -import {Header} from '../../components/header'; -import {useTracked} from '../../provider'; -import {AnimatedSafeAreaView} from '../../utils/refs'; - -export const AccountSettings = ({navigation}) => { - const [state, dispatch] = useTracked(); - const {colors} = state; - - return ( - -
- - - - Alex's Account - - - - - Pro - - - - item.name} - renderItem={({item, index}) => ( - - - {item.name} - - - )} - /> - - ); -}; - -AccountSettings.navigationOptions = { - header: null, -}; - -export default AccountSettings; diff --git a/apps/mobile/src/views/AppearanceSettings/index.js b/apps/mobile/src/views/AppearanceSettings/index.js deleted file mode 100644 index 586f5bc0e..000000000 --- a/apps/mobile/src/views/AppearanceSettings/index.js +++ /dev/null @@ -1,225 +0,0 @@ -import React from 'react'; -import { - ScrollView, - StatusBar, - Text, - TouchableOpacity, - View, -} from 'react-native'; -import MMKV from 'react-native-mmkv-storage'; -import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import { - ACCENT, - COLOR_SCHEME, - COLOR_SCHEME_DARK, - COLOR_SCHEME_LIGHT, - opacity, - pv, - setColorScheme, - SIZE, - WEIGHT, -} from '../../common/common'; -import Container from '../../components/Container'; -import {useTracked} from '../../provider'; -import {ACTIONS} from '../../provider/actions'; -const AppearanceSettings = ({navigation}) => { - const [state, dispatch] = useTracked(); - const {colors} = state; - - /// - function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) { - let newColors = setColorScheme(colors, accent); - StatusBar.setBarStyle(newColors.night ? 'light-content' : 'dark-content'); - - dispatch({type: ACTIONS.THEME, colors: newColors}); - } - - function changeAccentColor(accentColor) { - ACCENT.color = accentColor; - ACCENT.shade = accentColor + '12'; - changeColorScheme(); - } - - return ( - - - - - - - Accent Color - - - - {[ - '#e6194b', - '#3cb44b', - '#ffe119', - '#0560FF', - '#f58231', - '#911eb4', - '#46f0f0', - '#f032e6', - '#bcf60c', - '#fabebe', - ].map(item => ( - { - changeAccentColor(item); - - MMKV.setStringAsync('accentColor', item); - }} - style={{ - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', - marginRight: 10, - marginVertical: 5, - }}> - - {colors.accent === item ? ( - - ) : null} - - - ))} - - { - if (!colors.night) { - MMKV.setStringAsync('theme', JSON.stringify({night: true})); - changeColorScheme(COLOR_SCHEME_DARK); - } else { - MMKV.setStringAsync('theme', JSON.stringify({night: false})); - - changeColorScheme(COLOR_SCHEME_LIGHT); - } - }} - activeOpacity={opacity} - style={{ - width: '100%', - marginHorizontal: 0, - paddingVertical: pv + 5, - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - borderBottomWidth: 1, - borderBottomColor: colors.nav, - }}> - - Dark Mode - - - - - { - if (!colors.night) { - MMKV.setStringAsync('theme', JSON.stringify({night: true})); - changeColorScheme(COLOR_SCHEME_DARK); - } else { - MMKV.setStringAsync('theme', JSON.stringify({night: false})); - - changeColorScheme(COLOR_SCHEME_LIGHT); - } - }} - activeOpacity={opacity} - style={{ - width: '100%', - marginHorizontal: 0, - paddingVertical: pv + 5, - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - borderBottomWidth: 1, - borderBottomColor: colors.nav, - }}> - - Font Scaling - - - - - 1.0x - - - - - - - ); -}; - -AppearanceSettings.navigationOptions = { - header: null, -}; - -export default AppearanceSettings; diff --git a/apps/mobile/src/views/EditorSettings/index.js b/apps/mobile/src/views/EditorSettings/index.js deleted file mode 100644 index f484c399a..000000000 --- a/apps/mobile/src/views/EditorSettings/index.js +++ /dev/null @@ -1,94 +0,0 @@ -import React from 'react'; -import {Text, TouchableOpacity, View} from 'react-native'; -import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import {opacity, pv, SIZE, WEIGHT} from '../../common/common'; -import Container from '../../components/Container'; -import {useTracked} from '../../provider'; -const EditorSettings = ({navigation}) => { - const [state, dispatch] = useTracked(); - const {colors} = state; - - return ( - - - - - - - Show toolbar on top - - - - - - Show keyboard on open - - - - - - ); -}; - -EditorSettings.navigationOptions = { - header: null, -}; - -export default EditorSettings;