mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
minor changes
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,48 +1,65 @@
|
||||
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);
|
||||
EditorOpacity.setValue(0);
|
||||
EditorTranslateY.setValue(Dimensions.get('window').height * 0.75);
|
||||
EditorOpacity.setValue(0);
|
||||
|
||||
editing.currentlyEditing = true;
|
||||
editing.currentlyEditing = true;
|
||||
|
||||
|
||||
timing(EditorTranslateY, {
|
||||
duration: 200,
|
||||
toValue: 0,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorOpacity, {
|
||||
duration: 150,
|
||||
toValue: 1,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorTranslateY, {
|
||||
duration: 200,
|
||||
toValue: 0,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorOpacity, {
|
||||
duration: 150,
|
||||
toValue: 1,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
}
|
||||
|
||||
export function exitEditorAnimation() {
|
||||
EditorOpacity.setValue(1);
|
||||
EditorTranslateY.setValue(0);
|
||||
editing.currentlyEditing = false;
|
||||
EditorOpacity.setValue(1);
|
||||
EditorTranslateY.setValue(0);
|
||||
editing.currentlyEditing = false;
|
||||
|
||||
timing(EditorOpacity, {
|
||||
duration: 150,
|
||||
toValue: 0,
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorTranslateY, {
|
||||
duration: 200,
|
||||
toValue: Dimensions.get('window').height * 2,
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorOpacity, {
|
||||
duration: 150,
|
||||
toValue: 0,
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorTranslateY, {
|
||||
duration: 200,
|
||||
toValue: Dimensions.get('window').height * 2,
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user