-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFloatingPlusButton.tsx
More file actions
37 lines (35 loc) · 1012 Bytes
/
FloatingPlusButton.tsx
File metadata and controls
37 lines (35 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { TouchableOpacity } from 'react-native';
import Ionicons from '@expo/vector-icons/Ionicons';
import React, { useContext } from 'react';
import { ThemeContext } from '@/theme/ThemeContext';
type FloatingPlusButtonProps = {
onPress: () => void;
};
export function FloatingPlusButton({ onPress }: FloatingPlusButtonProps) {
const { theme } = useContext(ThemeContext);
return (
<TouchableOpacity
style={{
position: 'absolute',
right: 24,
bottom: 24,
backgroundColor: theme === "dark" ? "#4630EB" : "#4630EB",
borderRadius: 32,
width: 56,
height: 56,
alignItems: 'center',
justifyContent: 'center',
elevation: 5,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.3,
shadowRadius: 4,
zIndex: 10
}}
onPress={onPress}
activeOpacity={0.8}
>
<Ionicons name="add" size={32} color="white" />
</TouchableOpacity>
);
}