mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix dialog width and height on tablet
This commit is contained in:
@@ -3,7 +3,7 @@ import {Modal, Text, TouchableOpacity, View} from 'react-native';
|
||||
import {TextInput} from 'react-native-gesture-handler';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
|
||||
import {getElevation, ToastEvent, db} from '../../utils/utils';
|
||||
import {getElevation, ToastEvent, db, DDS} from '../../utils/utils';
|
||||
import {eSendEvent} from '../../services/eventManager';
|
||||
import {eOnNewTopicAdded} from '../../services/events';
|
||||
import {Toast} from '../Toast';
|
||||
@@ -68,7 +68,7 @@ export class AddTopicDialog extends React.Component {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(5),
|
||||
width: '80%',
|
||||
width:DDS.isTab? 350 : '80%',
|
||||
maxHeight: 350,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
@@ -118,7 +118,7 @@ const ExportDialog = () => {
|
||||
<View
|
||||
style={[
|
||||
{
|
||||
width: DDS.isTab ? '40%' : '80%',
|
||||
width: DDS.isTab ? 350 : '80%',
|
||||
backgroundColor: colors.bg,
|
||||
},
|
||||
styles.container,
|
||||
|
||||
@@ -237,6 +237,7 @@ const LoginDialog = () => {
|
||||
justifyContent: 'center',
|
||||
borderRadius: DDS.isTab ? 5 : 0,
|
||||
zIndex: 10,
|
||||
...getElevation(5),
|
||||
}}>
|
||||
<Toast context="local" />
|
||||
{loggingIn || signingIn ? (
|
||||
|
||||
@@ -110,7 +110,9 @@ export const Menu = ({
|
||||
opacity: hide ? 0 : 1,
|
||||
width: '100%',
|
||||
backgroundColor: colors.bg,
|
||||
paddingTop:insets.top
|
||||
paddingTop:insets.top,
|
||||
borderRightWidth:1,
|
||||
borderRightColor:colors.nav
|
||||
}}>
|
||||
<ScrollView
|
||||
alwaysBounceVertical={false}
|
||||
|
||||
@@ -114,8 +114,8 @@ const MoveNoteDialog = () => {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(DDS.isTab ? 10 : 0),
|
||||
width: DDS.isTab ? '65%' : '100%',
|
||||
height: DDS.isTab ? '90%' : '100%',
|
||||
width: DDS.isTab ? 500 : '100%',
|
||||
height: DDS.isTab ? 500 : '100%',
|
||||
flex: 1,
|
||||
borderRadius: DDS.isTab ? 5 : 0,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
@@ -15,6 +15,7 @@ class PremiumDialog extends React.Component {
|
||||
this.state = {
|
||||
user: null,
|
||||
product: null,
|
||||
scrollEnabled: false,
|
||||
};
|
||||
this.routeIndex = 0;
|
||||
this.count = 0;
|
||||
@@ -25,6 +26,7 @@ class PremiumDialog extends React.Component {
|
||||
this.subsriptionErrorListener = RNIap.purchaseErrorListener(
|
||||
this.onSubscriptionError,
|
||||
);
|
||||
this.prevScroll = 0;
|
||||
}
|
||||
|
||||
open() {
|
||||
@@ -37,7 +39,7 @@ class PremiumDialog extends React.Component {
|
||||
async componentDidMount() {
|
||||
let u = await db.user.get();
|
||||
let prod = await RNIap.getSubscriptions(itemSkus);
|
||||
console.log(prod);
|
||||
//console.log(prod);
|
||||
this.setState({
|
||||
user: u && u.Id ? u : null,
|
||||
product: prod[0],
|
||||
@@ -69,11 +71,9 @@ class PremiumDialog extends React.Component {
|
||||
width: DDS.isTab ? 500 : '100%',
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
|
||||
marginBottom: DDS.isTab ? 50 : 0,
|
||||
}}
|
||||
extraScroll={DDS.isTab ? 50 : 0}
|
||||
gestureEnabled={true}
|
||||
footerAlwaysVisible={DDS.isTab}
|
||||
footerHeight={DDS.isTab ? 20 : 10}
|
||||
footerStyle={
|
||||
@@ -111,10 +111,8 @@ class PremiumDialog extends React.Component {
|
||||
<ScrollView
|
||||
style={{
|
||||
width: '100%',
|
||||
maxHeight:DDS.isTab? h * 0.35 : h * 0.5,
|
||||
}}
|
||||
nestedScrollEnabled={true}
|
||||
showsVerticalScrollIndicator={false}>
|
||||
maxHeight: DDS.isTab ? h * 0.35 : h * 0.5,
|
||||
}}>
|
||||
{[
|
||||
{
|
||||
title: 'Cross Platfrom Sync',
|
||||
|
||||
@@ -4,7 +4,7 @@ import {ph, SIZE, WEIGHT} from '../../common/common';
|
||||
import {useTracked} from '../../provider';
|
||||
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';
|
||||
import {eOpenProgressDialog, eCloseProgressDialog} from '../../services/events';
|
||||
import {getElevation} from '../../utils/utils';
|
||||
import {DDS, getElevation} from '../../utils/utils';
|
||||
import BaseDialog from '../Dialog/base-dialog';
|
||||
import {Loading} from '../Loading';
|
||||
|
||||
@@ -39,7 +39,7 @@ const ProgressDialog = () => {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(5),
|
||||
width: '80%',
|
||||
width: DDS.isTab? 350 : '80%',
|
||||
maxHeight: 350,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {FlatList, Text, View} from 'react-native';
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import RNFetchBlob from 'rn-fetch-blob';
|
||||
import {ph, SIZE, WEIGHT} from '../../common/common';
|
||||
import {useTracked} from '../../provider';
|
||||
@@ -11,11 +10,13 @@ import {eCloseRestoreDialog, eOpenRestoreDialog} from '../../services/events';
|
||||
import storage from '../../utils/storage';
|
||||
import {
|
||||
db,
|
||||
DDS,
|
||||
getElevation,
|
||||
requestStoragePermission,
|
||||
sleep,
|
||||
ToastEvent,
|
||||
} from '../../utils/utils';
|
||||
import {ActionIcon} from '../ActionIcon';
|
||||
import {Button} from '../Button';
|
||||
import BaseDialog from '../Dialog/base-dialog';
|
||||
import {Loading} from '../Loading';
|
||||
@@ -68,8 +69,8 @@ const RestoreDialog = () => {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(5),
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
width: DDS.isTab ? 500 : '100%',
|
||||
height: DDS.isTab ? 500 : '100%',
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
paddingHorizontal: 12,
|
||||
@@ -107,19 +108,18 @@ const RestoreDialog = () => {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
height: 50,
|
||||
marginTop: insets.top,
|
||||
marginTop: DDS.isTab ? 0 : insets.top,
|
||||
}}>
|
||||
<Icon
|
||||
<ActionIcon
|
||||
name="close"
|
||||
size={SIZE.xxl}
|
||||
onPress={close}
|
||||
style={{
|
||||
width: 50,
|
||||
height: 50,
|
||||
customStyle={{
|
||||
width: 40,
|
||||
height: 40,
|
||||
position: 'absolute',
|
||||
textAlignVertical: 'center',
|
||||
left: 0,
|
||||
marginBottom: 15,
|
||||
}}
|
||||
color={colors.heading}
|
||||
/>
|
||||
|
||||
@@ -263,7 +263,7 @@ export class VaultDialog extends Component {
|
||||
<View
|
||||
style={{
|
||||
...getElevation(5),
|
||||
width: '80%',
|
||||
width: DDS.isTab ? 350 : '80%',
|
||||
maxHeight: 350,
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
Reference in New Issue
Block a user