Update posts in feed to use the theming system
This commit is contained in:
parent
8f55e3149e
commit
607203134e
9 changed files with 133 additions and 82 deletions
|
@ -6,6 +6,8 @@ import {Text} from './text/Text'
|
|||
import {PostDropdownBtn} from './forms/DropdownButton'
|
||||
import {s} from '../../lib/styles'
|
||||
import {ago} from '../../../lib/strings'
|
||||
import {useTheme} from '../../lib/ThemeContext'
|
||||
import {usePalette} from '../../lib/hooks/usePalette'
|
||||
|
||||
interface PostMetaOpts {
|
||||
itemHref: string
|
||||
|
@ -20,6 +22,8 @@ interface PostMetaOpts {
|
|||
}
|
||||
|
||||
export function PostMeta(opts: PostMetaOpts) {
|
||||
const theme = useTheme()
|
||||
const pal = usePalette('default')
|
||||
let displayName = opts.authorDisplayName || opts.authorHandle
|
||||
let handle = opts.authorHandle
|
||||
|
||||
|
@ -44,16 +48,16 @@ export function PostMeta(opts: PostMetaOpts) {
|
|||
style={styles.metaItem}
|
||||
href={opts.authorHref}
|
||||
title={opts.authorHandle}>
|
||||
<Text style={[s.f17, s.bold, s.black]} numberOfLines={1}>
|
||||
<Text style={[pal.text, theme.typography.h5]} numberOfLines={1}>
|
||||
{displayName}
|
||||
{handle ? (
|
||||
<Text style={[s.f15, s.gray5, s.normal, s.black]}>
|
||||
<Text style={[pal.textLight, theme.typography.h6]}>
|
||||
{handle}
|
||||
</Text>
|
||||
) : undefined}
|
||||
</Text>
|
||||
</Link>
|
||||
<Text style={[styles.metaItem, s.f15, s.gray5]}>
|
||||
<Text style={[styles.metaItem, pal.textLight, theme.typography.h6]}>
|
||||
· {ago(opts.timestamp)}
|
||||
</Text>
|
||||
<View style={s.flex1} />
|
||||
|
@ -64,7 +68,11 @@ export function PostMeta(opts: PostMetaOpts) {
|
|||
isAuthor={opts.isAuthor}
|
||||
onCopyPostText={opts.onCopyPostText}
|
||||
onDeletePost={opts.onDeletePost}>
|
||||
<FontAwesomeIcon icon="ellipsis-h" size={14} style={[s.mt2, s.mr5]} />
|
||||
<FontAwesomeIcon
|
||||
icon="ellipsis-h"
|
||||
size={14}
|
||||
style={[s.mt2, s.mr5, pal.text]}
|
||||
/>
|
||||
</PostDropdownBtn>
|
||||
</View>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue