remove unused views

This commit is contained in:
ammarahm-ed
2020-04-16 14:05:42 +05:00
parent 37fb9c8c01
commit 3ee75c4df3
4 changed files with 0 additions and 434 deletions

View File

@@ -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 {

View File

@@ -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 (
<AnimatedSafeAreaView
transition="backgroundColor"
duration={300}
style={{
height: '100%',
backgroundColor: colors.bg,
}}>
<Header colors={colors} heading="" canGoBack={true} />
<View
style={{
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'center',
}}>
<Text
style={{
color: colors.pri,
fontFamily: WEIGHT.regular,
fontSize: SIZE.lg,
marginTop: 10,
}}>
Alex's Account
</Text>
<View
style={{
borderRadius: 5,
padding: 5,
paddingVertical: 2.5,
marginBottom: 20,
marginTop: 10,
backgroundColor: colors.accent,
}}>
<Text
style={{
color: 'white',
fontFamily: WEIGHT.regular,
fontSize: SIZE.sm,
}}>
Pro
</Text>
</View>
</View>
<FlatList
data={[
{
name: 'Backup',
},
{
name: 'My Devices',
},
{
name: 'Vault',
},
{
name: 'My Subscription',
},
{
name: 'Change Password',
},
{
name: 'Logout',
},
]}
keyExtractor={item => item.name}
renderItem={({item, index}) => (
<TouchableOpacity
activeOpacity={opacity}
style={{
borderBottomWidth: 1,
width: '90%',
marginHorizontal: '5%',
borderBottomColor: colors.nav,
paddingVertical: pv + 5,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
{item.name}
</Text>
</TouchableOpacity>
)}
/>
</AnimatedSafeAreaView>
);
};
AccountSettings.navigationOptions = {
header: null,
};
export default AccountSettings;

View File

@@ -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 (
<Container
menu={true}
heading="Apperance "
canGoBack={false}
noSearch={true}
noSelectionHeader={true}
noBottomButton={true}>
<View
style={{
marginTop: Platform.OS == 'ios' ? 135 - 60 : 155 - 60,
}}
/>
<View
style={{
paddingHorizontal: 12,
}}>
<View>
<View
style={{
marginTop: 10,
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
Accent Color
</Text>
</View>
<ScrollView
contentContainerStyle={{
flexDirection: 'row',
flexWrap: 'wrap',
marginTop: 10,
marginHorizontal: 0,
borderBottomWidth: 1,
paddingBottom: pv + 5,
borderBottomColor: colors.nav,
}}>
{[
'#e6194b',
'#3cb44b',
'#ffe119',
'#0560FF',
'#f58231',
'#911eb4',
'#46f0f0',
'#f032e6',
'#bcf60c',
'#fabebe',
].map(item => (
<TouchableOpacity
key={item}
onPress={() => {
changeAccentColor(item);
MMKV.setStringAsync('accentColor', item);
}}
style={{
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
marginRight: 10,
marginVertical: 5,
}}>
<View
style={{
width: 35,
height: 35,
backgroundColor: item,
borderRadius: 100,
justifyContent: 'center',
alignItems: 'center',
}}>
{colors.accent === item ? (
<Icon size={SIZE.lg} color="white" name="check" />
) : null}
</View>
</TouchableOpacity>
))}
</ScrollView>
<TouchableOpacity
onPress={() => {
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,
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
Dark Mode
</Text>
<Icon
size={SIZE.xl}
color={colors.night ? colors.accent : colors.icon}
name={colors.night ? 'toggle-switch' : 'toggle-switch-off'}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
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,
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
Font Scaling
</Text>
<View
style={{
borderBottomWidth: 1,
borderColor: colors.nav,
paddingVertical: 1,
paddingHorizontal: 5,
}}>
<Text
style={{
fontSize: SIZE.sm,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
1.0x
</Text>
</View>
</TouchableOpacity>
</View>
</View>
</Container>
);
};
AppearanceSettings.navigationOptions = {
header: null,
};
export default AppearanceSettings;

View File

@@ -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 (
<Container
menu={true}
heading="Editor"
canGoBack={false}
noSearch={true}
noSelectionHeader={true}
noBottomButton={true}>
<View
style={{
marginTop: Platform.OS == 'ios' ? 135 - 60 : 155 - 60,
}}
/>
<View
style={{
paddingHorizontal: 12,
}}>
<TouchableOpacity
activeOpacity={opacity}
style={{
width: '100%',
marginHorizontal: 0,
paddingVertical: pv,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
borderBottomWidth: 1,
paddingBottom: pv + 5,
borderBottomColor: colors.nav,
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
Show toolbar on top
</Text>
<Icon
size={SIZE.xl}
color={colors.night ? colors.accent : colors.icon}
name={colors.night ? 'toggle-switch' : 'toggle-switch-off'}
/>
</TouchableOpacity>
<TouchableOpacity
activeOpacity={opacity}
style={{
width: '100%',
marginHorizontal: 0,
paddingVertical: pv,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
borderBottomWidth: 1,
paddingBottom: pv + 5,
borderBottomColor: colors.nav,
}}>
<Text
style={{
fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
}}>
Show keyboard on open
</Text>
<Icon
size={SIZE.xl}
color={colors.night ? colors.accent : colors.icon}
name={colors.night ? 'toggle-right' : 'toggle-left'}
/>
</TouchableOpacity>
</View>
</Container>
);
};
EditorSettings.navigationOptions = {
header: null,
};
export default EditorSettings;