mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
minor changes
This commit is contained in:
@@ -15,18 +15,18 @@ export const Button = ({
|
|||||||
icon,
|
icon,
|
||||||
color = 'accent',
|
color = 'accent',
|
||||||
fontSize = SIZE.sm,
|
fontSize = SIZE.sm,
|
||||||
iconColor = 'white',
|
iconColor = 'accent',
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state] = useTracked();
|
||||||
const {colors} = state;
|
const {colors} = state;
|
||||||
const usedColor = color === 'accent' ? colors.accent : colors[color];
|
const usedColor = color === 'accent' ? colors.accent : colors[color];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PressableButton
|
<PressableButton
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
color={grayed ? colors.nav : usedColor}
|
color="transparent"
|
||||||
selectedColor={grayed ? colors.nav : usedColor}
|
selectedColor={grayed ? colors.nav : colors.shade}
|
||||||
alpha={grayed ? (!colors.night ? -0.04 : 0.04) : -0.1}
|
alpha={grayed ? (!colors.night ? -0.02 : 0.02) : -0.1}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
height: height,
|
height: height,
|
||||||
width: width ? width : null,
|
width: width ? width : null,
|
||||||
@@ -43,10 +43,10 @@ export const Button = ({
|
|||||||
<Icon
|
<Icon
|
||||||
name={icon}
|
name={icon}
|
||||||
style={{
|
style={{
|
||||||
marginRight: 5,
|
marginRight: 0,
|
||||||
}}
|
}}
|
||||||
color={grayed ? colors.icon : colors[iconColor]}
|
color={grayed ? colors.icon : colors[iconColor]}
|
||||||
size={SIZE.lg}
|
size={SIZE.md}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<Text
|
<Text
|
||||||
@@ -70,8 +70,9 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
buttonText: {
|
buttonText: {
|
||||||
fontFamily: WEIGHT.medium,
|
fontFamily: WEIGHT.bold,
|
||||||
color: 'white',
|
color: 'white',
|
||||||
|
fontSize: SIZE.md,
|
||||||
marginLeft: 5,
|
marginLeft: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,15 +1,33 @@
|
|||||||
import Animated, {Easing} from 'react-native-reanimated';
|
import { Dimensions } from 'react-native';
|
||||||
import {Dimensions} from 'react-native';
|
import Animated, { Easing } from 'react-native-reanimated';
|
||||||
import {editing} from './index';
|
import { editing } from './index';
|
||||||
|
|
||||||
const {Value, timing} = Animated;
|
const {Value, timing} = Animated;
|
||||||
|
|
||||||
export const EditorPosition = new Value(0);
|
export const EditorPosition = new Value(0);
|
||||||
export const EditorScale = new Value(1);
|
export const EditorScale = new Value(1);
|
||||||
export const EditorOpacity = new Value(0);
|
export const EditorOpacity = new Value(0);
|
||||||
export const EditorTranslateY = new Value(
|
export const EditorTranslateY = new Value(Dimensions.get('window').height * 2);
|
||||||
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() {
|
export function openEditorAnimation() {
|
||||||
EditorTranslateY.setValue(Dimensions.get('window').height * 0.75);
|
EditorTranslateY.setValue(Dimensions.get('window').height * 0.75);
|
||||||
@@ -17,7 +35,6 @@ export function openEditorAnimation() {
|
|||||||
|
|
||||||
editing.currentlyEditing = true;
|
editing.currentlyEditing = true;
|
||||||
|
|
||||||
|
|
||||||
timing(EditorTranslateY, {
|
timing(EditorTranslateY, {
|
||||||
duration: 200,
|
duration: 200,
|
||||||
toValue: 0,
|
toValue: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user