1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Files
tooot/src/screens/Compose/Root/Header/PostingAs.tsx
Zhiyuan Zheng 7c48c61c99 Using new text component
Need to use global accessibility checks rather than per text component which is not efficient
2022-05-07 00:52:32 +02:00

35 lines
892 B
TypeScript

import CustomText from '@components/Text'
import {
getInstanceAccount,
getInstanceUri
} from '@utils/slices/instancesSlice'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
const ComposePostingAs = React.memo(
() => {
const { t } = useTranslation('screenCompose')
const { colors } = useTheme()
const instanceAccount = useSelector(
getInstanceAccount,
(prev, next) => prev?.acct === next?.acct
)
const instanceUri = useSelector(getInstanceUri)
return (
<CustomText fontStyle='S' style={{ color: colors.secondary }}>
{t('content.root.header.postingAs', {
acct: instanceAccount?.acct,
domain: instanceUri
})}
</CustomText>
)
},
() => true
)
export default ComposePostingAs