mirror of
https://github.com/standardnotes/mobile.git
synced 2026-02-05 05:21:26 -05:00
feat: show protected content when chip is selected
This commit is contained in:
@@ -28,6 +28,7 @@ type Props = {
|
||||
hideDates: boolean;
|
||||
hidePreviews: boolean;
|
||||
sortType: CollectionSort;
|
||||
showProtectedContent: boolean;
|
||||
};
|
||||
|
||||
export const NoteCell = ({
|
||||
@@ -37,6 +38,7 @@ export const NoteCell = ({
|
||||
sortType,
|
||||
hideDates,
|
||||
hidePreviews,
|
||||
showProtectedContent,
|
||||
}: Props) => {
|
||||
// Context
|
||||
const application = useContext(ApplicationContext);
|
||||
@@ -185,7 +187,10 @@ export const NoteCell = ({
|
||||
};
|
||||
|
||||
const padding = 14;
|
||||
const showPreview = !hidePreviews && !note.protected && !note.hidePreview;
|
||||
const showPreview =
|
||||
!hidePreviews &&
|
||||
(!note.protected || showProtectedContent) &&
|
||||
!note.hidePreview;
|
||||
const hasPlainPreview =
|
||||
!isNullOrUndefined(note.preview_plain) && note.preview_plain.length > 0;
|
||||
const showDetails = !note.errorDecrypting && (!hideDates || note.protected);
|
||||
|
||||
@@ -42,6 +42,7 @@ type Props = {
|
||||
onPress: () => void;
|
||||
label: string;
|
||||
}[];
|
||||
showProtectedContents: boolean;
|
||||
onPressItem: (noteUuid: SNNote['uuid']) => void;
|
||||
selectedNoteId: string | undefined;
|
||||
sortType: CollectionSort;
|
||||
@@ -140,6 +141,7 @@ export const NoteList = (props: Props) => {
|
||||
hideDates={props.hideDates}
|
||||
hidePreviews={props.hidePreviews}
|
||||
highlighted={item.uuid === props.selectedNoteId}
|
||||
showProtectedContent={props.showProtectedContents}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -563,6 +563,7 @@ export const Notes = React.memo(
|
||||
: undefined
|
||||
}
|
||||
searchOptions={searchOptions}
|
||||
showProtectedContents={includeProtectedNoteText}
|
||||
/>
|
||||
<FAB
|
||||
// @ts-ignore style prop does not exist in types
|
||||
|
||||
Reference in New Issue
Block a user