A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
use Heading Component
ammarahm-ed6e9366d30804
diff --git a/apps/mobile/src/components/Header/HeaderTitle.js b/apps/mobile/src/components/Header/HeaderTitle.jsindex eebf1ee18..352e77adc 100644--- a/apps/mobile/src/components/Header/HeaderTitle.js+++ b/apps/mobile/src/components/Header/HeaderTitle.js@@ -1,22 +1,15 @@import React from 'react';import {Text} from 'react-native';import {useTracked} from '../../provider';-import {SIZE, WEIGHT} from "../../utils/SizeUtils";+import Heading from '../Typography/Heading';export const HeaderTitle = () => {- const [state,] = useTracked();+ const [state] = useTracked();const {colors, headerTextState} = state;- const style = {- fontSize: SIZE.xl,- color: headerTextState.color || colors.heading,- fontFamily: WEIGHT.bold,- alignSelf: 'center',- };-return (<>- <Text style={style}>+ <Heading color={headerTextState.color}><Textstyle={{color: colors.accent,@@ -27,7 +20,7 @@ export const HeaderTitle = () => {{headerTextState.heading.slice(0, 1) === '#'? headerTextState.heading.slice(1): headerTextState.heading}- </Text>+ </Heading></>);};diff --git a/apps/mobile/src/components/Typography/Heading.js b/apps/mobile/src/components/Typography/Heading.jsnew file mode 100644index 000000000..0c9d01a8a--- /dev/null+++ b/apps/mobile/src/components/Typography/Heading.js@@ -0,0 +1,35 @@+import React from 'react';+import {Text} from 'react-native';+import {useTracked} from '../../provider';+import {SIZE, WEIGHT} from '../../utils/SizeUtils';++/**+ *+ * @typedef {import('react-native').TextProps} TextType+ * @typedef {Object} restTypes+ * @property {string} color color+ * @property {number} size color+ */+/**+ *+ * @param {TextType | restTypes} props all props+ */+const Heading = ({color, size, style, ...restProps}) => {+ const [state] = useTracked();+ const {colors} = state;++ return (+ <Text+ {...restProps}+ style={[+ {+ fontFamily: WEIGHT.bold,+ fontSize: size || SIZE.xl,+ color: color || colors.heading,+ },+ style,+ ]}></Text>+ );+};++export default Heading;