mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 22:19:41 +01:00
refactor Dialogs
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user