From 2467bd866ea72b4f14a4480c0a2ac6b159499e4d Mon Sep 17 00:00:00 2001 From: czy0729 <402731062@qq.com> Date: Fri, 31 Dec 2021 19:33:59 +0800 Subject: [PATCH] - fixed Modal contain IOSHoldMenu bugs --- .../action-sheet/AndroidContainer.js | 14 ++------ src/components/popover/index.android.js | 2 +- src/screens/_/base/folder-manage-modal.js | 10 +++--- src/screens/_/base/popover.js | 33 +++++++++++++++++-- .../tinygrail/_/characters-modal/index.js | 6 ++-- src/screens/tinygrail/items/index.js | 2 +- tsconfig.json | 4 ++- 7 files changed, 47 insertions(+), 24 deletions(-) diff --git a/src/components/@/ant-design/action-sheet/AndroidContainer.js b/src/components/@/ant-design/action-sheet/AndroidContainer.js index 26d95aa28..f09b77295 100755 --- a/src/components/@/ant-design/action-sheet/AndroidContainer.js +++ b/src/components/@/ant-design/action-sheet/AndroidContainer.js @@ -29,13 +29,8 @@ class ActionSheetAndroid extends React.PureComponent { } render() { const { config, onAnimationEnd } = this.props - const { - title, - message, - options, - destructiveButtonIndex, - cancelButtonIndex - } = config + const { title, message, options, destructiveButtonIndex, cancelButtonIndex } = + config return ( @@ -58,11 +53,8 @@ class ActionSheetAndroid extends React.PureComponent { ) const content = options.map((item, index) => ( this.onToggle(item, detail, isIn)} /> )} - this.onControl(title, item)} @@ -802,7 +802,7 @@ export const FolderManageModal = ob( - + )} {item.id == create && ( @@ -938,7 +938,7 @@ export const FolderManageModal = ob( )} {!edit && !create && ( - this.onSubjectControl(title, i, item)} @@ -946,7 +946,7 @@ export const FolderManageModal = ob( - + )} diff --git a/src/screens/_/base/popover.js b/src/screens/_/base/popover.js index 79274dce1..e0722793d 100755 --- a/src/screens/_/base/popover.js +++ b/src/screens/_/base/popover.js @@ -2,14 +2,15 @@ * @Author: czy0729 * @Date: 2019-06-01 18:25:07 * @Last Modified by: czy0729 - * @Last Modified time: 2021-11-15 20:55:03 + * @Last Modified time: 2021-12-31 19:30:22 */ import React from 'react' import { Popover as CompPopover, Menu } from '@components' +import { Popover as CompPopoverOld } from '@components/popover/old' import { ob } from '@utils/decorators' import { IOS } from '@constants' -export const Popover = ob( +const Popover = ob( ({ data = [], menuStyle, onSelect = Function.prototype, children, ...other }) => { const popoverProps = IOS ? { @@ -25,6 +26,7 @@ export const Popover = ob( data, onSelect } + return ( {children} @@ -32,3 +34,30 @@ export const Popover = ob( ) } ) + +Popover.Old = ob( + ({ data = [], menuStyle, onSelect = Function.prototype, children, ...other }) => { + const popoverProps = IOS + ? { + overlay: ( + setTimeout(() => onSelect(title), 0)} + /> + ) + } + : { + data, + onSelect + } + + return ( + + {children} + + ) + } +) + +export { Popover } diff --git a/src/screens/tinygrail/_/characters-modal/index.js b/src/screens/tinygrail/_/characters-modal/index.js index 49a5ce234..6b6950027 100755 --- a/src/screens/tinygrail/_/characters-modal/index.js +++ b/src/screens/tinygrail/_/characters-modal/index.js @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2020-06-28 14:02:31 * @Last Modified by: czy0729 - * @Last Modified time: 2021-11-23 04:35:46 + * @Last Modified time: 2021-12-31 19:31:44 */ import React from 'react' import { BackHandler, View, Alert, StatusBar } from 'react-native' @@ -792,7 +792,7 @@ class CharactersModal extends React.Component { renderFilter(filter, data, map, onSelect) { return ( - { @@ -811,7 +811,7 @@ class CharactersModal extends React.Component { {map[filter] ? ` (${map[filter]})` : ''} - + ) } diff --git a/src/screens/tinygrail/items/index.js b/src/screens/tinygrail/items/index.js index de77cbc94..9d475a061 100755 --- a/src/screens/tinygrail/items/index.js +++ b/src/screens/tinygrail/items/index.js @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2020-03-05 17:59:15 * @Last Modified by: czy0729 - * @Last Modified time: 2021-11-21 02:36:09 + * @Last Modified time: 2021-12-31 19:18:04 */ import React from 'react' import { ScrollView, View } from 'react-native' diff --git a/tsconfig.json b/tsconfig.json index d2bb86278..6f1c2b74e 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,9 @@ "@constants": ["src/constants"], "@constants/*": ["src/constants/*"], "@styles": ["src/styles"], - "@styles/*": ["src/styles/*"] + "@styles/*": ["src/styles/*"], + "@tinygrail": ["src/screens/tinygrail"], + "@tinygrail/*": ["src/screens/tinygrail/*"] }, "allowJs": true, "esModuleInterop": true,