Skip to content

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

update result dialog

ammarahm-ed4baf50df415e
diff --git a/apps/mobile/src/components/ResultDialog/ProFeatures.js b/apps/mobile/src/components/ResultDialog/ProFeatures.js
index 86c0c5188..ada37f877 100644
--- a/apps/mobile/src/components/ResultDialog/ProFeatures.js
+++ b/apps/mobile/src/components/ResultDialog/ProFeatures.js
@@ -2,7 +2,10 @@ import React from 'react';
import {View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
+import {eSendEvent} from '../../services/EventManager';
+import {eCloseResultDialog, eOpenPremiumDialog} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
+import {sleep} from '../../utils/TimeUtils';
import Paragraph from '../Typography/Paragraph';
export const ProFeatures = () => {
const [state, dispatch] = useTracked();
@@ -33,7 +36,7 @@ export const ProFeatures = () => {
flexDirection: 'row',
width: '100%',
height: 40,
- paddingHorizontal: 12,
+ paddingHorizontal: 24,
marginBottom: 10,
alignItems: 'center',
borderRadius: 5
@@ -43,7 +46,11 @@ export const ProFeatures = () => {
</View>
))}
<Paragraph
- onPress={() => {}}
+ onPress={async () => {
+ eSendEvent(eCloseResultDialog);
+ await sleep(300);
+ eSendEvent(eOpenPremiumDialog);
+ }}
size={SIZE.xs + 2}
style={{
textDecorationLine: 'underline',
diff --git a/apps/mobile/src/components/ResultDialog/index.js b/apps/mobile/src/components/ResultDialog/index.js
index 6d6a65bba..e74432d0d 100644
--- a/apps/mobile/src/components/ResultDialog/index.js
+++ b/apps/mobile/src/components/ResultDialog/index.js
@@ -1,17 +1,17 @@
-import React, { useEffect, useState } from 'react';
-import { View } from 'react-native';
-import { useTracked } from '../../provider';
-import { DDS } from '../../services/DeviceDetection';
-import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
-import { getElevation } from '../../utils';
-import { eCloseResultDialog, eOpenResultDialog } from '../../utils/Events';
-import { ph, SIZE } from '../../utils/SizeUtils';
-import { Button } from '../Button';
+import React, {useEffect, useState} from 'react';
+import {View} from 'react-native';
+import {useTracked} from '../../provider';
+import {DDS} from '../../services/DeviceDetection';
+import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
+import {getElevation} from '../../utils';
+import {eCloseResultDialog, eOpenResultDialog} from '../../utils/Events';
+import {ph, SIZE} from '../../utils/SizeUtils';
+import {Button} from '../Button';
import BaseDialog from '../Dialog/base-dialog';
import Seperator from '../Seperator';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
-import { ProFeatures } from './pro-features';
+import {ProFeatures} from './pro-features';
const ResultDialog = () => {
const [state, dispatch] = useTracked();
@@ -35,7 +35,7 @@ const ResultDialog = () => {
const open = data => {
if (data) {
setDialogData(data);
- }
+ }
setVisible(true);
};
@@ -52,8 +52,7 @@ const ResultDialog = () => {
maxHeight: 500,
borderRadius: 10,
backgroundColor: colors.bg,
- paddingHorizontal: ph,
- paddingVertical: 20,
+ paddingTop: 20,
justifyContent: 'center',
alignItems: 'center'
}}>
@@ -64,8 +63,9 @@ const ResultDialog = () => {
alignSelf: 'center',
textAlign: 'center',
marginTop: 10,
- maxWidth: '80%',
- marginBottom: 10
+ maxWidth: '100%',
+ marginBottom: 10,
+ paddingHorizontal: 12
}}>
{dialogData.title}
</Heading>
@@ -87,14 +87,25 @@ const ResultDialog = () => {
<ProFeatures />
<Seperator />
- <Button
- title={dialogData.button}
- width="100%"
- onPress={close}
- type="accent"
- height={50}
- fontSize={SIZE.md}
- />
+ <View
+ style={{
+ backgroundColor: colors.nav,
+ width: '100%',
+ borderBottomRightRadius: 10,
+ borderBottomLeftRadius: 10,
+ paddingVertical: 10
+ }}>
+ <Button
+ title={dialogData.button}
+ width={null}
+ style={{
+ paddingHorizontal: 12
+ }}
+ onPress={close}
+ height={50}
+ fontSize={SIZE.md + 2}
+ />
+ </View>
</View>
</BaseDialog>
);