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

27 lines
661 B
JavaScript
Raw Normal View History

2020-09-09 22:09:57 +05:00
import React from 'react';
2020-09-27 10:15:19 +05:00
import {Text} from 'react-native';
import {useTracked} from '../../provider';
2020-11-04 17:35:24 +05:00
import Heading from '../Typography/Heading';
2020-05-10 22:17:14 +05:00
2020-11-04 09:55:55 +05:00
export const HeaderTitle = () => {
2020-11-04 17:35:24 +05:00
const [state] = useTracked();
2020-09-27 10:15:19 +05:00
const {colors, headerTextState} = state;
2020-05-10 22:17:14 +05:00
return (
2020-09-09 22:09:57 +05:00
<>
2020-11-04 17:35:24 +05:00
<Heading color={headerTextState.color}>
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}
2020-11-04 17:35:24 +05:00
</Heading>
2020-09-09 22:09:57 +05:00
</>
2020-05-10 22:17:14 +05:00
);
};