Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

move permium prompt out of display

ammarahm-ed76c061f9b25d
diff --git a/apps/mobile/src/components/ActionSheetComponent/GetPremium.js b/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
index 80a6a0002..1c00db8c7 100644
--- a/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
+++ b/apps/mobile/src/components/ActionSheetComponent/GetPremium.js
@@ -1,21 +1,22 @@
-import React, { useEffect, useState } from 'react';
-import { Platform, Text, View } from 'react-native';
-import Animated, { Easing } from 'react-native-reanimated';
-import { useTracked } from '../../provider';
+import React, {useEffect, useState} from 'react';
+import {Platform, Text, View} from 'react-native';
+import Animated, {Easing} from 'react-native-reanimated';
+import {useTracked} from '../../provider';
+import {DDS} from '../../services/DeviceDetection';
import {
eSendEvent,
eSubscribeEvent,
- eUnSubscribeEvent
+ eUnSubscribeEvent,
} from '../../services/EventManager';
-import { getElevation } from '../../utils';
-import { eOpenPremiumDialog, eShowGetPremium } from '../../utils/Events';
-import { SIZE } from '../../utils/SizeUtils';
-import { sleep } from '../../utils/TimeUtils';
-import { Button } from '../Button';
+import {dWidth, getElevation} from '../../utils';
+import {eOpenPremiumDialog, eShowGetPremium} from '../../utils/Events';
+import {SIZE} from '../../utils/SizeUtils';
+import {sleep} from '../../utils/TimeUtils';
+import {Button} from '../Button';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
-export const translatePrem = new Animated.Value(-800);
+export const translatePrem = new Animated.Value(-dWidth * 2);
export const GetPremium = ({close, context = 'global', offset = 0}) => {
const [state, dispatch] = useTracked();
@@ -39,12 +40,12 @@ export const GetPremium = ({close, context = 'global', offset = 0}) => {
setTimeout(async () => {
Animated.timing(translatePrem, {
- toValue: +800,
+ toValue: dWidth * 2,
duration: 150,
easing: Easing.inOut(Easing.ease),
}).start();
await sleep(200);
- translatePrem.setValue(-800);
+ translatePrem.setValue(-dWidth * 2);
}, 5000);
}
};
@@ -52,7 +53,7 @@ export const GetPremium = ({close, context = 'global', offset = 0}) => {
useEffect(() => {
eSubscribeEvent(eShowGetPremium, open);
return () => {
- translatePrem.setValue(-800)
+ translatePrem.setValue(-dWidth * 2);
eUnSubscribeEvent(eShowGetPremium, open);
};
}, []);
@@ -65,13 +66,13 @@ export const GetPremium = ({close, context = 'global', offset = 0}) => {
zIndex: 999,
...getElevation(10),
padding: 12,
- paddingVertical:20,
+ paddingVertical: 20,
borderRadius: 5,
flexDirection: 'row',
alignSelf: 'center',
justifyContent: 'space-between',
top: offset,
- maxWidth: '100%',
+ maxWidth: DDS.isLargeTablet() ? 400 : '100%',
transform: [
{
translateX: translatePrem,
@@ -89,11 +90,9 @@ export const GetPremium = ({close, context = 'global', offset = 0}) => {
{msg.title}
</Heading>
- <Text>
- <Paragraph style={{margin: 0}} size={SIZE.sm} color="white">
- {msg.desc}
- </Paragraph>
- </Text>
+ <Paragraph style={{margin: 0}} size={SIZE.sm} color="white">
+ {msg.desc}
+ </Paragraph>
</View>
<Button