This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from PrivaNoteTeam/markdown-parsing-and-note-…
…synchronization Markdown Parsing
- Loading branch information
Showing
71 changed files
with
3,015 additions
and
1,265 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,45 @@ | ||
import React from 'react'; | ||
import { ipcRenderer } from 'electron'; | ||
import { Route, useHistory } from 'react-router'; | ||
import { CreateNotebookModal } from './CreateNotebookModal'; | ||
import { LoginModal } from './modalManager/LoginModal'; | ||
import { RegisterModal } from './modalManager/RegisterModal'; | ||
import { CreateNotebookModal } from './CreateNotebookModal'; | ||
import { ipcRenderer } from 'electron'; | ||
import { useModalStore } from '../hooks'; | ||
import { ResetPasswordModal } from './modalManager/ResetPasswordModal'; | ||
import { VerificiationModal } from './modalManager/VerificationModal'; | ||
import { TwoFactorAuthModal } from './modalManager/TwoFactorAuthModal'; | ||
import { ForgotPasswordModal } from './modalManager/ForgotPasswordModal'; | ||
import { ResetPasswordModal } from './modalManager/ResetPasswordModal'; | ||
|
||
export function ModalManager() { | ||
const [ | ||
{ | ||
loginModalVisible, | ||
registerModalVisible, | ||
createNotebookModalVisible, | ||
verificationModalVisible, | ||
twoFactorAuthModalVisible, | ||
forgotPasswordModalVisible, | ||
resetPasswordModalVisible | ||
}, | ||
modalManagerDispatch | ||
] = useModalStore(); | ||
|
||
let history = useHistory(); | ||
ipcRenderer.on('createNotebook', () => { | ||
modalManagerDispatch({ | ||
type: 'createNotebookModal', | ||
createNotebookModalVisible: true | ||
}); | ||
history.push('/notebook/create'); | ||
}); | ||
|
||
let render: JSX.Element | null = null; | ||
|
||
if (loginModalVisible) { | ||
render = <LoginModal />; | ||
} else if (registerModalVisible) { | ||
render = <RegisterModal />; | ||
} else if (createNotebookModalVisible) { | ||
render = <CreateNotebookModal />; | ||
} else if (verificationModalVisible) { | ||
render = <VerificiationModal />; | ||
} else if (twoFactorAuthModalVisible) { | ||
render = <TwoFactorAuthModal />; | ||
} else if (forgotPasswordModalVisible) { | ||
render = <ForgotPasswordModal />; | ||
} else if (resetPasswordModalVisible) { | ||
render = <ResetPasswordModal />; | ||
} | ||
|
||
return render; | ||
return ( | ||
<> | ||
<Route | ||
path='/notebook/create' | ||
children={<CreateNotebookModal />} | ||
exact | ||
/> | ||
<Route path='/login' children={<LoginModal />} exact /> | ||
<Route path='/register' children={<RegisterModal />} exact /> | ||
<Route | ||
path='/forgot-password' | ||
children={<ForgotPasswordModal />} | ||
exact | ||
/> | ||
<Route | ||
path='/reset-password' | ||
children={<ResetPasswordModal />} | ||
exact | ||
/> | ||
<Route | ||
path='/verification' | ||
children={<VerificiationModal />} | ||
exact | ||
/> | ||
<Route path='/2fa' children={<TwoFactorAuthModal />} exact /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import React from 'react'; | ||
import { usePageStore } from '@hooks'; | ||
import { CloudProviderPage } from './pageManager/cloudProviderPage'; | ||
import { SelectCloudProviderPage } from './pageManager/selectCloudProviderPage'; | ||
import { Route } from 'react-router'; | ||
|
||
export function PageManager() { | ||
const [{ cloudProviderPageVisible, selectCloudProviderPageVisible }] = | ||
usePageStore(); | ||
|
||
let render: JSX.Element | null = null; | ||
|
||
if (cloudProviderPageVisible) { | ||
render = <CloudProviderPage />; | ||
} else if (selectCloudProviderPageVisible) { | ||
render = <SelectCloudProviderPage />; | ||
} | ||
|
||
return render; | ||
return ( | ||
<> | ||
<Route path='/cloudprovider' children={<CloudProviderPage />} /> | ||
<Route | ||
path='/cloudprovider/select' | ||
children={<SelectCloudProviderPage />} | ||
/> | ||
</> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { UIPreview } from './preview/UIPreview'; | ||
import { usePreview } from './preview/usePreview'; | ||
|
||
interface Props { | ||
text: string; | ||
onClose: () => void; | ||
} | ||
|
||
export function Preview({ text, onClose }: Props) { | ||
const html = usePreview(text); | ||
|
||
return <UIPreview content={html} handleClose={onClose} />; | ||
} |
Oops, something went wrong.