about summary refs log tree commit diff
path: root/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-01-03 09:53:41 -0800
committerGitHub <noreply@github.com>2024-01-03 09:53:41 -0800
commitdf277e5977cb0b1f7e11c7e94265029f8e37ece4 (patch)
tree68b40d5d5571e6396b7aac7b673748f7d1fbfeaa /src/view/com/util/post-embeds/ExternalLinkEmbed.tsx
parent2c31e2a042f73d99be114cf6cb4a2eb9d5407d68 (diff)
downloadvoidsky-df277e5977cb0b1f7e11c7e94265029f8e37ece4.tar.zst
Multiple improvements to link cards and quote posts (#2398)
* fix canvas

* fix external link embed styles

* Use the same link-card style on web and mobile and give a little more height on desktop to the card images

* Use dark border on link embeds to match quote post style

* Fix the highlighting behavior on linkcards and quoteposts

---------

Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/view/com/util/post-embeds/ExternalLinkEmbed.tsx')
-rw-r--r--src/view/com/util/post-embeds/ExternalLinkEmbed.tsx40
1 files changed, 11 insertions, 29 deletions
diff --git a/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx b/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx
index 27aa804d3..1523dcf53 100644
--- a/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx
+++ b/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx
@@ -23,29 +23,16 @@ export const ExternalLinkEmbed = ({
   )
 
   return (
-    <View
-      style={{
-        flexDirection: !isMobile && !embedPlayerParams ? 'row' : 'column',
-      }}>
+    <View style={{flexDirection: 'column'}}>
       {link.thumb && !embedPlayerParams ? (
         <View
-          style={
-            !isMobile
-              ? {
-                  borderTopLeftRadius: 6,
-                  borderBottomLeftRadius: 6,
-                  width: 120,
-                  aspectRatio: 1,
-                  overflow: 'hidden',
-                }
-              : {
-                  borderTopLeftRadius: 6,
-                  borderTopRightRadius: 6,
-                  width: '100%',
-                  height: 200,
-                  overflow: 'hidden',
-                }
-          }>
+          style={{
+            borderTopLeftRadius: 6,
+            borderTopRightRadius: 6,
+            width: '100%',
+            height: isMobile ? 200 : 300,
+            overflow: 'hidden',
+          }}>
           <Image
             style={styles.extImage}
             source={{uri: link.thumb}}
@@ -61,7 +48,6 @@ export const ExternalLinkEmbed = ({
           paddingHorizontal: isMobile ? 10 : 14,
           paddingTop: 8,
           paddingBottom: 10,
-          flex: !isMobile ? 1 : undefined,
         }}>
         <Text
           type="sm"
@@ -69,16 +55,13 @@ export const ExternalLinkEmbed = ({
           style={[pal.textLight, styles.extUri]}>
           {toNiceDomain(link.uri)}
         </Text>
-        <Text
-          type="lg-bold"
-          numberOfLines={isMobile ? 4 : 2}
-          style={[pal.text]}>
+        <Text type="lg-bold" numberOfLines={4} style={[pal.text]}>
           {link.title || link.uri}
         </Text>
         {link.description ? (
           <Text
             type="md"
-            numberOfLines={isMobile ? 4 : 2}
+            numberOfLines={4}
             style={[pal.text, styles.extDescription]}>
             {link.description}
           </Text>
@@ -90,8 +73,7 @@ export const ExternalLinkEmbed = ({
 
 const styles = StyleSheet.create({
   extImage: {
-    width: '100%',
-    height: 200,
+    flex: 1,
   },
   extUri: {
     marginTop: 2,