feat: Added "Import" option in the account menu that allows you to import from plaintext/markdown files, Evernote exports, Simplenote exports, Google Keep exports and also convert Aegis exports to TokenVault notes

This commit is contained in:
Aman Harwara
2022-12-30 01:22:59 +05:30
committed by GitHub
parent f1ae7a53ef
commit 6e4bf2417a
25 changed files with 755 additions and 207 deletions

View File

@@ -1,20 +1,10 @@
import { useAndroidBackHandler } from '@/NativeMobileWeb/useAndroidBackHandler'
import {
useEffect,
ReactNode,
useMemo,
createContext,
useCallback,
useContext,
memo,
useRef,
useLayoutEffect,
MutableRefObject,
} from 'react'
import { useEffect, ReactNode, useMemo, createContext, useCallback, useContext, memo } from 'react'
import { AppPaneId } from './AppPaneMetadata'
import { PaneController } from '../../Controllers/PaneController/PaneController'
import { observer } from 'mobx-react-lite'
import { PaneLayout } from '@/Controllers/PaneController/PaneLayout'
import { useStateRef } from './useStateRef'
type ResponsivePaneData = {
selectedPane: AppPaneId
@@ -54,16 +44,6 @@ type ProviderProps = {
paneController: PaneController
} & ChildrenProps
function useStateRef<State>(state: State): MutableRefObject<State> {
const ref = useRef<State>(state)
useLayoutEffect(() => {
ref.current = state
}, [state])
return ref
}
const MemoizedChildren = memo(({ children }: ChildrenProps) => <>{children}</>)
const ResponsivePaneProvider = ({ paneController, children }: ProviderProps) => {

View File

@@ -0,0 +1,11 @@
import { useRef, useLayoutEffect, MutableRefObject } from 'react'
export function useStateRef<State>(state: State): MutableRefObject<State> {
const ref = useRef<State>(state)
useLayoutEffect(() => {
ref.current = state
}, [state])
return ref
}