diff --git a/packages/components/Menu/Menu.tsx b/packages/components/Menu.tsx similarity index 76% rename from packages/components/Menu/Menu.tsx rename to packages/components/Menu.tsx index e678a8601b..111241421c 100644 --- a/packages/components/Menu/Menu.tsx +++ b/packages/components/Menu.tsx @@ -1,14 +1,16 @@ import React, { useRef } from "react"; import { View, TouchableOpacity } from "react-native"; -import { useDropdowns } from "../../context/DropdownsProvider"; -import { neutral33 } from "../../utils/style/colors"; -import { BrandText } from "../BrandText"; -import { PrimaryBox } from "../boxes/PrimaryBox"; +import { BrandText } from "./BrandText"; +import { PrimaryBox } from "./boxes/PrimaryBox"; +import { useDropdowns } from "../context/DropdownsProvider"; +import { neutral33 } from "../utils/style/colors"; +import { fontSemibold13 } from "../utils/style/fonts"; +import { layout } from "../utils/style/layout"; const DEFAULT_WIDTH = 164; -export interface MenuProps { +interface MenuProps { component: React.ReactNode; items: { label: string; @@ -39,7 +41,7 @@ export const Menu: React.FC = ({ style={{ position: "absolute", right: 0, bottom: -20 }} mainContainerStyle={{ position: "absolute", - paddingHorizontal: 12, + paddingHorizontal: layout.spacing_x1_5, }} > {items.map((item, index) => ( @@ -52,7 +54,7 @@ export const Menu: React.FC = ({ }} activeOpacity={0.7} style={[ - { paddingVertical: 12, width: "100%" }, + { paddingVertical: layout.spacing_x1_5, width: "100%" }, index !== items.length - 1 && { borderBottomWidth: 1, borderColor: neutral33, @@ -60,12 +62,7 @@ export const Menu: React.FC = ({ ]} > {item.label} diff --git a/packages/components/Menu/Menu.web.tsx b/packages/components/Menu/Menu.web.tsx deleted file mode 100644 index f771bf1254..0000000000 --- a/packages/components/Menu/Menu.web.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import React, { useRef } from "react"; -import { View, TouchableOpacity } from "react-native"; - -import { useDropdowns } from "../../context/DropdownsProvider"; -import { neutral33 } from "../../utils/style/colors"; -import { BrandText } from "../BrandText"; -import { PrimaryBox } from "../boxes/PrimaryBox"; -import { MenuProps } from "./Menu"; - -const DEFAULT_WIDTH = 164; - -export const Menu: React.FC = ({ - items, - component, - width = DEFAULT_WIDTH, -}) => { - const { onPressDropdownButton, isDropdownOpen, closeOpenedDropdown } = - useDropdowns(); - const dropdownRef = useRef(null); - - return ( - - onPressDropdownButton(dropdownRef)} - activeOpacity={0.7} - > - {component} - - {isDropdownOpen(dropdownRef) && ( - - - {items.map((item, index) => ( - { - closeOpenedDropdown(); - item.onPress(); - }} - activeOpacity={0.7} - style={[ - { paddingVertical: 12, width: "100%" }, - index !== items.length - 1 && { - borderBottomWidth: 1, - borderColor: neutral33, - }, - ]} - > - - {item.label} - - - ))} - - - )} - - ); -}; diff --git a/packages/components/Menu/index.tsx b/packages/components/Menu/index.tsx deleted file mode 100644 index 878ca6e96b..0000000000 --- a/packages/components/Menu/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Menu } from "./Menu";