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

32 lines
863 B
JavaScript
Raw Normal View History

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