Files
notesnook/apps/mobile/src/components/header/HeaderTitle.js

34 lines
914 B
JavaScript
Raw Normal View History

2020-09-09 22:09:57 +05:00
import React from 'react';
import {Text} 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 (
2020-09-09 22:09:57 +05:00
<>
2020-05-10 22:17:14 +05:00
<Text
style={{
2020-09-09 22:09:57 +05:00
fontSize: SIZE.xl,
color: headerTextState.color ? headerTextState.color : colors.heading,
fontFamily: WEIGHT.bold,
alignSelf: 'center',
2020-05-10 22:17:14 +05:00
}}>
2020-09-09 22:09:57 +05:00
<Text
style={{
color: colors.accent,
}}>
{headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
</Text>
2020-05-10 22:17:14 +05:00
2020-09-09 22:09:57 +05:00
{headerTextState.heading.slice(0, 1) === '#'
? headerTextState.heading.slice(1)
: headerTextState.heading}
</Text>
</>
2020-05-10 22:17:14 +05:00
);
};