2020-09-27 13:05:26 +05:00
|
|
|
import React from 'react';
|
2020-11-23 15:57:31 +05:00
|
|
|
import {View} from 'react-native';
|
2020-09-27 13:05:26 +05:00
|
|
|
import {useTracked} from '../../provider';
|
2020-11-23 15:57:31 +05:00
|
|
|
import {SIZE} from '../../utils/SizeUtils';
|
|
|
|
|
import {Button} from '../Button';
|
2020-11-20 01:23:05 +05:00
|
|
|
import Heading from '../Typography/Heading';
|
|
|
|
|
import Paragraph from '../Typography/Paragraph';
|
2020-09-27 13:05:26 +05:00
|
|
|
|
2020-11-23 15:57:31 +05:00
|
|
|
const DialogHeader = ({icon, title, paragraph, button}) => {
|
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-11-23 15:57:31 +05:00
|
|
|
justifyContent: 'space-between',
|
|
|
|
|
height: 50,
|
2020-09-27 13:05:26 +05:00
|
|
|
}}>
|
2020-11-23 15:57:31 +05:00
|
|
|
<View>
|
|
|
|
|
<Heading size={SIZE.xl}>{title}</Heading>
|
|
|
|
|
{paragraph ? (
|
|
|
|
|
<Paragraph color={colors.icon}>{paragraph}</Paragraph>
|
|
|
|
|
) : null}
|
|
|
|
|
</View>
|
2020-11-14 10:02:56 +05:00
|
|
|
|
2020-11-23 15:57:31 +05:00
|
|
|
{button && (
|
|
|
|
|
<Button
|
|
|
|
|
onPress={button.onPress}
|
|
|
|
|
title={button.title}
|
|
|
|
|
type="grayBg"
|
|
|
|
|
fontSize={SIZE.md}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
2020-09-27 13:14:24 +05:00
|
|
|
</>
|
2020-09-27 13:05:26 +05:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-27 13:14:24 +05:00
|
|
|
export default DialogHeader;
|