mobile: show loading after welcome page

This commit is contained in:
ammarahm-ed
2022-10-19 15:56:31 +05:00
parent 71b2034195
commit 228adb0375
5 changed files with 138 additions and 25 deletions

View File

@@ -26,6 +26,7 @@ import AuthModal from "../auth/auth-modal";
import { SessionExpired } from "../auth/session-expired";
import { Dialog } from "../dialog";
import { AddTopicDialog } from "../dialogs/add-topic";
import { LoadingDialog } from "../dialogs/loading";
import ResultDialog from "../dialogs/result";
import { VaultDialog } from "../dialogs/vault";
import ImagePreview from "../image-preview";
@@ -47,6 +48,7 @@ const DialogProvider = () => {
return (
<>
<LoadingDialog />
<Dialog context="global" />
<AddTopicDialog colors={colors} />
<AddNotebookSheet colors={colors} />

View File

@@ -0,0 +1,88 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { View } from "react-native";
import { useThemeStore } from "../../../stores/use-theme-store";
import BaseDialog from "../../dialog/base-dialog";
import { ProgressBarComponent } from "../../ui/svg/lazy";
import { useEffect } from "react";
import {
eSubscribeEvent,
eUnSubscribeEvent
} from "../../../services/event-manager";
import { useState } from "react";
import { eCloseLoading, eOpenLoading } from "../../../utils/events";
export const LoadingDialog = () => {
const colors = useThemeStore((state) => state.colors);
const [visible, setVisible] = useState(false);
useEffect(() => {
eSubscribeEvent(eOpenLoading, open);
eSubscribeEvent(eCloseLoading, close);
return () => {
eUnSubscribeEvent(eOpenLoading, open);
eUnSubscribeEvent(eCloseLoading, close);
};
}, []);
const open = () => setVisible(true);
const close = () => setVisible(false);
return (
<BaseDialog
animated={false}
bounce={false}
visible={visible}
onRequestClose={undefined}
onShow={undefined}
premium={undefined}
transparent={undefined}
>
<View
style={{
width: "100%",
height: "100%",
backgroundColor: colors.bg,
justifyContent: "center",
alignItems: "center"
}}
>
<View
style={{
flexDirection: "row",
width: 100,
marginTop: 15
}}
>
<ProgressBarComponent
height={5}
width={100}
animated={true}
useNativeDriver
indeterminate
indeterminateAnimationDuration={2000}
unfilledColor={colors.nav}
color={colors.accent}
borderWidth={0}
/>
</View>
</View>
</BaseDialog>
);
};

File diff suppressed because one or more lines are too long

View File

@@ -155,3 +155,6 @@ export const eOpenTrialEndingDialog = "602";
export const eOpenAnnouncementDialog = "603";
export const eCloseAnnouncementDialog = "604";
export const eOpenLoading = "605";
export const eCloseLoading = "606";

View File

@@ -1,7 +1,7 @@
PODS:
- Base64 (1.1.2)
- boost (1.76.0)
- callstack-repack (3.0.0-next.7):
- callstack-repack (3.0.0):
- React-Core
- DoubleConversion (1.1.6)
- FBLazyVector (0.69.4)
@@ -233,9 +233,9 @@ PODS:
- React-Core
- react-native-begin-background-task (0.1.0):
- React
- react-native-config (1.4.6):
- react-native-config/App (= 1.4.6)
- react-native-config/App (1.4.6):
- react-native-config (1.4.11):
- react-native-config/App (= 1.4.11)
- react-native-config/App (1.4.11):
- React-Core
- react-native-document-picker (7.1.3):
- React-Core
@@ -256,7 +256,7 @@ PODS:
- React-Core
- react-native-orientation (3.1.3):
- React
- react-native-safe-area-context (4.3.3):
- react-native-safe-area-context (4.4.1):
- RCT-Folly
- RCTRequired
- RCTTypeSafety
@@ -264,7 +264,7 @@ PODS:
- ReactCommon/turbomodule/core
- react-native-sodium (1.0.0):
- React
- react-native-webview (11.23.0):
- react-native-webview (11.23.1):
- React-Core
- React-perflogger (0.69.4)
- React-RCTActionSheet (0.69.4):
@@ -342,9 +342,9 @@ PODS:
- React-Core
- RNCCheckbox (0.5.12):
- React-Core
- RNCClipboard (1.11.0):
- RNCClipboard (1.11.1):
- React-Core
- RNCMaskedView (0.2.7):
- RNCMaskedView (0.2.8):
- React-Core
- RNCPushNotificationIOS (1.10.1):
- React-Core
@@ -354,7 +354,7 @@ PODS:
- React
- RNFileViewer (2.1.5):
- React-Core
- RNGestureHandler (2.6.0):
- RNGestureHandler (2.7.1):
- React-Core
- RNIap (5.2.14):
- React-Core
@@ -389,12 +389,12 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.17.0):
- RNScreens (3.18.2):
- React-Core
- React-RCTImage
- RNSecureRandom (1.0.0):
- RNSecureRandom (1.0.1):
- React
- RNShare (7.9.0):
- RNShare (7.9.1):
- React-Core
- RNSVG (12.4.4):
- React-Core
@@ -404,8 +404,16 @@ PODS:
- SexyTooltip
- RNVectorIcons (9.2.0):
- React-Core
- RNZipArchive (6.0.8):
- React-Core
- RNZipArchive/Core (= 6.0.8)
- SSZipArchive (= 2.2.3)
- RNZipArchive/Core (6.0.8):
- React-Core
- SSZipArchive (= 2.2.3)
- SexyTooltip (1.2.5):
- pop (~> 1.0)
- SSZipArchive (2.2.3)
- toolbar-android (0.2.1):
- React
- Yoga (1.14.0)
@@ -484,6 +492,7 @@ DEPENDENCIES:
- RNSVG (from `../../node_modules/react-native-svg`)
- RNTooltips (from `../../node_modules/react-native-tooltips`)
- RNVectorIcons (from `../../node_modules/react-native-vector-icons`)
- RNZipArchive (from `../../node_modules/react-native-zip-archive`)
- SexyTooltip (from `https://github.com/ammarahm-ed/SexyTooltip.git`)
- "toolbar-android (from `../../node_modules/@react-native-community/toolbar-android`)"
- Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
@@ -495,6 +504,7 @@ SPEC REPOS:
- MMKV
- MMKVCore
- pop
- SSZipArchive
EXTERNAL SOURCES:
boost:
@@ -637,6 +647,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/react-native-tooltips"
RNVectorIcons:
:path: "../../node_modules/react-native-vector-icons"
RNZipArchive:
:path: "../../node_modules/react-native-zip-archive"
SexyTooltip:
:git: https://github.com/ammarahm-ed/SexyTooltip.git
toolbar-android:
@@ -652,7 +664,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
Base64: cecfb41a004124895a7bcee567a89bae5a89d49b
boost: a7c83b31436843459a1961bfd74b96033dc77234
callstack-repack: 7c41c0f994c10d7da28a4de57e508a180fa8bf9d
callstack-repack: 9e5425dfffeda7ea87b71729c4097141c7d8ce1c
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: c71b8c429a8af2aff1013934a7152e9d9d0c937d
FBReactNativeSpec: 27afe40d1013e4eb78dbac657709f851163c7c7e
@@ -678,7 +690,7 @@ SPEC CHECKSUMS:
react-native-actions-shortcuts: 5d9cf0c9c308333dfcc1e05c3f9afa8c428e2533
react-native-background-actions: 2c251c986f23347f9c1722f05fd296938f60edb1
react-native-begin-background-task: 3b889e07458afc5822a7277cf9cbc7cd077e39ee
react-native-config: 7cd105e71d903104e8919261480858940a6b9c0e
react-native-config: bcafda5b4c51491ee1b0e1d0c4e3905bc7b56c1b
react-native-document-picker: ec07866a30707f23660c0f3ae591d669d3e89096
react-native-fingerprint-scanner: be63e626b31fb951780a5fac5328b065a61a3d6e
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
@@ -688,9 +700,9 @@ SPEC CHECKSUMS:
react-native-mmkv-storage: 8ba3c0216a6df283ece11205b442a3e435aec4e5
react-native-netinfo: 3d3769f0d65de15c83a9bf1346f8be71de5a24bf
react-native-orientation: f1caf84d65f1a4fd4511a18f2b924e634ad7a628
react-native-safe-area-context: b456e1c40ec86f5593d58b275bd0e9603169daca
react-native-safe-area-context: 99b24a0c5acd0d5dcac2b1a7f18c49ea317be99a
react-native-sodium: 5d17851375e399a532d3c571d0703de4312da31c
react-native-webview: e771bc375f789ebfa02a26939a57dbc6fa897336
react-native-webview: d33e2db8925d090871ffeb232dfa50cb3a727581
React-perflogger: cb386fd44c97ec7f8199c04c12b22066b0f2e1e0
React-RCTActionSheet: f803a85e46cf5b4066c2ac5e122447f918e9c6e5
React-RCTAnimation: 19c80fa950ccce7f4db76a2a7f2cf79baae07fc7
@@ -708,24 +720,26 @@ SPEC CHECKSUMS:
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNBootSplash: 5f346163977573d6b2aeba1b25df9d2245c0d73c
RNCCheckbox: ed1b4ca295475b41e7251ebae046360a703b6eb5
RNCClipboard: 4b8bec7c195e27bcec746f52dff7601161683249
RNCMaskedView: cb9670ea9239998340eaab21df13fa12a1f9de15
RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd
RNCMaskedView: bc0170f389056201c82a55e242e5d90070e18e5a
RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45
RNDeviceInfo: aad3c663b25752a52bf8fce93f2354001dd185aa
RNExitApp: c4e052df2568b43bec8a37c7cd61194d4cfee2c3
RNFileViewer: ce7ca3ac370e18554d35d6355cffd7c30437c592
RNGestureHandler: 920eb17f5b1e15dae6e5ed1904045f8f90e0b11e
RNGestureHandler: b7a872907ee289ada902127f2554fa1d2c076122
RNIap: f00befe6581a5953191108cb97d9b3872473337b
RNKeychain: 840f8e6f13be0576202aefcdffd26a4f54bfe7b5
RNPrivacySnapshot: 8eaf571478a353f2e5184f5c803164f22428b023
RNReanimated: 2cf7451318bb9cc430abeec8d67693f9cf4e039c
RNScreens: 0df01424e9e0ed7827200d6ed1087ddd06c493f9
RNSecureRandom: 0dcee021fdb3d50cd5cee5db0ebf583c42f5af0e
RNShare: be91a5c149585affb02c25b351bd07ba927c7006
RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d
RNSecureRandom: 07efbdf2cd99efe13497433668e54acd7df49fef
RNShare: a5dc3b9c53ddc73e155b8cd9a94c70c91913c43c
RNSVG: ecd661f380a07ba690c9c5929c475a44f432d674
RNTooltips: 5424d4bf0b3d441104127943b1115cc7f0616b1f
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
RNZipArchive: 3f89b114cfeb89dac027fc5c7afd7e58d3dc4ebf
SexyTooltip: 5c9b4dec52bfb317938cb0488efd9da3717bb6fd
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
toolbar-android: 2a73856e98b750d7e71ce4644d3f41cc98211719
Yoga: ff994563b2fd98c982ca58e8cd9db2cdaf4dda74