mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
update ActionSheet
This commit is contained in:
@@ -60,8 +60,8 @@ export const ActionSheetColorsSection = ({item, close}) => {
|
|||||||
eSendEvent(refreshNotesPage);
|
eSendEvent(refreshNotesPage);
|
||||||
}}
|
}}
|
||||||
customStyle={{
|
customStyle={{
|
||||||
width: DDS.isTab ? 400 / 10 : dWidth / 10,
|
width: DDS.isTab ? 400 / 10 : dWidth / 9,
|
||||||
height: DDS.isTab ? 400 / 10 : dWidth / 10,
|
height: DDS.isTab ? 400 / 10 : dWidth / 9,
|
||||||
borderRadius: 100,
|
borderRadius: 100,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, View } from 'react-native';
|
import {Platform, View} from 'react-native';
|
||||||
import ActionSheet from 'react-native-actions-sheet';
|
import ActionSheet from 'react-native-actions-sheet';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||||
import { useTracked } from '../../provider';
|
import {useTracked} from '../../provider';
|
||||||
import { useSettingStore } from '../../provider/stores';
|
import {useSettingStore} from '../../provider/stores';
|
||||||
import { editing } from '../../utils';
|
import {editing} from '../../utils';
|
||||||
import { hexToRGBA } from '../../utils/ColorUtils';
|
import {hexToRGBA} from '../../utils/ColorUtils';
|
||||||
import { sleep } from '../../utils/TimeUtils';
|
import {sleep} from '../../utils/TimeUtils';
|
||||||
import { EditorWebView, textInput } from '../../views/Editor/Functions';
|
import {EditorWebView, textInput} from '../../views/Editor/Functions';
|
||||||
import tiny from '../../views/Editor/tiny/tiny';
|
import tiny from '../../views/Editor/tiny/tiny';
|
||||||
import { focusEditor } from '../../views/Editor/tiny/toolbar/constants';
|
import {focusEditor} from '../../views/Editor/tiny/toolbar/constants';
|
||||||
import { Toast } from '../Toast';
|
import {Toast} from '../Toast';
|
||||||
import { GetPremium } from './GetPremium';
|
import {GetPremium} from './GetPremium';
|
||||||
|
|
||||||
const ActionSheetWrapper = ({
|
const ActionSheetWrapper = ({
|
||||||
children,
|
children,
|
||||||
@@ -20,13 +20,14 @@ const ActionSheetWrapper = ({
|
|||||||
onClose,
|
onClose,
|
||||||
onOpen,
|
onOpen,
|
||||||
closeOnTouchBackdrop = true,
|
closeOnTouchBackdrop = true,
|
||||||
onHasReachedTop
|
onHasReachedTop,
|
||||||
|
keyboardMode,
|
||||||
}) => {
|
}) => {
|
||||||
const [state] = useTracked();
|
const [state] = useTracked();
|
||||||
const {colors} = state;
|
const {colors} = state;
|
||||||
const deviceMode = useSettingStore(state => state.deviceMode);
|
const deviceMode = useSettingStore(state => state.deviceMode);
|
||||||
const largeTablet = deviceMode === "tablet"
|
const largeTablet = deviceMode === 'tablet';
|
||||||
const smallTablet = deviceMode === "smallTablet"
|
const smallTablet = deviceMode === 'smallTablet';
|
||||||
|
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const style = React.useMemo(() => {
|
const style = React.useMemo(() => {
|
||||||
@@ -34,8 +35,8 @@ const ActionSheetWrapper = ({
|
|||||||
width: largeTablet || smallTablet ? 500 : '100%',
|
width: largeTablet || smallTablet ? 500 : '100%',
|
||||||
backgroundColor: colors.bg,
|
backgroundColor: colors.bg,
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
paddingTop:10,
|
paddingTop: 10,
|
||||||
paddingBottom:0,
|
paddingBottom: 0,
|
||||||
borderBottomRightRadius: largeTablet ? 10 : 1,
|
borderBottomRightRadius: largeTablet ? 10 : 1,
|
||||||
borderBottomLeftRadius: largeTablet ? 10 : 1,
|
borderBottomLeftRadius: largeTablet ? 10 : 1,
|
||||||
borderTopRightRadius: 10,
|
borderTopRightRadius: 10,
|
||||||
@@ -75,6 +76,8 @@ const ActionSheetWrapper = ({
|
|||||||
initialOffsetFromBottom={1}
|
initialOffsetFromBottom={1}
|
||||||
onPositionChanged={onHasReachedTop}
|
onPositionChanged={onHasReachedTop}
|
||||||
closeOnTouchBackdrop={closeOnTouchBackdrop}
|
closeOnTouchBackdrop={closeOnTouchBackdrop}
|
||||||
|
keyboardMode={keyboardMode}
|
||||||
|
closeOnPressBack={closeOnTouchBackdrop}
|
||||||
indicatorColor={
|
indicatorColor={
|
||||||
Platform.OS === 'ios'
|
Platform.OS === 'ios'
|
||||||
? hexToRGBA(colors.accent + '19')
|
? hexToRGBA(colors.accent + '19')
|
||||||
@@ -94,7 +97,7 @@ const ActionSheetWrapper = ({
|
|||||||
}
|
}
|
||||||
onClose={_onClose}>
|
onClose={_onClose}>
|
||||||
{children}
|
{children}
|
||||||
<View style={{height: Platform.OS === 'ios' ? insets.bottom / 2 :0}} />
|
<View style={{height: Platform.OS === 'ios' ? insets.bottom / 2 : 0}} />
|
||||||
</ActionSheet>
|
</ActionSheet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
import React, {useEffect, useState} from 'react';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
|
||||||
Clipboard,
|
Clipboard,
|
||||||
Dimensions,
|
Dimensions,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
@@ -44,7 +43,6 @@ import {SIZE} from '../../utils/SizeUtils';
|
|||||||
import {sleep, timeConverter} from '../../utils/TimeUtils';
|
import {sleep, timeConverter} from '../../utils/TimeUtils';
|
||||||
import {Button} from '../Button';
|
import {Button} from '../Button';
|
||||||
import {presentDialog} from '../Dialog/functions';
|
import {presentDialog} from '../Dialog/functions';
|
||||||
import {PressableButton} from '../PressableButton';
|
|
||||||
import Heading from '../Typography/Heading';
|
import Heading from '../Typography/Heading';
|
||||||
import Paragraph from '../Typography/Paragraph';
|
import Paragraph from '../Typography/Paragraph';
|
||||||
import {ActionSheetColorsSection} from './ActionSheetColorsSection';
|
import {ActionSheetColorsSection} from './ActionSheetColorsSection';
|
||||||
@@ -57,7 +55,6 @@ export const ActionSheetComponent = ({
|
|||||||
hasColors = false,
|
hasColors = false,
|
||||||
hasTags = false,
|
hasTags = false,
|
||||||
rowItems = [],
|
rowItems = [],
|
||||||
columnItems = [],
|
|
||||||
getRef,
|
getRef,
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
@@ -515,7 +512,6 @@ export const ActionSheetComponent = ({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const columnItemsData = [];
|
|
||||||
let columnsCount = rowItems.length < 5 ? rowItems.length : 5;
|
let columnsCount = rowItems.length < 5 ? rowItems.length : 5;
|
||||||
const _renderRowItem = rowItem => (
|
const _renderRowItem = rowItem => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
@@ -772,10 +768,13 @@ export const ActionSheetComponent = ({
|
|||||||
data={rowItemsData.filter(
|
data={rowItemsData.filter(
|
||||||
i => rowItems.indexOf(i.name) > -1 && !i.hidden,
|
i => rowItems.indexOf(i.name) > -1 && !i.hidden,
|
||||||
)}
|
)}
|
||||||
keyExtractor={(item) => item.title}
|
keyExtractor={item => item.title}
|
||||||
numColumns={rowItems.length < 5 ? rowItems.length : 5}
|
numColumns={rowItems.length < 5 ? rowItems.length : 5}
|
||||||
style={{
|
style={{
|
||||||
marginTop: note.type !== 'note' ? 10 : 0,
|
marginTop: note.type !== 'note' ? 10 : 0,
|
||||||
|
borderTopWidth: 1,
|
||||||
|
borderColor: colors.nav,
|
||||||
|
paddingTop: 20,
|
||||||
}}
|
}}
|
||||||
columnWrapperStyle={{
|
columnWrapperStyle={{
|
||||||
justifyContent: 'flex-start',
|
justifyContent: 'flex-start',
|
||||||
|
|||||||
Reference in New Issue
Block a user