tooot/src/components/Header/Center.tsx

33 lines
653 B
TypeScript
Raw Normal View History

import CustomText from '@components/Text'
2021-01-14 00:43:35 +01:00
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
export interface Props {
2022-08-13 00:48:20 +02:00
content: React.ReactNode | string
2021-02-10 00:40:44 +01:00
inverted?: boolean
2022-08-13 00:48:20 +02:00
onPress?: () => void
2021-01-14 00:43:35 +01:00
}
// Used for Android mostly
2022-08-13 00:48:20 +02:00
const HeaderCenter: React.FC<Props> = ({
content,
inverted = false,
onPress
}) => {
const { colors } = useTheme()
2021-01-14 00:43:35 +01:00
2022-08-13 00:48:20 +02:00
return (
<CustomText
style={{
fontSize: 18,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
fontWeight='Bold'
children={content}
{...(onPress && { onPress })}
/>
)
}
2021-01-14 00:43:35 +01:00
export default HeaderCenter