import React from "react"; import { Alert, StyleSheet, Text, View } from "react-native"; import { GestureHandlerRootView } from "react-native-gesture-handler"; import { Draggable, Droppable, DropProvider, } from "react-native-reanimated-dnd"; import { SafeAreaView } from "react-native-safe-area-context"; export default function DragDropExample() { const handleDrop = (data: any, zoneId: string) => { Alert.alert("Item Dropped", `"${data.title}" dropped in ${zoneId}`); }; return ( {/* Drop Zones */} Drop Zones handleDrop(data, "Zone 1")} activeStyle={styles.dropZoneActive} style={styles.droppable} > 🎯 Zone 1 Drop here handleDrop(data, "Zone 2")} activeStyle={styles.dropZoneActive} style={styles.droppable} > 🎯 Zone 2 Drop here {/* Draggable Item */} Draggable Item 📦 Drag me to a zone ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#000000", }, content: { flex: 1, padding: 20, justifyContent: "space-between", }, sectionTitle: { color: "#FFFFFF", fontSize: 18, fontWeight: "700", marginBottom: 20, textAlign: "center", }, draggableSection: { alignItems: "center", paddingVertical: 40, }, draggableItem: { padding: 20, backgroundColor: "#1C1C1E", borderRadius: 12, borderWidth: 1, borderColor: "#3A3A3C", shadowColor: "#000", shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 4, elevation: 3, }, itemText: { color: "#FFFFFF", fontSize: 16, fontWeight: "600", textAlign: "center", }, dropZonesSection: { flex: 1, paddingVertical: 40, }, droppable: { marginBottom: 20, overflow: "hidden", borderRadius: 16, }, dropZone: { height: 140, borderWidth: 2, borderStyle: "dashed", borderRadius: 16, justifyContent: "center", alignItems: "center", padding: 20, }, dropZoneBlue: { borderColor: "#58a6ff", backgroundColor: "rgba(88, 166, 255, 0.08)", }, dropZoneGreen: { borderColor: "#3fb950", backgroundColor: "rgba(63, 185, 80, 0.08)", }, dropZoneActive: { backgroundColor: "rgba(255, 255, 255, 0.1)", borderStyle: "solid", transform: [{ scale: 1.02 }], }, dropZoneText: { color: "#FFFFFF", fontSize: 18, fontWeight: "600", textAlign: "center", marginBottom: 8, }, dropZoneSubtext: { color: "#8E8E93", fontSize: 14, textAlign: "center", }, });