Improve link meta fetching for bsky links (#54)
* Add share dropdown item to profiles * Temporary improvement for links to content on the network * Enlarge text slightly on embed cards
This commit is contained in:
parent
0536a6afcf
commit
9230d52ff5
8 changed files with 123 additions and 23 deletions
|
@ -94,7 +94,7 @@ export const ComposePost = observer(function ComposePost({
|
|||
return cleanup
|
||||
}
|
||||
if (!extLink.meta) {
|
||||
getLinkMeta(extLink.uri).then(meta => {
|
||||
getLinkMeta(store, extLink.uri).then(meta => {
|
||||
if (aborted) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react'
|
||||
import {observer} from 'mobx-react-lite'
|
||||
import {
|
||||
Share,
|
||||
StyleSheet,
|
||||
TouchableOpacity,
|
||||
TouchableWithoutFeedback,
|
||||
|
@ -16,7 +17,7 @@ import {
|
|||
ReportAccountModal,
|
||||
ProfileImageLightbox,
|
||||
} from '../../../state/models/shell-ui'
|
||||
import {pluralize} from '../../../lib/strings'
|
||||
import {pluralize, toShareUrl} from '../../../lib/strings'
|
||||
import {s, gradients} from '../../lib/styles'
|
||||
import {DropdownButton, DropdownItem} from '../util/forms/DropdownButton'
|
||||
import * as Toast from '../util/Toast'
|
||||
|
@ -66,6 +67,9 @@ export const ProfileHeader = observer(function ProfileHeader({
|
|||
const onPressFollows = () => {
|
||||
store.nav.navigate(`/profile/${view.handle}/follows`)
|
||||
}
|
||||
const onPressShare = () => {
|
||||
Share.share({url: toShareUrl(`/profile/${view.handle}`)})
|
||||
}
|
||||
const onPressMuteAccount = async () => {
|
||||
try {
|
||||
await view.muteAccount()
|
||||
|
@ -133,9 +137,8 @@ export const ProfileHeader = observer(function ProfileHeader({
|
|||
// loaded
|
||||
// =
|
||||
const isMe = store.me.did === view.did
|
||||
let dropdownItems: DropdownItem[] | undefined
|
||||
let dropdownItems: DropdownItem[] = [{label: 'Share', onPress: onPressShare}]
|
||||
if (!isMe) {
|
||||
dropdownItems = dropdownItems || []
|
||||
dropdownItems.push({
|
||||
label: view.myState.muted ? 'Unmute Account' : 'Mute Account',
|
||||
onPress: view.myState.muted ? onPressUnmuteAccount : onPressMuteAccount,
|
||||
|
|
|
@ -92,7 +92,7 @@ export function PostEmbeds({
|
|||
/>
|
||||
)}
|
||||
<View style={styles.extInner}>
|
||||
<Text type="sm-bold" numberOfLines={2} style={[pal.text]}>
|
||||
<Text type="md-bold" numberOfLines={2} style={[pal.text]}>
|
||||
{link.title || link.uri}
|
||||
</Text>
|
||||
<Text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue