refactor Dialogs

This commit is contained in:
ammarahm-ed
2020-09-27 13:14:24 +05:00
parent ddb9ac0d0e
commit f4091be263
4 changed files with 72 additions and 100 deletions

View File

@@ -3,29 +3,44 @@ import {Text, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
const DialogHeader = ({icon, title}) => {
const DialogHeader = ({icon, title, paragraph}) => {
const [state, dispatch] = useTracked();
const colors = state.colors;
return (
<View
style={{
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}>
{icon ? <Icon name={icon} color={colors.accent} size={SIZE.lg} /> : null}
<Text
<>
<View
style={{
color: colors.accent,
fontFamily: WEIGHT.bold,
marginLeft: 5,
fontSize: SIZE.md,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}>
{title}
</Text>
</View>
{icon ? (
<Icon name={icon} color={colors.accent} size={SIZE.lg} />
) : null}
<Text
style={{
color: colors.accent,
fontFamily: WEIGHT.bold,
marginLeft: 5,
fontSize: SIZE.md,
}}>
{title}
</Text>
</View>
{paragraph ? (
<Text
style={{
color: colors.icon,
fontFamily: WEIGHT.regular,
fontSize: SIZE.xs + 1,
textAlign: 'center',
}}>
{paragraph}
</Text>
) : null}
</>
);
};
export default DialogHeader
export default DialogHeader;