2020-05-10 22:17:14 +05:00
|
|
|
import React, {createRef, useEffect} from 'react';
|
2020-09-07 17:18:03 +05:00
|
|
|
import {Text, Platform} from 'react-native';
|
2020-05-10 22:17:14 +05:00
|
|
|
import {SIZE, WEIGHT} from '../../common/common';
|
|
|
|
|
import {useTracked} from '../../provider';
|
|
|
|
|
|
|
|
|
|
export const HeaderTitle = ({root}) => {
|
|
|
|
|
const [state, dispatch] = useTracked();
|
|
|
|
|
const {colors} = state;
|
|
|
|
|
let headerTextState = root ? state.headerTextState : state.indHeaderTextState;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Text
|
|
|
|
|
style={{
|
|
|
|
|
fontSize: SIZE.xl,
|
2020-09-07 19:18:49 +05:00
|
|
|
color: headerTextState.color ? headerTextState.color : colors.heading,
|
2020-05-10 22:17:14 +05:00
|
|
|
fontFamily: WEIGHT.bold,
|
2020-09-07 17:18:03 +05:00
|
|
|
alignSelf:'center',
|
2020-05-10 22:17:14 +05:00
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
<Text
|
|
|
|
|
style={{
|
|
|
|
|
color: colors.accent,
|
|
|
|
|
}}>
|
|
|
|
|
{headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
|
|
{headerTextState.heading.slice(0, 1) === '#'
|
|
|
|
|
? headerTextState.heading.slice(1)
|
|
|
|
|
: headerTextState.heading}
|
|
|
|
|
</Text>
|
|
|
|
|
);
|
|
|
|
|
};
|