minor changes

This commit is contained in:
ammarahm-ed
2020-11-14 10:14:06 +05:00
parent b7f4c14dd5
commit ce5115ece7
2 changed files with 59 additions and 41 deletions

View File

@@ -15,18 +15,18 @@ export const Button = ({
icon,
color = 'accent',
fontSize = SIZE.sm,
iconColor = 'white',
iconColor = 'accent',
}) => {
const [state, dispatch] = useTracked();
const [state] = useTracked();
const {colors} = state;
const usedColor = color === 'accent' ? colors.accent : colors[color];
return (
<PressableButton
onPress={onPress}
color={grayed ? colors.nav : usedColor}
selectedColor={grayed ? colors.nav : usedColor}
alpha={grayed ? (!colors.night ? -0.04 : 0.04) : -0.1}
color="transparent"
selectedColor={grayed ? colors.nav : colors.shade}
alpha={grayed ? (!colors.night ? -0.02 : 0.02) : -0.1}
customStyle={{
height: height,
width: width ? width : null,
@@ -43,10 +43,10 @@ export const Button = ({
<Icon
name={icon}
style={{
marginRight: 5,
marginRight: 0,
}}
color={grayed ? colors.icon : colors[iconColor]}
size={SIZE.lg}
size={SIZE.md}
/>
) : null}
<Text
@@ -70,8 +70,9 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
buttonText: {
fontFamily: WEIGHT.medium,
fontFamily: WEIGHT.bold,
color: 'white',
fontSize: SIZE.md,
marginLeft: 5,
},
});

View File

@@ -1,15 +1,33 @@
import Animated, {Easing} from 'react-native-reanimated';
import {Dimensions} from 'react-native';
import {editing} from './index';
import { Dimensions } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
import { editing } from './index';
const {Value, timing} = Animated;
export const EditorPosition = new Value(0);
export const EditorScale = new Value(1);
export const EditorOpacity = new Value(0);
export const EditorTranslateY = new Value(
Dimensions.get('window').height * 2
);
export const EditorTranslateY = new Value(Dimensions.get('window').height * 2);
export const anim1 = new Animated.Value(-Dimensions.get('window').height);
export let animInitialValue = -Dimensions.get('window').height;
export const opacityAnimSearch = new Animated.Value(1);
export const setAnimValue = (value) => (animInitialValue = value);
export let currentPage = "main"
export function searchViewAnimation(translate, opacity,next,duration=150) {
currentPage = next
timing(anim1, {
toValue: translate,
duration: duration,
easing: Easing.inOut(Easing.ease),
}).start();
timing(opacityAnimSearch, {
toValue: opacity,
duration: duration,
easing: Easing.in(Easing.ease),
}).start();
}
export function openEditorAnimation() {
EditorTranslateY.setValue(Dimensions.get('window').height * 0.75);
@@ -17,7 +35,6 @@ export function openEditorAnimation() {
editing.currentlyEditing = true;
timing(EditorTranslateY, {
duration: 200,
toValue: 0,