From 8b584c8c09f835984ab4008f936f5370c0e16d70 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 17 Nov 2022 13:02:53 -0600 Subject: [PATCH] Improve perf of post rendering --- src/view/com/util/PostMeta.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/view/com/util/PostMeta.tsx b/src/view/com/util/PostMeta.tsx index 1a5528b0..e89edec3 100644 --- a/src/view/com/util/PostMeta.tsx +++ b/src/view/com/util/PostMeta.tsx @@ -1,5 +1,5 @@ import React, {useMemo} from 'react' -import {StyleSheet, useWindowDimensions, Text, View} from 'react-native' +import {StyleSheet, Text, View} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {Link} from '../util/Link' import {PostDropdownBtn} from '../util/DropdownBtn' @@ -18,15 +18,10 @@ interface PostMetaOpts { } export function PostMeta(opts: PostMetaOpts) { - const winDim = useWindowDimensions() - const maxWidth = useMemo( - () => ({maxWidth: ((winDim.width * 3) / 5) | 0}), - [winDim.width], - ) return ( @@ -61,5 +56,6 @@ const styles = StyleSheet.create({ }, metaItem: { paddingRight: 5, + maxWidth: '75%', }, })