@wereform/pkgm-shared 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.MenuInteraction=void 0;var _reactNative=require("react-native");var _MenuInteractionStyles=require("../../styles/MenuInteractionStyles");var _vectorIcons=require("@expo/vector-icons");var _react=require("react");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="F:\\WeReform Corporation\\Products\\BEGENONE\\App\\Mobile\\packages\\begenone-pkgm-shared\\src\\components\\menus\\MenuInteraction.jsx";var MenuInteraction=exports.MenuInteraction=function MenuInteraction(_ref){var containerStyles=_ref.containerStyles,columnMainIconStyles=_ref.columnMainIconStyles,pressed=_ref.pressed;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[_MenuInteractionStyles.MenuInteractionStyles.container,containerStyles],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[_MenuInteractionStyles.MenuInteractionStyles.column_mainIcons,columnMainIconStyles],children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_MenuInteractionStyles.MenuInteractionStyles.icon,children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"arrow-redo",size:24,color:"white"})})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_MenuInteractionStyles.MenuInteractionStyles.icon,children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"chatbubble-ellipses",size:24,color:"white"})})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_MenuInteractionStyles.MenuInteractionStyles.icon,children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"repeat-outline",size:24,color:"white"})})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_MenuInteractionStyles.MenuInteractionStyles.icon,children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"thumbs-up-outline",size:24,color:"white"})})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:_MenuInteractionStyles.MenuInteractionStyles.icon,children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"thumbs-down-outline",size:24,color:"white"})})})]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:function onPress(){return pressed(true);},children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"ellipsis-vertical-outline",size:24,color:"white"})})]});};
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.MenuInteractionStyles2=exports.MenuInteraction=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _reactNative=require("react-native");var _MenuInteractionStyles=require("../../styles/MenuInteractionStyles");var _vectorIcons=require("@expo/vector-icons");var _react=require("react");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="F:\\WeReform Corporation\\Products\\BEGENONE\\App\\Mobile\\packages\\begenone-pkgm-shared\\src\\components\\menus\\MenuInteraction.jsx";var MenuInteraction=exports.MenuInteraction=function MenuInteraction(_ref){var containerStyles=_ref.containerStyles,columnMainIconStyles=_ref.columnMainIconStyles,pressed=_ref.pressed,canDelete=_ref.canDelete,onDelete=_ref.onDelete;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),open=_useState2[0],setOpen=_useState2[1];return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[_MenuInteractionStyles.MenuInteractionStyles.container,containerStyles],children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:function onPress(){setOpen(!open);pressed==null?void 0:pressed(true);},children:(0,_jsxRuntime.jsx)(_vectorIcons.Ionicons,{name:"ellipsis-vertical-outline",size:24,color:"white"})}),open&&canDelete&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:MenuInteractionStyles2.menu,children:(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:function onPress(){setOpen(false);onDelete();},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:MenuInteractionStyles2.deleteText,children:"Delete"})})})]});};var MenuInteractionStyles2=exports.MenuInteractionStyles2=_reactNative.StyleSheet.create({menu:{position:"absolute",top:28,right:0,backgroundColor:"#1c1c1e",borderRadius:8,paddingVertical:8,paddingHorizontal:12,minWidth:120,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:0.25,shadowRadius:6,elevation:6},deleteText:{color:"#ff4d4f",fontSize:15,fontWeight:"600",textAlign:"center"}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wereform/pkgm-shared",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "source": "dist/index.js",
5
5
  "main": "dist/index.js",
6
6
  "react-native": "dist/index.js",
@@ -1,7 +1,8 @@
1
- import { TouchableOpacity, View } from "react-native";
1
+ import { Text, TouchableOpacity, View } from "react-native";
2
2
  import { MenuInteractionStyles } from "../../styles/MenuInteractionStyles";
3
3
  import { Ionicons } from "@expo/vector-icons";
4
4
  import { useState } from "react";
5
+ import { StyleSheet } from "react-native";
5
6
 
6
7
  /**
7
8
  * MenuInteraction
@@ -23,10 +24,14 @@ export const MenuInteraction = ({
23
24
  containerStyles,
24
25
  columnMainIconStyles,
25
26
  pressed,
27
+ canDelete,
28
+ onDelete,
26
29
  }) => {
30
+ const [open, setOpen] = useState(false);
31
+
27
32
  return (
28
33
  <View style={[MenuInteractionStyles.container, containerStyles]}>
29
- <View
34
+ {/* <View
30
35
  style={[MenuInteractionStyles.column_mainIcons, columnMainIconStyles]}
31
36
  >
32
37
  <TouchableOpacity>
@@ -58,11 +63,56 @@ export const MenuInteraction = ({
58
63
  <Ionicons name="thumbs-down-outline" size={24} color="white" />
59
64
  </View>
60
65
  </TouchableOpacity>
61
- </View>
66
+ </View> */}
62
67
 
63
- <TouchableOpacity onPress={() => pressed(true)}>
68
+ <TouchableOpacity
69
+ onPress={() => {
70
+ setOpen(!open);
71
+ pressed?.(true);
72
+ }}
73
+ >
64
74
  <Ionicons name="ellipsis-vertical-outline" size={24} color="white" />
65
75
  </TouchableOpacity>
76
+
77
+ {open && canDelete && (
78
+ <View style={MenuInteractionStyles2.menu}>
79
+ <TouchableOpacity
80
+ onPress={() => {
81
+ setOpen(false);
82
+ onDelete();
83
+ }}
84
+ >
85
+ <Text style={MenuInteractionStyles2.deleteText}>Delete</Text>
86
+ </TouchableOpacity>
87
+ </View>
88
+ )}
66
89
  </View>
67
90
  );
68
91
  };
92
+
93
+ export const MenuInteractionStyles2 = StyleSheet.create({
94
+ menu: {
95
+ position: "absolute",
96
+ top: 28, // below the ellipsis
97
+ right: 0,
98
+ backgroundColor: "#1c1c1e", // dark neutral
99
+ borderRadius: 8,
100
+ paddingVertical: 8,
101
+ paddingHorizontal: 12,
102
+ minWidth: 120,
103
+
104
+ // subtle elevation
105
+ shadowColor: "#000",
106
+ shadowOffset: { width: 0, height: 4 },
107
+ shadowOpacity: 0.25,
108
+ shadowRadius: 6,
109
+ elevation: 6,
110
+ },
111
+
112
+ deleteText: {
113
+ color: "#ff4d4f", // destructive red
114
+ fontSize: 15,
115
+ fontWeight: "600",
116
+ textAlign: "center",
117
+ },
118
+ });