This commit is contained in:
mathysPaul
2023-11-02 21:23:23 +01:00
39 changed files with 573 additions and 431 deletions
+45 -46
View File
@@ -3,51 +3,50 @@ import { TouchableOpacity, Animated, StyleSheet, Platform } from 'react-native';
import { Column, Text, useTheme } from 'native-base';
interface LinkBaseProps {
text: string;
onPress: () => void;
text: string;
onPress: () => void;
}
const LinkBase: React.FC<LinkBaseProps> = ({ text, onPress }) => {
const underlineHeight = useRef(new Animated.Value(4)).current;
const opacity = useRef(new Animated.Value(1)).current;
const color = useRef(new Animated.Value(1)).current;
const underlineHeight = useRef(new Animated.Value(4)).current;
const opacity = useRef(new Animated.Value(1)).current;
const theme = useTheme();
const handleMouseEnter = () => {
if (Platform.OS === 'web') {
Animated.timing(underlineHeight, {
toValue: 20,
duration: 250,
useNativeDriver: false
}).start();
}
};
const handleMouseEnter = () => {
if (Platform.OS === 'web') {
Animated.timing(underlineHeight, {
toValue: 20,
duration: 250,
useNativeDriver: false,
}).start();
}
};
const handleMouseLeave = () => {
if (Platform.OS === 'web') {
Animated.timing(underlineHeight, {
toValue: 4,
duration: 250,
useNativeDriver: false
}).start();
}
};
const handleMouseLeave = () => {
if (Platform.OS === 'web') {
Animated.timing(underlineHeight, {
toValue: 4,
duration: 250,
useNativeDriver: false,
}).start();
}
};
const handlePressIn = () => {
Animated.timing(opacity, {
toValue: 0.8,
duration: 250,
useNativeDriver: false
}).start();
};
const handlePressIn = () => {
Animated.timing(opacity, {
toValue: 0.8,
duration: 250,
useNativeDriver: false,
}).start();
};
const handlePressOut = () => {
Animated.timing(opacity, {
toValue: 1,
duration: 250,
useNativeDriver: false
}).start();
};
const handlePressOut = () => {
Animated.timing(opacity, {
toValue: 1,
duration: 250,
useNativeDriver: false,
}).start();
};
return (
<TouchableOpacity
@@ -74,15 +73,15 @@ const LinkBase: React.FC<LinkBaseProps> = ({ text, onPress }) => {
};
const styles = StyleSheet.create({
container: {
position: 'relative',
},
underline: {
width: '100%',
position: 'absolute',
zIndex: -1,
bottom: 0,
},
container: {
position: 'relative',
},
underline: {
width: '100%',
position: 'absolute',
zIndex: -1,
bottom: 0,
},
});
export default LinkBase;