-
-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement encrypted items info (#641)
* feat: implement encrypted items info * Update app/assets/javascripts/ui_models/app_state/account_menu_state.ts Co-authored-by: Mo Bitar <mo@standardnotes.org> * Update app/assets/javascripts/ui_models/app_state/account_menu_state.ts Co-authored-by: Mo Bitar <mo@standardnotes.org> * Update app/assets/javascripts/preferences/panes/EndToEndEncryption.tsx Co-authored-by: Mo Bitar <mo@standardnotes.org> * Update app/assets/javascripts/preferences/panes/EndToEndEncryption.tsx Co-authored-by: Mo Bitar <mo@standardnotes.org> Co-authored-by: Mo Bitar <mo@standardnotes.org>
- Loading branch information
Showing
8 changed files
with
97 additions
and
8 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
app/assets/javascripts/preferences/panes/EndToEndEncryption.tsx
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,40 @@ | ||
import { DecoratedInput } from "@/components/DecoratedInput"; | ||
import { Icon } from "@/components/Icon"; | ||
import { AppState } from "@/ui_models/app_state"; | ||
import { observer } from "mobx-react-lite"; | ||
import { FunctionComponent } from "preact"; | ||
import { PreferencesGroup, PreferencesSegment, Text, Title } from "../components"; | ||
|
||
const formatCount = (count: number, itemType: string) => `${count} / ${count} ${itemType}`; | ||
|
||
export const EndToEndEncryption: FunctionComponent<{ appState: AppState }> = observer(({ appState }) => { | ||
const count = appState.accountMenu.structuredNotesAndTagsCount; | ||
const notes = formatCount(count.notes, 'notes'); | ||
const tags = formatCount(count.tags, 'tags'); | ||
const archived = formatCount(count.archived, 'archived notes'); | ||
const deleted = formatCount(count.deleted, 'trashed notes'); | ||
|
||
const checkIcon = <Icon className="success min-w-5 min-h-5" type="check-bold" />; | ||
const noteIcon = <Icon type="rich-text" className="min-w-5 min-h-5" />; | ||
const tagIcon = <Icon type="hashtag" className="min-w-5 min-h-5" />; | ||
const archiveIcon = <Icon type="archive" className="min-w-5 min-h-5" />; | ||
const trashIcon = <Icon type="trash" className="min-w-5 min-h-5" />; | ||
return ( | ||
<PreferencesGroup> | ||
<PreferencesSegment> | ||
<Title>End-to-end encryption</Title> | ||
<Text>Your data is encrypted before syncing to your private account.</Text> | ||
<div className="flex flex-row pb-1 pt-1.5" > | ||
<DecoratedInput disabled={true} text={notes} right={[checkIcon]} left={[noteIcon]} /> | ||
<div className="min-w-3" /> | ||
<DecoratedInput disabled={true} text={tags} right={[checkIcon]} left={[tagIcon]} /> | ||
</div> | ||
<div className="flex flex-row" > | ||
<DecoratedInput disabled={true} text={archived} right={[checkIcon]} left={[archiveIcon]} /> | ||
<div className="min-w-3" /> | ||
<DecoratedInput disabled={true} text={deleted} right={[checkIcon]} left={[trashIcon]} /> | ||
</div> | ||
</PreferencesSegment> | ||
</PreferencesGroup> | ||
); | ||
}); |
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