mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Refine types for #600
This commit is contained in:
@ -11,7 +11,7 @@ import Icon from './Icon'
|
|||||||
import CustomText from './Text'
|
import CustomText from './Text'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
account: Mastodon.Account
|
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'acct' | 'username'>
|
||||||
props?: PressableProps
|
props?: PressableProps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import validUrl from 'valid-url'
|
|||||||
const regexEmoji = new RegExp(/(:[A-Za-z0-9_]+:)/)
|
const regexEmoji = new RegExp(/(:[A-Za-z0-9_]+:)/)
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
content: string
|
content?: string
|
||||||
emojis?: Mastodon.Emoji[]
|
emojis?: Mastodon.Emoji[]
|
||||||
size?: 'S' | 'M' | 'L'
|
size?: 'S' | 'M' | 'L'
|
||||||
adaptiveSize?: boolean
|
adaptiveSize?: boolean
|
||||||
@ -23,6 +23,8 @@ export interface Props {
|
|||||||
|
|
||||||
const ParseEmojis = React.memo(
|
const ParseEmojis = React.memo(
|
||||||
({ content, emojis, size = 'M', adaptiveSize = false, fontBold = false, style }: Props) => {
|
({ content, emojis, size = 'M', adaptiveSize = false, fontBold = false, style }: Props) => {
|
||||||
|
if (!content) return null
|
||||||
|
|
||||||
const { reduceMotionEnabled } = useAccessibility()
|
const { reduceMotionEnabled } = useAccessibility()
|
||||||
|
|
||||||
const adaptiveFontsize = useSelector(getSettingsFontsize)
|
const adaptiveFontsize = useSelector(getSettingsFontsize)
|
||||||
|
@ -30,7 +30,7 @@ const menuAccount = ({
|
|||||||
}: {
|
}: {
|
||||||
type: 'status' | 'account' // Where the action is coming from
|
type: 'status' | 'account' // Where the action is coming from
|
||||||
openChange: boolean
|
openChange: boolean
|
||||||
account?: Mastodon.Account
|
account?: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'username' | 'acct'>
|
||||||
status?: Mastodon.Status
|
status?: Mastodon.Status
|
||||||
queryKey?: QueryKeyTimeline
|
queryKey?: QueryKeyTimeline
|
||||||
rootQueryKey?: QueryKeyTimeline
|
rootQueryKey?: QueryKeyTimeline
|
||||||
|
@ -13,7 +13,7 @@ const menuShare = (
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'account'
|
type: 'account'
|
||||||
url: string
|
url?: string
|
||||||
}
|
}
|
||||||
): ContextMenu[][] => {
|
): ContextMenu[][] => {
|
||||||
if (params.type === 'status' && params.visibility === 'direct') return []
|
if (params.type === 'status' && params.visibility === 'direct') return []
|
||||||
|
@ -92,7 +92,7 @@ export type ScreenTabsScreenProps<T extends keyof ScreenTabsStackParamList> = Bo
|
|||||||
|
|
||||||
export type TabSharedStackParamList = {
|
export type TabSharedStackParamList = {
|
||||||
'Tab-Shared-Account': {
|
'Tab-Shared-Account': {
|
||||||
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id'>
|
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'username' | 'acct'>
|
||||||
}
|
}
|
||||||
'Tab-Shared-Account-In-Lists': {
|
'Tab-Shared-Account-In-Lists': {
|
||||||
account: Pick<Mastodon.Account, 'id' | 'username'>
|
account: Pick<Mastodon.Account, 'id' | 'username'>
|
||||||
@ -105,7 +105,10 @@ export type TabSharedStackParamList = {
|
|||||||
id: Mastodon.Status['id']
|
id: Mastodon.Status['id']
|
||||||
detectedLanguage: string
|
detectedLanguage: string
|
||||||
}
|
}
|
||||||
'Tab-Shared-Report': { account: Mastodon.Account; status?: Pick<Mastodon.Status, 'id'> }
|
'Tab-Shared-Report': {
|
||||||
|
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'acct' | 'username'>
|
||||||
|
status?: Pick<Mastodon.Status, 'id'>
|
||||||
|
}
|
||||||
'Tab-Shared-Search': undefined
|
'Tab-Shared-Search': undefined
|
||||||
'Tab-Shared-Toot': {
|
'Tab-Shared-Toot': {
|
||||||
toot: Mastodon.Status
|
toot: Mastodon.Status
|
||||||
|
Reference in New Issue
Block a user