refactor: read the required data from appState instead of passing by parent component

This commit is contained in:
VardanHakobyan
2021-06-16 16:20:23 +04:00
parent 17515848b4
commit 018251838c
4 changed files with 8 additions and 27 deletions

View File

@@ -3,14 +3,10 @@ import { observer } from 'mobx-react-lite';
type Props = {
appState: AppState;
notesAndTagsCount: number;
}
const Encryption = observer(({
appState,
notesAndTagsCount
}: Props) => {
const { isEncryptionEnabled, encryptionStatusString } = appState.accountMenu;
const Encryption = observer(({ appState }: Props) => {
const { isEncryptionEnabled, encryptionStatusString, notesAndTagsCount } = appState.accountMenu;
const getEncryptionStatusForNotes = () => {
const length = notesAndTagsCount;