Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

update link preview ui

ammarahm-ed9add40c1a104
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/linkpreview.js b/apps/mobile/src/views/Editor/tiny/toolbar/linkpreview.js
index cf6819d22..1b5d5e153 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/linkpreview.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/linkpreview.js
@@ -8,7 +8,7 @@ import Paragraph from '../../../../components/Typography/Paragraph';
import {useTracked} from '../../../../provider';
import {ToastEvent} from '../../../../services/EventManager';
import {SIZE} from '../../../../utils/SizeUtils';
-import { INPUT_MODE, properties } from './constants';
+import {INPUT_MODE, properties} from './constants';
let prevLink = {};
let prevHeight = 65;
@@ -90,15 +90,16 @@ const LinkPreview = ({setMode, value, onSubmit}) => {
</Heading>
)}
- {description && (
- <Paragraph
- style={{flexWrap: 'wrap', maxWidth: '90%', paddingLeft: 5}}
- numberOfLines={2}
- color={colors.icon}
- size={SIZE.xs}>
- {description}
- </Paragraph>
- )}
+ {description ||
+ (title && (
+ <Paragraph
+ style={{flexWrap: 'wrap', maxWidth: '90%', paddingLeft: 5}}
+ numberOfLines={2}
+ color={colors.icon}
+ size={SIZE.xs}>
+ {description ? description : link.value}
+ </Paragraph>
+ ))}
<View
style={{
@@ -158,4 +159,4 @@ const LinkPreview = ({setMode, value, onSubmit}) => {
);
};
-export default LinkPreview;
\ No newline at end of file
+export default LinkPreview;