From d97e2335181fc4d280cb6e4fb67cec8509e1569b Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 24 Feb 2023 11:40:43 -0600 Subject: Fixes to lineheight on web to counteract emoji issues --- src/view/com/notifications/FeedItem.tsx | 12 +++++++++--- src/view/com/post-thread/PostThreadItem.tsx | 6 +++++- src/view/com/post/Post.tsx | 2 +- src/view/com/posts/FeedItem.tsx | 4 ++-- src/view/com/util/PostMeta.tsx | 8 ++++++-- src/view/com/util/UserInfoText.tsx | 2 +- src/view/com/util/Views.web.tsx | 4 ++-- src/view/com/util/text/Text.tsx | 7 +++++-- 8 files changed, 31 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index 94bedc46f..68f12b721 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -188,7 +188,7 @@ export const FeedItem = observer(function FeedItem({ style={styles.metaItem} href={authors[0].href} title={`@${authors[0].handle}`}> - + {authors[0].displayName || authors[0].handle} @@ -333,10 +333,16 @@ function ExpandedAuthorsList({ /> - + {author.displayName || author.handle}   - {author.handle} + + {author.handle} + diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index cd3a49d64..98d44267d 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -146,7 +146,11 @@ export const PostThreadItem = observer(function PostThreadItem({ style={styles.metaItem} href={authorHref} title={authorTitle}> - + {item.post.author.displayName || item.post.author.handle} diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 8e793ecc0..1550f8620 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -164,7 +164,7 @@ export const Post = observer(function Post({ size={9} style={[pal.textLight, s.mr5]} /> - + Reply to - + Reposted by{' '} {item.reasonRepost.by.displayName || item.reasonRepost.by.handle} @@ -188,7 +188,7 @@ export const FeedItem = observer(function ({ s.mr5, ]} /> - + Reply to - + {displayName} {handle ? ( @@ -44,7 +48,7 @@ export function PostMeta(opts: PostMetaOpts) { ) : undefined} - + · {ago(opts.timestamp)} diff --git a/src/view/com/util/UserInfoText.tsx b/src/view/com/util/UserInfoText.tsx index d7907aa89..2655232fc 100644 --- a/src/view/com/util/UserInfoText.tsx +++ b/src/view/com/util/UserInfoText.tsx @@ -64,7 +64,7 @@ export function UserInfoText({ ) } else if (profile) { inner = ( - {`${prefix || ''}${ + {`${prefix || ''}${ profile[attr] || profile.handle }`} ) diff --git a/src/view/com/util/Views.web.tsx b/src/view/com/util/Views.web.tsx index 1ffd7844c..8b5adaa04 100644 --- a/src/view/com/util/Views.web.tsx +++ b/src/view/com/util/Views.web.tsx @@ -73,14 +73,14 @@ export const ScrollView = React.forwardRef(function ( const styles = StyleSheet.create({ container: { width: '100%', - maxWidth: 600, + maxWidth: 550, marginLeft: 'auto', marginRight: 'auto', }, containerScroll: { width: '100%', height: `calc(100vh - ${DESKTOP_HEADER_HEIGHT}px)`, - maxWidth: 600, + maxWidth: 550, marginLeft: 'auto', marginRight: 'auto', }, diff --git a/src/view/com/util/text/Text.tsx b/src/view/com/util/text/Text.tsx index 14c57cf47..2825390cb 100644 --- a/src/view/com/util/text/Text.tsx +++ b/src/view/com/util/text/Text.tsx @@ -1,22 +1,25 @@ import React from 'react' import {Text as RNText, TextProps} from 'react-native' -import {s} from 'lib/styles' +import {s, lh} from 'lib/styles' import {useTheme, TypographyVariant} from 'lib/ThemeContext' export type CustomTextProps = TextProps & { type?: TypographyVariant + lineHeight?: number } export function Text({ type = 'md', children, + lineHeight, style, ...props }: React.PropsWithChildren) { const theme = useTheme() const typography = theme.typography[type] + const lineHeightStyle = lineHeight ? lh(theme, type, lineHeight) : undefined return ( - + {children} ) -- cgit 1.4.1