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

Some translations are done

This commit is contained in:
Zhiyuan Zheng
2020-11-30 00:24:53 +01:00
parent 1493e20962
commit 0e3528d2cd
42 changed files with 428 additions and 176 deletions

View File

@ -0,0 +1,52 @@
import { Feather } from '@expo/vector-icons'
import React from 'react'
import { Pressable, StyleSheet, Text } from 'react-native'
import { useTheme } from 'src/utils/styles/ThemeManager'
import { StyleConstants } from 'src/utils/styles/constants'
type PropsBase = {
onPress: () => void
}
export interface PropsText extends PropsBase {
text: string
icon?: string
}
export interface PropsIcon extends PropsBase {
text?: string
icon: string
}
const HeaderRight: React.FC<PropsText | PropsIcon> = ({
onPress,
text,
icon
}) => {
const { theme } = useTheme()
return (
<Pressable onPress={onPress} style={styles.base}>
{text && <Text style={[styles.text, { color: theme.link }]}>{text}</Text>}
{icon && (
<Feather
name={icon}
color={theme.link}
size={StyleConstants.Font.Size.L}
/>
)}
</Pressable>
)
}
const styles = StyleSheet.create({
base: {
paddingLeft: StyleConstants.Spacing.S
},
text: {
fontSize: StyleConstants.Font.Size.L
}
})
export default HeaderRight