Files
notesnook/apps/mobile/src/components/Dialog/DialogHeader.js

46 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-09-27 13:05:26 +05:00
import React from 'react';
import {Text, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
2020-11-14 10:02:56 +05:00
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
2020-09-27 13:05:26 +05:00
2020-09-27 13:14:24 +05:00
const DialogHeader = ({icon, title, paragraph}) => {
2020-09-27 13:05:26 +05:00
const [state, dispatch] = useTracked();
const colors = state.colors;
return (
2020-09-27 13:14:24 +05:00
<>
<View
2020-09-27 13:05:26 +05:00
style={{
2020-09-27 13:14:24 +05:00
flexDirection: 'row',
alignItems: 'center',
2020-09-27 13:05:26 +05:00
}}>
2020-11-14 10:02:56 +05:00
{/* {icon ? (
2020-09-27 13:14:24 +05:00
<Icon name={icon} color={colors.accent} size={SIZE.lg} />
2020-11-14 10:02:56 +05:00
) : null} */}
2020-09-27 13:14:24 +05:00
<Text
style={{
2020-09-30 13:53:52 +05:00
color: colors.heading,
2020-09-27 13:14:24 +05:00
fontFamily: WEIGHT.bold,
2020-11-14 10:02:56 +05:00
fontSize: SIZE.xl,
2020-09-27 13:14:24 +05:00
}}>
{title}
</Text>
</View>
2020-11-14 10:02:56 +05:00
2020-09-27 13:14:24 +05:00
{paragraph ? (
<Text
style={{
color: colors.icon,
fontFamily: WEIGHT.regular,
2020-11-14 10:02:56 +05:00
fontSize: SIZE.sm,
2020-09-27 13:14:24 +05:00
}}>
{paragraph}
</Text>
) : null}
</>
2020-09-27 13:05:26 +05:00
);
};
2020-09-27 13:14:24 +05:00
export default DialogHeader;