1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Initial try out dynamic following

This commit is contained in:
xmflsct
2022-08-13 00:48:20 +02:00
parent 034208fbe1
commit 51ac36768d
2 changed files with 142 additions and 60 deletions

View File

@ -3,27 +3,30 @@ import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
export interface Props {
content: string
content: React.ReactNode | string
inverted?: boolean
onPress?: () => void
}
// Used for Android mostly
const HeaderCenter = React.memo(
({ content, inverted = false }: Props) => {
const { colors } = useTheme()
const HeaderCenter: React.FC<Props> = ({
content,
inverted = false,
onPress
}) => {
const { colors } = useTheme()
return (
<CustomText
style={{
fontSize: 18,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
fontWeight='Bold'
children={content}
/>
)
},
(prev, next) => prev.content === next.content
)
return (
<CustomText
style={{
fontSize: 18,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
fontWeight='Bold'
children={content}
{...(onPress && { onPress })}
/>
)
}
export default HeaderCenter