tooot/src/components/Header/Center.tsx

31 lines
726 B
TypeScript
Raw Normal View History

import CustomText from '@components/Text'
2021-01-14 00:43:35 +01:00
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
export interface Props {
content: string
2021-02-10 00:40:44 +01:00
inverted?: boolean
2021-01-14 00:43:35 +01:00
}
// Used for Android mostly
const HeaderCenter = React.memo(
2021-02-10 00:40:44 +01:00
({ content, inverted = false }: Props) => {
2022-02-12 14:51:01 +01:00
const { colors } = useTheme()
2021-01-14 00:43:35 +01:00
return (
<CustomText
style={{
fontSize: 18,
fontWeight: StyleConstants.Font.Weight.Bold,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
2021-01-14 00:43:35 +01:00
children={content}
/>
)
},
2021-03-18 23:32:31 +01:00
(prev, next) => prev.content === next.content
2021-01-14 00:43:35 +01:00
)
export default HeaderCenter