This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
interaktive-systeme/components/common/plus.tsx
2023-12-30 14:35:05 +01:00

40 lines
No EOL
1,001 B
TypeScript

import { AntDesign } from '@expo/vector-icons'
import React from 'react'
import { StyleSheet, TouchableOpacity, ViewProps } from 'react-native'
import { useTheme } from '../../app/contexts/ThemeContext'
type PlusProps = ViewProps & {onPress? : ()=> void | undefined}
const Plus = (props : PlusProps) => {
const {colors} = useTheme()
const accentColor = colors.accentColor;
const primaryText = colors.primaryText;
const style = StyleSheet.create({
plus:{
position: "absolute",
right: 20,
bottom: 20,
zIndex: 1,
backgroundColor: accentColor,
padding: 20,
borderRadius: 500,
height: 60,
width: 60,
alignItems: 'center',
justifyContent: "center",
flex:1
}
});
return (
<TouchableOpacity onPress={props.onPress} style={[style.plus, props.style]}>
{props.children}
<AntDesign name='plus' color={primaryText} size={20}></AntDesign>
</TouchableOpacity>
);
};
export default Plus;