1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2022-08-14 22:18:41 +02:00
parent c6e7063929
commit 42528caf09
4 changed files with 80 additions and 103 deletions

View File

@ -1,31 +1,53 @@
import Icon from '@components/Icon'
import CustomText from '@components/Text'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { View } from 'react-native'
export interface Props {
content: React.ReactNode | string
content?: string
inverted?: boolean
onPress?: () => void
dropdown?: boolean
}
// Used for Android mostly
const HeaderCenter: React.FC<Props> = ({
content,
inverted = false,
onPress
onPress,
dropdown = false
}) => {
const { colors } = useTheme()
return (
<CustomText
<View
style={{
fontSize: 18,
color: inverted ? colors.primaryOverlay : colors.primaryDefault
flexDirection: 'row',
alignItems: 'center'
}}
fontWeight='Bold'
children={content}
{...(onPress && { onPress })}
/>
>
<CustomText
style={{
color: inverted ? colors.primaryOverlay : colors.primaryDefault
}}
fontSize='L'
fontWeight='Bold'
numberOfLines={1}
children={content}
{...(onPress && { onPress })}
/>
{dropdown ? (
<Icon
name='ChevronDown'
size={StyleConstants.Font.Size.M}
color={colors.primaryDefault}
style={{ marginLeft: StyleConstants.Spacing.XS }}
strokeWidth={3}
/>
) : null}
</View>
)
}