diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-17 13:02:53 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-17 13:02:53 -0600 |
commit | 8b584c8c09f835984ab4008f936f5370c0e16d70 (patch) | |
tree | e9c1a79ebd21401b3c36bc6cb9ab130d6fd72e00 /src | |
parent | 5d7f3e1863a2d1a0542b1885fdcf107f7e21d6e9 (diff) | |
download | voidsky-8b584c8c09f835984ab4008f936f5370c0e16d70.tar.zst |
Improve perf of post rendering
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/util/PostMeta.tsx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/view/com/util/PostMeta.tsx b/src/view/com/util/PostMeta.tsx index 1a5528b07..e89edec35 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 ( <View style={styles.meta}> <Link - style={[styles.metaItem, maxWidth]} + style={styles.metaItem} href={opts.authorHref} title={opts.authorHandle}> <Text style={[s.f17, s.bold]} numberOfLines={1}> @@ -61,5 +56,6 @@ const styles = StyleSheet.create({ }, metaItem: { paddingRight: 5, + maxWidth: '75%', }, }) |