Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor: typography

ammarahm-edc5c2ed0bf563
diff --git a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js
index 29842c1f9..60d666de0 100644
--- a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js
+++ b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js
@@ -2,12 +2,17 @@ import React, {createRef, useCallback, useEffect, useState} from 'react';
import {Text, TextInput, TouchableOpacity, View} from 'react-native';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
-import {eSendEvent, sendNoteEditedEvent, ToastEvent} from '../../services/EventManager';
+import {
+ eSendEvent,
+ sendNoteEditedEvent,
+ ToastEvent,
+} from '../../services/EventManager';
import PremiumService from '../../services/PremiumService';
import {db} from '../../utils/DB';
-import { eShowGetPremium } from '../../utils/Events';
+import {eShowGetPremium} from '../../utils/Events';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
import {sleep} from '../../utils/TimeUtils';
+import Paragraph from '../Typography/Paragraph';
const tagsInputRef = createRef();
let prevQuery = null;
@@ -158,20 +163,10 @@ export const ActionSheetTagsSection = ({item, close}) => {
marginLeft: 5,
borderRadius: 2.5,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.pri,
- }}>
- <Text
- style={{
- color: colors.accent,
- }}>
- #
- </Text>
+ <Paragraph>
+ <Paragraph color={colors.accent}>#</Paragraph>
{tag}
- </Text>
+ </Paragraph>
</TouchableOpacity>
);
@@ -191,14 +186,7 @@ export const ActionSheetTagsSection = ({item, close}) => {
{tags.filter(
(o) => o.noteIds.length >= 1 && !note.tags.find((t) => t === o.title),
).length === 0 ? null : (
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs,
- color: colors.pri,
- }}>
- {'Suggested: '}
- </Text>
+ <Paragraph size={SIZE.xs}>{'Suggested: '}</Paragraph>
)}
{suggestions.map((tag) => (
@@ -217,20 +205,10 @@ export const ActionSheetTagsSection = ({item, close}) => {
paddingHorizontal: 0,
paddingVertical: 2.5,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.pri,
- }}>
- <Text
- style={{
- color: colors.accent,
- }}>
- #
- </Text>
+ <Paragraph>
+ <Paragraph color={colors.accent}>#</Paragraph>
{tag.title}
- </Text>
+ </Paragraph>
</TouchableOpacity>
))}
</View>
@@ -244,11 +222,10 @@ export const ActionSheetTagsSection = ({item, close}) => {
alignItems: 'center',
}}>
{!premiumUser ? (
- <Text
+ <Paragraph
+ color={colors.accent}
+ size={SIZE.xs}
style={{
- color: colors.accent,
- fontFamily: WEIGHT.regular,
- fontSize: 10,
marginRight: 4,
marginTop: 2.5,
position: 'absolute',
@@ -256,7 +233,7 @@ export const ActionSheetTagsSection = ({item, close}) => {
top: 0,
}}>
PRO
- </Text>
+ </Paragraph>
) : null}
{note && note.tags ? note.tags.map(_renderTag) : null}
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 9d143efda..54abef999 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -155,11 +155,11 @@ export const ActionSheetComponent = ({
func: () => {
if (note.locked) {
openVault({
- item:item,
- novault:true,
- locked:true,
- share:true,
- })
+ item: item,
+ novault: true,
+ locked: true,
+ share: true,
+ });
} else {
close();
let m = `${note.title}\n \n ${note.content.text}`;
@@ -499,12 +499,9 @@ export const ActionSheetComponent = ({
}}>
<Heading size={SIZE.md}>{note.title.replace('\n', '')}</Heading>
- <Text
+ <Paragraph
numberOfLines={2}
style={{
- fontSize: SIZE.sm,
- color: colors.pri,
- fontFamily: WEIGHT.regular,
width: '100%',
textAlign: 'center',
maxWidth: '100%',
@@ -517,14 +514,13 @@ export const ActionSheetComponent = ({
? note.headline.slice(0, note.headline.length - 1)
: note.headline
: null}
- </Text>
+ </Paragraph>
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
marginTop: 2.5,
}}>
{note.type === 'note'
@@ -536,7 +532,7 @@ export const ActionSheetComponent = ({
{note.dateDeleted
? 'Deleted on ' + timeConverter(note.dateDeleted)
: null}
- </Text>
+ </Paragraph>
{note.type !== 'notebook' ? null : (
<View
@@ -560,16 +556,15 @@ export const ActionSheetComponent = ({
marginRight: 5,
marginVertical: 2.5,
}}>
- <Text
+ <Paragraph
+ size={SIZE.xs}
numberOfLines={1}
+ color="white"
style={{
- color: 'white',
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs,
maxWidth: '100%',
}}>
{topic.title}
- </Text>
+ </Paragraph>
</View>
))
: null}
@@ -577,13 +572,12 @@ export const ActionSheetComponent = ({
)}
{note.type !== 'note' || refreshing ? null : (
- <Text
+ <Paragraph
+ color={colors.accent}
+ size={SIZE.xs}
onPress={onPressSync}
style={{
- color: colors.accent,
- fontSize: SIZE.xs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
marginTop: 5,
borderWidth: 1,
textAlign: 'center',
@@ -595,7 +589,7 @@ export const ActionSheetComponent = ({
{user && user.lastSynced > note.dateEdited
? 'Synced'
: 'Sync Now'}
- </Text>
+ </Paragraph>
)}
{refreshing ? (
@@ -642,15 +636,14 @@ export const ActionSheetComponent = ({
color={note.locked ? '#FF0000' : colors.accent}
size={SIZE.md}
/>
- <Text
+ <Paragraph
+ color={note.locked ? '#FF0000' : colors.accent}
+ size={SIZE.md}
style={{
- color: note.locked ? '#FF0000' : colors.accent,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.md,
marginLeft: 5,
}}>
{note.locked ? 'Remove from Vault' : 'Add to Vault'}
- </Text>
+ </Paragraph>
</PressableButton>
) : null}
diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js
index b45396cc6..b0ab9f25a 100644
--- a/apps/mobile/src/components/AddNotebookDialog/index.js
+++ b/apps/mobile/src/components/AddNotebookDialog/index.js
@@ -23,6 +23,7 @@ import {DDS} from '../../services/DeviceDetection';
import {ActionIcon} from '../ActionIcon';
import DialogButtons from '../Dialog/dialog-buttons';
import DialogHeader from '../Dialog/dialog-header';
+import Paragraph from '../Typography/Paragraph';
let refs = [];
@@ -489,15 +490,12 @@ const TopicItem = ({item, index, colors, onPress, onDelete}) => {
onPress(item, index);
}}
/>
- <Text
+ <Paragraph
style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.primary,
marginRight: index === 0 ? 2 : 0,
}}>
{index + 1 + '.'}
- </Text>
+ </Paragraph>
<TextInput
ref={topicRef}
editable={false}
diff --git a/apps/mobile/src/components/Button/index.js b/apps/mobile/src/components/Button/index.js
index 036899964..5079d39e2 100644
--- a/apps/mobile/src/components/Button/index.js
+++ b/apps/mobile/src/components/Button/index.js
@@ -4,6 +4,8 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {PressableButton} from '../PressableButton';
import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
+import Paragraph from '../Typography/Paragraph';
+import Heading from '../Typography/Heading';
const BUTTON_TYPES = {
transparent: {
@@ -30,7 +32,8 @@ const BUTTON_TYPES = {
shade: {
primary: 'shade',
text: 'accent',
- selected: 'shade',
+ selected: 'accent',
+ opacity: 0.12,
},
};
@@ -43,6 +46,8 @@ export const Button = ({
icon,
fontSize = SIZE.sm,
type = 'transparent',
+ iconSize = SIZE.md,
+ style = {},
}) => {
const [state] = useTracked();
const {colors} = state;
@@ -54,6 +59,7 @@ export const Button = ({
color={colors[BUTTON_TYPES[type].primary]}
selectedColor={colors[BUTTON_TYPES[type].selected]}
alpha={!colors.night ? -0.04 : 0.04}
+ opacity={BUTTON_TYPES[type].opacity || 1}
customStyle={{
height: height,
width: width || null,
@@ -64,6 +70,7 @@ export const Button = ({
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
+ ...style,
}}>
{loading && <ActivityIndicator color={colors[BUTTON_TYPES[type].text]} />}
{icon && !loading && (
@@ -73,16 +80,17 @@ export const Button = ({
marginRight: 0,
}}
color={colors[BUTTON_TYPES[type].text]}
- size={SIZE.md}
+ size={iconSize}
/>
)}
- <Text
- style={[
- styles.buttonText,
- {color: colors[BUTTON_TYPES[type].text], fontSize: fontSize},
- ]}>
- {title}
- </Text>
+ {!title ? null : (
+ <Heading
+ color={colors[BUTTON_TYPES[type].text]}
+ size={fontSize}
+ style={styles.buttonText}>
+ {title}
+ </Heading>
+ )}
</PressableButton>
);
};
@@ -97,9 +105,6 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
buttonText: {
- fontFamily: WEIGHT.bold,
- color: 'white',
- fontSize: SIZE.md,
marginLeft: 5,
},
});
diff --git a/apps/mobile/src/components/ContextMenu/index.js b/apps/mobile/src/components/ContextMenu/index.js
index 4ecf087df..9c3b4baee 100644
--- a/apps/mobile/src/components/ContextMenu/index.js
+++ b/apps/mobile/src/components/ContextMenu/index.js
@@ -4,6 +4,7 @@ import {useTracked} from '../../provider';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import {getElevation} from '../../utils';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import Paragraph from '../Typography/Paragraph';
let contextTimeout = null;
@@ -55,14 +56,7 @@ const ContextMenu = () => {
paddingHorizontal: 12,
borderRadius: 5,
}}>
- <Text
- style={{
- color: 'white',
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- }}>
- {contextMenu.title}
- </Text>
+ <Paragraph color="white">{contextMenu.title}</Paragraph>
</View>
);
};
diff --git a/apps/mobile/src/components/Dialog/DialogHeader.js b/apps/mobile/src/components/Dialog/DialogHeader.js
index 9cb2c40bf..d81a33884 100644
--- a/apps/mobile/src/components/Dialog/DialogHeader.js
+++ b/apps/mobile/src/components/Dialog/DialogHeader.js
@@ -3,6 +3,8 @@ import {Text, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
const DialogHeader = ({icon, title, paragraph}) => {
const [state, dispatch] = useTracked();
@@ -18,25 +20,11 @@ const DialogHeader = ({icon, title, paragraph}) => {
{/* {icon ? (
<Icon name={icon} color={colors.accent} size={SIZE.lg} />
) : null} */}
- <Text
- style={{
- color: colors.heading,
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.xl,
- }}>
- {title}
- </Text>
+ <Heading size={SIZE.xl}>{title}</Heading>
</View>
{paragraph ? (
- <Text
- style={{
- color: colors.icon,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- }}>
- {paragraph}
- </Text>
+ <Paragraph color={colors.icon}>{paragraph}</Paragraph>
) : null}
</>
);
diff --git a/apps/mobile/src/components/Header/HeaderLeftMenu.js b/apps/mobile/src/components/Header/HeaderLeftMenu.js
index 52286f516..39b140b14 100644
--- a/apps/mobile/src/components/Header/HeaderLeftMenu.js
+++ b/apps/mobile/src/components/Header/HeaderLeftMenu.js
@@ -7,7 +7,7 @@ import { ActionIcon } from '../ActionIcon';
export const HeaderLeftMenu = () => {
const [state] = useTracked();
- const {colors, headerMenuState, searchResults} = state;
+ const {colors, headerMenuState, currentScreen} = state;
const onLeftButtonPress = () => {
if (headerMenuState) {
@@ -19,7 +19,7 @@ export const HeaderLeftMenu = () => {
return (
<>
- {!DDS.isTab ? (
+ {!DDS.isTab || currentScreen === 'search' ? (
<ActionIcon
testID="left_menu_button"
customStyle={{
diff --git a/apps/mobile/src/components/Header/HeaderMenu.js b/apps/mobile/src/components/Header/HeaderMenu.js
index dfe58121a..6d8c77c1b 100644
--- a/apps/mobile/src/components/Header/HeaderMenu.js
+++ b/apps/mobile/src/components/Header/HeaderMenu.js
@@ -1,10 +1,11 @@
import React from 'react';
-import {useTracked} from '../../provider';
-import {SIZE, WEIGHT} from '../../utils/SizeUtils';
-import {Text, TouchableOpacity} from 'react-native';
+import { TouchableOpacity } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import {eSendEvent} from '../../services/EventManager';
-import {eOpenSortDialog} from '../../utils/Events';
+import { useTracked } from '../../provider';
+import { eSendEvent } from '../../services/EventManager';
+import { eOpenSortDialog } from '../../utils/Events';
+import { SIZE } from '../../utils/SizeUtils';
+import Paragraph from '../Typography/Paragraph';
export const HeaderMenu = () => {
const [state] = useTracked();
@@ -22,18 +23,15 @@ export const HeaderMenu = () => {
alignItems: 'center',
zIndex:10
}}>
- <Text
+ <Paragraph
style={{
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- color: colors.pri,
marginRight: 5,
height: 35,
textAlignVertical:'center'
}}>
{settings.sort.slice(0, 1).toUpperCase() +
settings.sort.slice(1, settings.sort.length)}
- </Text>
+ </Paragraph>
<Icon
color={colors.pri}
name={
diff --git a/apps/mobile/src/components/Header/HeaderTitle.js b/apps/mobile/src/components/Header/HeaderTitle.js
index 445e19e2c..e13a27135 100644
--- a/apps/mobile/src/components/Header/HeaderTitle.js
+++ b/apps/mobile/src/components/Header/HeaderTitle.js
@@ -2,11 +2,12 @@ import React, {useEffect} from 'react';
import {Text} from 'react-native';
import Animated from 'react-native-reanimated';
import {useTracked} from '../../provider';
+import {DDS} from '../../services/DeviceDetection';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import {eScrollEvent} from '../../utils/Events';
import Heading from '../Typography/Heading';
-const opacity = new Animated.Value(0);
+const opacity = new Animated.Value(DDS.isLargeTablet() ? 1 : 0);
let scrollPostions = {};
@@ -15,6 +16,7 @@ export const HeaderTitle = () => {
const {colors, headerTextState} = state;
const onScroll = async (y) => {
+ if (DDS.isLargeTablet()) return;
if (typeof y !== 'number') {
if (y.type === 'back') {
scrollPostions[y.name] = null;
@@ -42,7 +44,6 @@ export const HeaderTitle = () => {
opacity.setValue(0);
}
scrollPostions[headerTextState.heading] = y;
-
};
useEffect(() => {
@@ -58,12 +59,9 @@ export const HeaderTitle = () => {
opacity: opacity,
}}>
<Heading color={headerTextState.color}>
- <Text
- style={{
- color: colors.accent,
- }}>
+ <Heading color={colors.accent}>
{headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
- </Text>
+ </Heading>
{headerTextState.heading.slice(0, 1) === '#'
? headerTextState.heading.slice(1)
diff --git a/apps/mobile/src/components/Header/index.js b/apps/mobile/src/components/Header/index.js
index 390a0f274..d792dbf9d 100644
--- a/apps/mobile/src/components/Header/index.js
+++ b/apps/mobile/src/components/Header/index.js
@@ -3,21 +3,23 @@ import {ActivityIndicator, Platform, StyleSheet, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {useTracked} from '../../provider';
+import {DDS} from '../../services/DeviceDetection';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import NavigationService from '../../services/Navigation';
-import {dWidth} from '../../utils';
+import {dWidth, getElevation} from '../../utils';
import {eScrollEvent} from '../../utils/Events';
import {SIZE} from '../../utils/SizeUtils';
import {ActionIcon} from '../ActionIcon';
import {SearchInput} from '../SearchInput';
import {HeaderLeftMenu} from './HeaderLeftMenu';
+import { HeaderRightMenu } from './HeaderRightMenu';
import {HeaderTitle} from './HeaderTitle';
export const Header = ({root}) => {
const [state] = useTracked();
const {colors, syncing, currentScreen} = state;
const insets = useSafeAreaInsets();
- const [hide, setHide] = useState(false);
+ const [hide, setHide] = useState(true);
const onScroll = (y) => {
if (y > 150) {
@@ -39,7 +41,7 @@ export const Header = ({root}) => {
style={[
styles.container,
{
- marginTop:Platform.OS === "android"? insets.top : null,
+ marginTop: Platform.OS === 'android' ? insets.top : null,
backgroundColor: colors.bg,
overflow: 'hidden',
borderBottomWidth: 1,
@@ -50,11 +52,11 @@ export const Header = ({root}) => {
<View style={styles.leftBtnContainer}>
<HeaderLeftMenu />
- {Platform.OS === 'android' && currentScreen !== 'search' ? (
+ {Platform.OS === 'android' && currentScreen !== 'search' || Platform.isPad ? (
<HeaderTitle root={root} />
) : null}
</View>
- {Platform.OS !== 'android' && currentScreen !== 'search' ? (
+ {Platform.OS !== 'android' && !Platform.isPad && currentScreen !== 'search' ? (
<HeaderTitle root={root} />
) : null}
@@ -100,17 +102,7 @@ export const Header = ({root}) => {
/>
</View>
) : (
- <View style={styles.rightBtnContainer}>
- <ActionIcon
- onPress={async () => {
- NavigationService.navigate('Search');
- }}
- name="magnify"
- size={SIZE.xxxl}
- color={colors.pri}
- style={styles.rightBtn}
- />
- </View>
+ <HeaderRightMenu/>
)}
</View>
);
diff --git a/apps/mobile/src/components/JumpToDialog/index.js b/apps/mobile/src/components/JumpToDialog/index.js
index a9c4e533e..dc45e465c 100644
--- a/apps/mobile/src/components/JumpToDialog/index.js
+++ b/apps/mobile/src/components/JumpToDialog/index.js
@@ -1,14 +1,15 @@
-import React, {useEffect, useState} from 'react';
-import {ScrollView, Text, View} from 'react-native';
+import React, { useEffect, useState } from 'react';
+import { ScrollView, View } from 'react-native';
import BaseDialog from '../../components/Dialog/base-dialog';
-import {PressableButton} from '../../components/PressableButton';
+import { PressableButton } from '../../components/PressableButton';
import Seperator from '../../components/Seperator';
-import {useTracked} from '../../provider';
-import {DDS} from '../../services/DeviceDetection';
-import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
-import {getElevation, scrollRef} from '../../utils';
-import {eCloseJumpToDialog, eOpenJumpToDialog} from '../../utils/Events';
-import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import { useTracked } from '../../provider';
+import { DDS } from '../../services/DeviceDetection';
+import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
+import { getElevation, scrollRef } from '../../utils';
+import { eCloseJumpToDialog, eOpenJumpToDialog } from '../../utils/Events';
+import { SIZE } from '../../utils/SizeUtils';
+import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
const offsets = [];
@@ -101,16 +102,14 @@ const JumpToDialog = () => {
alignSelf: 'center',
padding: 10,
}}>
- <Text
+ <Heading
+ size={SIZE.xl}
style={{
- fontSize: SIZE.xl,
- fontFamily: WEIGHT.bold,
- color: colors.heading,
alignSelf: 'center',
}}>
{settings.sort.slice(0, 1).toUpperCase() +
settings.sort.slice(1, settings.sort.length)}
- </Text>
+ </Heading>
<Seperator />
<ScrollView
style={{
diff --git a/apps/mobile/src/components/Loading/index.js b/apps/mobile/src/components/Loading/index.js
index 18e674489..78d361f7b 100644
--- a/apps/mobile/src/components/Loading/index.js
+++ b/apps/mobile/src/components/Loading/index.js
@@ -2,7 +2,8 @@ import React from 'react';
import {ActivityIndicator, StyleSheet, Text, View} from 'react-native';
import {useTracked} from '../../provider';
import {Button} from '../Button';
-import {ph, pv, SIZE, WEIGHT} from "../../utils/SizeUtils";
+import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
+import Paragraph from '../Typography/Paragraph';
export const Loading = ({
height = 150,
@@ -10,32 +11,30 @@ export const Loading = ({
done = false,
doneText = 'Action completed successfully!',
onDone = () => {},
- customStyle ={}
+ customStyle = {},
}) => {
const [state, dispatch] = useTracked();
- const {colors, tags, premiumUser} = state;
+ const {colors} = state;
return (
- <View style={[{height: height}, styles.activityContainer, customStyle]}>
+ <View style={[{height: height}, styles.activityContainer, customStyle]}>
{done ? (
<>
- <Text
- style={[
- {color: colors.icon},
- styles.activityText,
- {fontSize: SIZE.xs,fontFamily:WEIGHT.regular},
- ]}>
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
+ style={styles.activityText}>
{doneText}
- </Text>
+ </Paragraph>
<Button onPress={onDone} title="Open File" />
</>
) : (
<>
<ActivityIndicator color={colors.accent} />
- <Text style={[{color: colors.pri}, styles.activityText]}>
+ <Paragraph color={colors.pri} style={styles.activityText}>
{tagline}
- </Text>
+ </Paragraph>
</>
)}
</View>
@@ -68,6 +67,5 @@ const styles = StyleSheet.create({
fontFamily: WEIGHT.medium,
color: 'white',
fontSize: SIZE.sm,
-
},
});
diff --git a/apps/mobile/src/components/Menu/ColorSection.js b/apps/mobile/src/components/Menu/ColorSection.js
index 5887dc541..809cfa6fa 100644
--- a/apps/mobile/src/components/Menu/ColorSection.js
+++ b/apps/mobile/src/components/Menu/ColorSection.js
@@ -8,6 +8,7 @@ import NavigationService from '../../services/Navigation';
import { PressableButton } from '../PressableButton';
import {COLORS_NOTE} from "../../utils/Colors";
import {SIZE, WEIGHT} from "../../utils/SizeUtils";
+import Paragraph from '../Typography/Paragraph';
export const ColorSection = ({noTextMode}) => {
const [state, dispatch] = useTracked();
@@ -100,23 +101,17 @@ export const ColorSection = ({noTextMode}) => {
alignItems: 'center',
width: '85%',
}}>
- <Text
+ <Paragraph
+ color={colors.heading}
style={{
fontFamily: WEIGHT.regular,
fontSize: SIZE.sm,
color: colors.heading,
}}>
{item.title.slice(0, 1).toUpperCase() + item.title.slice(1)}
- </Text>
+ </Paragraph>
- {/* <Text
- style={{
- color: colors.icon,
- fontSize: SIZE.xs,
- paddingHorizontal: 5,
- }}>
- {item.noteIds.length > 99 ? '99+' : item.noteIds.length}
- </Text> */}
+
</View>
)}
</PressableButton>
diff --git a/apps/mobile/src/components/Menu/MenuListItem.js b/apps/mobile/src/components/Menu/MenuListItem.js
index 7ef35aa32..ac93f86db 100644
--- a/apps/mobile/src/components/Menu/MenuListItem.js
+++ b/apps/mobile/src/components/Menu/MenuListItem.js
@@ -1,15 +1,14 @@
import React from 'react';
-import {Text, View} from 'react-native';
+import {View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
+import {DDS} from '../../services/DeviceDetection';
import {eSendEvent} from '../../services/EventManager';
-import {eClearSearch} from '../../utils/Events';
import NavigationService from '../../services/Navigation';
-import {showContext} from '../../utils';
+import {eClearSearch} from '../../utils/Events';
+import {SIZE} from '../../utils/SizeUtils';
import {PressableButton} from '../PressableButton';
-import {SIZE, WEIGHT} from '../../utils/SizeUtils';
-import {DDS} from '../../services/DeviceDetection';
import Paragraph from '../Typography/Paragraph';
export const MenuListItem = ({item, index, noTextMode, ignore, testID}) => {
@@ -24,12 +23,11 @@ export const MenuListItem = ({item, index, noTextMode, ignore, testID}) => {
heading: item.name,
},
});
- dispatch({
- type: Actions.HEADER_VERTICAL_MENU,
- state: item.name === 'Home',
- });
eSendEvent(eClearSearch);
}
+ if (item.name.toLowerCase() === currentScreen) {
+ console.log('already here');
+ }
if (item.func) {
item.func();
} else {
@@ -45,9 +43,6 @@ export const MenuListItem = ({item, index, noTextMode, ignore, testID}) => {
testID={testID}
key={item.name + index}
onPress={_onPress}
- onLongPress={(event) => {
- showContext(event, item.name).then((r) => r);
- }}
color={
currentScreen === item.name.toLowerCase() ? colors.shade : 'transparent'
}
diff --git a/apps/mobile/src/components/Menu/TagsSection.js b/apps/mobile/src/components/Menu/TagsSection.js
index 8d1a6dcd7..16fea0245 100644
--- a/apps/mobile/src/components/Menu/TagsSection.js
+++ b/apps/mobile/src/components/Menu/TagsSection.js
@@ -7,6 +7,7 @@ import NavigationService from '../../services/Navigation';
import {refreshNotesPage} from '../../utils/Events';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
import {PressableButton} from '../PressableButton';
+import Paragraph from '../Typography/Paragraph';
export const TagsSection = () => {
const [state, dispatch] = useTracked();
@@ -76,14 +77,9 @@ export const TagsSection = () => {
justifyContent: 'center',
alignItems: 'flex-start',
}}>
- <Text
- style={{
- color: colors.accent,
- fontSize: SIZE.md,
- fontFamily: WEIGHT.regular,
- }}>
+ <Paragraph color={colors.accent} size={SIZE.md}>
#
- </Text>
+ </Paragraph>
</View>
<View
style={{
@@ -92,25 +88,8 @@ export const TagsSection = () => {
alignItems: 'center',
width: '85%',
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.heading,
- }}>
- {item.title}
- </Text>
+ <Paragraph color={colors.heading}>{item.title}</Paragraph>
- {/* {item.noteIds.length > 1 ? (
- <Text
- style={{
- color: colors.icon,
- fontSize: SIZE.xs,
- paddingHorizontal: 5,
- }}>
- {item.noteIds.length > 99 ? '99+' : item.noteIds.length}
- </Text>
- ) : null} */}
</View>
</PressableButton>
))}
diff --git a/apps/mobile/src/components/Menu/TimeSince.js b/apps/mobile/src/components/Menu/TimeSince.js
index cb3401feb..b405a3d8a 100644
--- a/apps/mobile/src/components/Menu/TimeSince.js
+++ b/apps/mobile/src/components/Menu/TimeSince.js
@@ -1,6 +1,7 @@
import React, {useEffect, useState} from 'react';
import {Text} from 'react-native';
import {timeSince} from "../../utils/TimeUtils";
+import Paragraph from '../Typography/Paragraph';
export const TimeSince = ({time}) => {
const [timeAgo, setTimeAgo] = useState(null);
@@ -18,5 +19,5 @@ export const TimeSince = ({time}) => {
};
},[]);
- return <Text>{timeAgo}</Text>;
+ return <Paragraph>{timeAgo}</Paragraph>;
};
diff --git a/apps/mobile/src/components/Menu/UserSection.js b/apps/mobile/src/components/Menu/UserSection.js
index a011a4025..4d35dcbc2 100644
--- a/apps/mobile/src/components/Menu/UserSection.js
+++ b/apps/mobile/src/components/Menu/UserSection.js
@@ -1,5 +1,6 @@
import React from 'react';
import {ActivityIndicator, Text, TouchableOpacity, View} from 'react-native';
+import {color} from 'react-native-reanimated';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
@@ -9,6 +10,7 @@ import {db} from '../../utils/DB';
import {eOpenLoginDialog} from '../../utils/Events';
import {pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
import {PressableButton} from '../PressableButton';
+import Paragraph from '../Typography/Paragraph';
import {TimeSince} from './TimeSince';
export const UserSection = ({noTextMode}) => {
@@ -30,22 +32,12 @@ export const UserSection = ({noTextMode}) => {
paddingHorizontal: 6,
paddingVertical: 8,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- color: 'white',
- fontSize: SIZE.xs,
- }}>
+ <Paragraph color="white">
<Icon name="account-outline" /> {user.username}
- </Text>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs,
- color: 'white',
- }}>
+ </Paragraph>
+ <Paragraph color="white" size={SIZE.xs}>
{SUBSCRIPTION_STATUS_STRINGS[user.subscription.status]}
- </Text>
+ </Paragraph>
</View>
<TouchableOpacity
@@ -84,11 +76,8 @@ export const UserSection = ({noTextMode}) => {
flexDirection: 'row',
alignItems: 'center',
}}>
- <Text
+ <Paragraph
style={{
- fontFamily: WEIGHT.regular,
- color: colors.pri,
- fontSize: SIZE.sm,
marginLeft: 5,
}}>
{syncing ? 'Syncing ' : 'Synced '}
@@ -100,14 +89,16 @@ export const UserSection = ({noTextMode}) => {
)
) : null}
{'\n'}
- <Text
+ <Paragraph
+ size={SIZE.xs}
+ color={colors.icon}
style={{
fontSize: SIZE.xs,
color: colors.icon,
}}>
{syncing ? 'Fetching your notes ' : 'Tap to sync '}
- </Text>
- </Text>
+ </Paragraph>
+ </Paragraph>
</View>
{syncing ? (
<ActivityIndicator size={SIZE.lg} color={colors.accent} />
@@ -124,7 +115,7 @@ export const UserSection = ({noTextMode}) => {
onLongPress={(event) => {
showContext(event, 'Login');
}}
- color={noTextMode ? 'transparent' : colors.shade}
+ color="transparent"
selectedColor={colors.accent}
alpha={!colors.night ? -0.02 : 0.1}
opacity={0.12}
@@ -132,12 +123,12 @@ export const UserSection = ({noTextMode}) => {
paddingVertical: 12,
marginVertical: 5,
marginTop: pv + 5,
- borderRadius: noTextMode ? 0 : 5,
- width: noTextMode ? '100%' : '93%',
+ borderRadius: 0,
+ width: '100%',
flexDirection: 'row',
alignItems: 'center',
- justifyContent: noTextMode ? 'center' : 'flex-start',
- paddingHorizontal: noTextMode ? 0 : 12,
+ justifyContent: 'flex-start',
+ paddingHorizontal: 8,
}}>
<View
style={{
@@ -163,21 +154,10 @@ export const UserSection = ({noTextMode}) => {
style={{
marginLeft: 10,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- color: colors.icon,
- fontSize: SIZE.xs,
- }}>
+ <Paragraph size={SIZE.xs} color={colors.icon}>
You are not logged in
- </Text>
- <Text
- style={{
- color: colors.accent,
- fontSize: SIZE.sm - 2,
- }}>
- Login to sync notes.
- </Text>
+ </Paragraph>
+ <Paragraph color={colors.accent}>Login to sync notes.</Paragraph>
</View>
)}
</PressableButton>
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index 12e99987d..d46f1ae02 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -27,7 +27,7 @@ export const Menu = React.memo(
const [state, dispatch] = useTracked();
const {colors} = state;
const insets = useSafeAreaInsets();
- const noTextMode = DDS.isTab && !DDS.isSmallTab;
+ const noTextMode = false;
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
let newColors = setColorScheme(colors, accent);
dispatch({type: Actions.THEME, colors: newColors});
@@ -66,7 +66,7 @@ export const Menu = React.memo(
style={{
height: '100%',
width: '100%',
- backgroundColor: colors.bg,
+ backgroundColor:DDS.isLargeTablet()? colors.nav : colors.bg,
paddingTop: insets.top,
borderRightWidth: 1,
borderRightColor: colors.nav,
diff --git a/apps/mobile/src/components/MergeEditor/index.js b/apps/mobile/src/components/MergeEditor/index.js
index 0e746f6db..61d2e1508 100644
--- a/apps/mobile/src/components/MergeEditor/index.js
+++ b/apps/mobile/src/components/MergeEditor/index.js
@@ -19,8 +19,9 @@ import {dHeight} from '../../utils';
import {Button} from '../Button';
import {simpleDialogEvent, updateEvent} from '../DialogManager/recievers';
import {TEMPLATE_APPLY_CHANGES} from '../DialogManager/Templates';
-import {normalize, SIZE} from "../../utils/SizeUtils";
-import {db} from "../../utils/DB";
+import {normalize, SIZE} from '../../utils/SizeUtils';
+import {db} from '../../utils/DB';
+import Paragraph from '../Typography/Paragraph';
const {Value, timing} = Animated;
@@ -280,9 +281,6 @@ const MergeEditor = () => {
link.click();
}`;
-
-
-
return (
<Modal transparent={false} animated animationType="fade" visible={visible}>
<SafeAreaView
@@ -350,14 +348,10 @@ const MergeEditor = () => {
alignItems: 'center',
justifyContent: 'space-between',
}}>
- <Text
- style={{
- color: colors.icon,
- fontSize: SIZE.xxs,
- }}>
+ <Paragraph color={colors.icon} size={SIZE.xxs}>
Saved on 10/10/20 {'\n'}
12:30pm on Tablet
- </Text>
+ </Paragraph>
<Icon
size={SIZE.lg}
name={primary ? 'chevron-up' : 'chevron-down'}
@@ -481,14 +475,10 @@ const MergeEditor = () => {
alignItems: 'center',
justifyContent: 'space-between',
}}>
- <Text
- style={{
- color: colors.icon,
- fontSize: SIZE.xxs,
- }}>
+ <Paragraph color={colors.icon} size={SIZE.xs}>
Saved on 10/10/20 {'\n'}
12:30pm on Tablet
- </Text>
+ </Paragraph>
<Icon
size={SIZE.lg}
name={secondary ? 'chevron-up' : 'chevron-down'}
diff --git a/apps/mobile/src/components/MoveNoteDialog/index.js b/apps/mobile/src/components/MoveNoteDialog/index.js
index 04ce83a34..9f65bc327 100644
--- a/apps/mobile/src/components/MoveNoteDialog/index.js
+++ b/apps/mobile/src/components/MoveNoteDialog/index.js
@@ -11,14 +11,20 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
-import {eSubscribeEvent, eUnSubscribeEvent, ToastEvent} from '../../services/EventManager';
+import {
+ eSubscribeEvent,
+ eUnSubscribeEvent,
+ ToastEvent,
+} from '../../services/EventManager';
import {eOpenMoveNoteDialog} from '../../utils/Events';
import {getElevation} from '../../utils';
import {PressableButton} from '../PressableButton';
import {Toast} from '../Toast';
-import {pv, SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {db} from "../../utils/DB";
-import {DDS} from "../../services/DeviceDetection";
+import {pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {db} from '../../utils/DB';
+import {DDS} from '../../services/DeviceDetection';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
let newNotebookTitle = null;
let newTopicTitle = null;
@@ -146,16 +152,11 @@ const MoveNoteDialog = () => {
}}
color={colors.heading}
/>
- <Text
- style={{
- color: colors.accent,
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.xl,
- }}>
+ <Heading color={colors.accent}>
{selectedItemsList.length > 1
? 'Add notes to notebook'
: 'Add note to notebook'}
- </Text>
+ </Heading>
</View>
<FlatList
@@ -256,27 +257,17 @@ const MoveNoteDialog = () => {
borderBottomColor:
expanded === item.id ? 'transparent' : colors.nav,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.md,
- color: colors.heading,
- }}>
+ <Heading size={SIZE.md}>
{item.title}
{'\n'}
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xxs,
- color: colors.icon,
- }}>
+ <Paragraph size={SIZE.xs} color={colors.icon}>
{item.totalNotes +
' notes' +
' & ' +
item.topics.length +
' topics'}
- </Text>
- </Text>
+ </Paragraph>
+ </Heading>
</View>
</PressableButton>
@@ -393,31 +384,14 @@ const MoveNoteDialog = () => {
flexDirection: 'row',
justifyContent: 'space-between',
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.heading,
- }}>
+ <Paragraph color={colors.heading}>
{item.title}
{'\n'}
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xxs,
- color: colors.icon,
- }}>
+ <Paragraph color={colors.icon} size={SIZE.xs}>
{item.totalNotes + ' notes'}
- </Text>
- </Text>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: colors.accent,
- }}>
- Move
- </Text>
+ </Paragraph>
+ </Paragraph>
+ <Paragraph color={colors.accent}>Move</Paragraph>
</PressableButton>
)}
/>
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js
index c2112256b..adc79c0d2 100644
--- a/apps/mobile/src/components/NoteItem/index.js
+++ b/apps/mobile/src/components/NoteItem/index.js
@@ -181,44 +181,41 @@ export default class NoteItem extends React.Component {
color="orange"
/>
) : null}
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
marginRight: 10,
}}>
{timeSince(item.dateCreated)}
- </Text>
+ </Paragraph>
</>
) : null}
{isTrash ? (
<>
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.accent,
- fontSize: SIZE.xs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
}}>
{item.itemType[0].toUpperCase() +
item.itemType.slice(1) +
' '}
- </Text>
- <Text
+ </Paragraph>
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
}}>
Deleted on{' '}
{item && item.dateDeleted
? new Date(item.dateDeleted).toISOString().slice(0, 10)
: null + ' '}
- </Text>
+ </Paragraph>
</>
) : null}
@@ -231,13 +228,13 @@ export default class NoteItem extends React.Component {
position: 'absolute',
right: 20,
}}>
- <Text
+ <Paragraph
+ size={SIZE.xs}
style={{
- fontSize: SIZE.xs,
color: 'white',
}}>
CONFLICTS
- </Text>
+ </Paragraph>
</View>
) : null}
</View>
diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.js
index c5c6f5dce..ab4a8b684 100644
--- a/apps/mobile/src/components/NotebookItem/index.js
+++ b/apps/mobile/src/components/NotebookItem/index.js
@@ -4,8 +4,10 @@ import {useTracked} from '../../provider';
import NavigationService from '../../services/Navigation';
import {ActionSheetEvent} from '../DialogManager/recievers';
import Seperator from '../Seperator';
-import {ph, pv, SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {ActionIcon} from "../ActionIcon";
+import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {ActionIcon} from '../ActionIcon';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
export const NotebookItem = ({
item,
@@ -14,8 +16,8 @@ export const NotebookItem = ({
isTrash,
customStyle,
}) => {
- const [state,] = useTracked();
- const {colors,} = state;
+ const [state] = useTracked();
+ const {colors} = state;
return (
<View
@@ -40,28 +42,24 @@ export const NotebookItem = ({
minHeight: 50,
justifyContent: 'center',
}}>
- <Text
+ <Heading
+ size={SIZE.md}
numberOfLines={1}
style={{
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.md,
- color: colors.heading,
maxWidth: '100%',
}}>
{item.title}
- </Text>
+ </Heading>
{isTopic || !item.description ? null : (
- <Text
+ <Paragraph
+ size={SIZE.sm}
numberOfLines={2}
style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs + 1,
- color: colors.pri,
maxWidth: '100%',
paddingVertical: 5,
}}>
{item.description}
- </Text>
+ </Paragraph>
)}
{isTopic ? null : (
@@ -91,29 +89,27 @@ export const NotebookItem = ({
marginRight: 5,
marginVertical: 2.5,
}}>
- <Text
+ <Paragraph
+ size={SIZE.xs}
numberOfLines={1}
style={{
color: 'white',
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xxs,
maxWidth: '100%',
}}>
{topic.title}
- </Text>
+ </Paragraph>
</TouchableOpacity>
))
) : (
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xxs,
paddingVertical: pv / 3,
maxWidth: '100%',
}}>
This notebook has no topics.
- </Text>
+ </Paragraph>
)}
</View>
)}
@@ -125,26 +121,24 @@ export const NotebookItem = ({
alignItems: 'center',
marginTop: 5,
}}>
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xs - 1,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
}}>
{'Deleted on: ' + item && item.dateDeleted
? new Date(item.dateDeleted).toISOString().slice(0, 10)
: null + ' '}
- </Text>
- <Text
+ </Paragraph>
+ <Paragraph
+ color={colors.accent}
+ size={SIZE.xs}
style={{
- color: colors.accent,
- fontSize: SIZE.xs - 1,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
}}>
{item.type[0].toUpperCase() + item.type.slice(1) + ' '}
- </Text>
+ </Paragraph>
</View>
) : null}
@@ -156,21 +150,20 @@ export const NotebookItem = ({
marginTop: 5,
}}>
{isTrash ? null : (
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xxs,
textAlignVertical: 'center',
- fontFamily: WEIGHT.regular,
}}>
{new Date(item.dateCreated).toDateString().substring(4)}
- </Text>
+ </Paragraph>
)}
<Seperator half />
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- color: colors.icon,
- fontSize: SIZE.xxs,
textAlignVertical: 'center',
fontFamily: WEIGHT.regular,
}}>
@@ -179,7 +172,7 @@ export const NotebookItem = ({
: item.totalNotes === 1
? item.totalNotes + ' Note'
: '0 Notes'}
- </Text>
+ </Paragraph>
</View>
</View>
{item.title === 'General' && item.type === 'topic' ? null : (
diff --git a/apps/mobile/src/components/Premium/PendingDialog.js b/apps/mobile/src/components/Premium/PendingDialog.js
index 7a3b872c4..3d23b6caf 100644
--- a/apps/mobile/src/components/Premium/PendingDialog.js
+++ b/apps/mobile/src/components/Premium/PendingDialog.js
@@ -5,9 +5,11 @@ import {eClosePendingDialog, eOpenPendingDialog} from '../../utils/Events';
import {dWidth} from '../../utils';
import ActionSheet from '../ActionSheet';
import Seperator from '../Seperator';
-import {SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {db} from "../../utils/DB";
-import {DDS} from "../../services/DeviceDetection";
+import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {db} from '../../utils/DB';
+import {DDS} from '../../services/DeviceDetection';
+import Paragraph from '../Typography/Paragraph';
+import Heading from '../Typography/Heading';
const actionSheet = createRef();
class PendingDialog extends React.Component {
@@ -54,7 +56,7 @@ class PendingDialog extends React.Component {
containerStyle={{
backgroundColor: colors.bg,
alignSelf: 'center',
- width: DDS.isTab? 500 : '100%',
+ width: DDS.isTab ? 500 : '100%',
borderRadius: 10,
marginBottom: DDS.isTab ? 50 : 0,
}}
@@ -74,39 +76,37 @@ class PendingDialog extends React.Component {
initialOffsetFromBottom={1}>
<View
style={{
- width: DDS.isTab? 500 : dWidth,
+ width: DDS.isTab ? 500 : dWidth,
backgroundColor: colors.bg,
justifyContent: 'space-between',
paddingHorizontal: 12,
borderRadius: 10,
paddingTop: 10,
}}>
- <Text
+ <Heading
+ size={SIZE.xxxl}
+ color={colors.accent}
style={{
- fontSize: SIZE.xxxl,
- fontFamily: WEIGHT.bold,
- color: colors.accent,
paddingBottom: 20,
paddingTop: 10,
alignSelf: 'center',
}}>
Thank you!
- </Text>
+ </Heading>
<Seperator />
- <Text
+ <Paragraph
+ size={SIZE.md}
style={{
fontSize: SIZE.md,
- fontFamily: WEIGHT.regular,
- color: colors.pri,
width: '80%',
alignSelf: 'center',
textAlign: 'center',
}}>
We are processing your subscription. You account will be upgraded to
Notesnook Pro very soon.
- </Text>
+ </Paragraph>
<Seperator />
</View>
</ActionSheet>
diff --git a/apps/mobile/src/components/Premium/PremiumDialog.js b/apps/mobile/src/components/Premium/PremiumDialog.js
index 3dfcdddb6..a8a612ad2 100644
--- a/apps/mobile/src/components/Premium/PremiumDialog.js
+++ b/apps/mobile/src/components/Premium/PremiumDialog.js
@@ -8,9 +8,11 @@ import {dHeight, itemSkus, dWidth} from '../../utils';
import ActionSheet from '../ActionSheet';
import {Button} from '../Button';
import Seperator from '../Seperator';
-import {SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {db} from "../../utils/DB";
-import {DDS} from "../../services/DeviceDetection";
+import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {db} from '../../utils/DB';
+import {DDS} from '../../services/DeviceDetection';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
class PremiumDialog extends React.Component {
constructor(props) {
super(props);
@@ -39,7 +41,6 @@ class PremiumDialog extends React.Component {
this.actionSheetRef.current?._setModalVisible(false);
}
-
async getSkus() {
try {
let u = await db.user.get();
@@ -48,8 +49,8 @@ class PremiumDialog extends React.Component {
user: u && u.Id ? u : null,
product: prod[0],
});
- } catch(e) {
- console.log(e,"SKU ERROR")
+ } catch (e) {
+ console.log(e, 'SKU ERROR');
}
}
@@ -79,8 +80,8 @@ class PremiumDialog extends React.Component {
alignSelf: 'center',
borderRadius: 10,
marginBottom: DDS.isTab ? 50 : 0,
- borderBottomRightRadius:0,
- borderBottomLeftRadius:0
+ borderBottomRightRadius: 0,
+ borderBottomLeftRadius: 0,
}}
onOpen={async () => {
await this.getSkus();
@@ -108,17 +109,15 @@ class PremiumDialog extends React.Component {
borderRadius: 10,
paddingTop: 10,
}}>
- <Text
+ <Heading
+ size={SIZE.xxxl}
style={{
- fontSize: SIZE.xxxl,
- fontFamily: WEIGHT.bold,
- color: colors.heading,
paddingBottom: 20,
paddingTop: 10,
alignSelf: 'center',
}}>
Get Notesnook Pro
- </Text>
+ </Heading>
<ScrollView
nestedScrollEnabled={true}
@@ -185,27 +184,24 @@ class PremiumDialog extends React.Component {
color={colors.accent}
/>
- <Text
+ <Heading
+ SIZE={SIZE.md}
style={{
marginLeft: 10,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.md,
maxWidth: '85%',
- color: colors.heading,
}}>
{item.title} {'\n'}
- <Text
+ <Paragraph
+ SIZE={SIZE.xs}
+ color={colors.icon}
style={{
marginLeft: 10,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs + 1,
maxWidth: '85%',
- fontWeight:'400',
- color: colors.icon,
+ fontWeight: '400',
}}>
{item.description}
- </Text>
- </Text>
+ </Paragraph>
+ </Heading>
</View>
</View>
))}
@@ -220,42 +216,30 @@ class PremiumDialog extends React.Component {
backgroundColor: colors.shade,
paddingHorizontal: 12,
}}>
- <Text
- style={{
- fontSize: SIZE.xl,
- fontFamily: WEIGHT.bold,
- color: colors.accent,
- }}>
+ <Heading size={SIZE.xl} color={colors.accent}>
{!this.state.user ? 'Try it Now' : 'Upgrade Now'}
{'\n'}
- <Text
+ <Paragraph
+ size={SIZE.sm}
style={{
- fontSize: 12,
- color: colors.pri,
- fontFamily: WEIGHT.regular,
- fontWeight:"400"
+ fontWeight: '400',
}}>
{this.state.user
? 'Cancel anytime in Subscriptions on Google Play'
: 'Start your 14 Day Trial for Free (no credit card needed)'}
- </Text>
- </Text>
- <Text
+ </Paragraph>
+ </Heading>
+ <Paragraph
+ size={SIZE.xl}
style={{
fontSize: SIZE.xl,
- fontFamily: WEIGHT.medium,
- color: colors.pri,
paddingVertical: 15,
}}>
{this.state.product?.localizedPrice}
- <Text
- style={{
- color: colors.accent,
- fontSize: 12,
- }}>
+ <Paragraph color={colors.accent} size={SIZE.sm}>
/mo
- </Text>
- </Text>
+ </Paragraph>
+ </Paragraph>
<Button
onPress={() => {
if (!this.state.user) {
diff --git a/apps/mobile/src/components/Premium/PremiumStatusDialog.js b/apps/mobile/src/components/Premium/PremiumStatusDialog.js
index b8d4c5151..ae0716db1 100644
--- a/apps/mobile/src/components/Premium/PremiumStatusDialog.js
+++ b/apps/mobile/src/components/Premium/PremiumStatusDialog.js
@@ -6,6 +6,8 @@ import {getElevation} from '../../utils';
import Seperator from '../Seperator';
import {ph, pv, SIZE, WEIGHT} from "../../utils/SizeUtils";
import {DDS} from "../../services/DeviceDetection";
+import Paragraph from '../Typography/Paragraph';
+import Heading from '../Typography/Heading';
const {
eSubscribeEvent,
@@ -57,23 +59,20 @@ const PremiumStatusDialog = () => {
styles.container,
]}>
<View style={styles.headingContainer}>
- <Text style={[{color: colors.accent}, styles.heading]}>
+ <Heading color={colors.accent} style={styles.heading}>
Notesnook Pro
- </Text>
+ </Heading>
</View>
<Seperator />
- <Text
+ <Paragraph
style={{
- color: colors.pri,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
textAlign: 'center',
width: '90%',
alignSelf: 'center',
}}>
Your account has been upgraded to Notesnook Pro successfully. Now
you can enjoy all premium features!
- </Text>
+ </Paragraph>
<Seperator />
</View>
</View>
diff --git a/apps/mobile/src/components/Premium/PremiumTag.js b/apps/mobile/src/components/Premium/PremiumTag.js
index f27b6186e..5a90240ae 100644
--- a/apps/mobile/src/components/Premium/PremiumTag.js
+++ b/apps/mobile/src/components/Premium/PremiumTag.js
@@ -1,7 +1,8 @@
import React from 'react';
-import {Text, View} from 'react-native';
-import {useTracked} from '../../provider';
-import {WEIGHT} from "../../utils/SizeUtils";
+import { View } from 'react-native';
+import { useTracked } from '../../provider';
+import { SIZE } from '../../utils/SizeUtils';
+import Paragraph from '../Typography/Paragraph';
export const PremiumTag = ({pro}) => {
const [state, dispatch] = useTracked();
@@ -17,15 +18,14 @@ export const PremiumTag = ({pro}) => {
marginRight: 20,
elevation: 1,
}}>
- <Text
+ <Paragraph
+ size={SIZE.xs}
style={{
color: 'white',
paddingHorizontal: 4,
- fontSize: 10,
- fontFamily: WEIGHT.regular,
}}>
PRO
- </Text>
+ </Paragraph>
</View>
) : null;
};
diff --git a/apps/mobile/src/components/ProgressDialog/index.js b/apps/mobile/src/components/ProgressDialog/index.js
index 1c7d70733..d1552523c 100644
--- a/apps/mobile/src/components/ProgressDialog/index.js
+++ b/apps/mobile/src/components/ProgressDialog/index.js
@@ -6,12 +6,13 @@ import {eOpenProgressDialog, eCloseProgressDialog} from '../../utils/Events';
import {getElevation} from '../../utils';
import BaseDialog from '../Dialog/base-dialog';
import {Loading} from '../Loading';
-import {ph, SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {DDS} from "../../services/DeviceDetection";
+import {ph, SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {DDS} from '../../services/DeviceDetection';
+import Paragraph from '../Typography/Paragraph';
const ProgressDialog = () => {
const [state, dispatch] = useTracked();
- const {colors,} = state;
+ const {colors} = state;
const [visible, setVisible] = useState(false);
const [dialogData, setDialogData] = useState({
title: 'Loading',
@@ -40,7 +41,7 @@ const ProgressDialog = () => {
<View
style={{
...getElevation(5),
- width: DDS.isTab? 350 : '80%',
+ width: DDS.isTab ? 350 : '80%',
maxHeight: 350,
borderRadius: 5,
backgroundColor: colors.bg,
@@ -48,16 +49,14 @@ const ProgressDialog = () => {
paddingVertical: 20,
}}>
<Loading height={40} tagline={dialogData.title} />
- <Text
+ <Paragraph
+ color={colors.icon}
style={{
- fontFamily: WEIGHT.regular,
alignSelf: 'center',
textAlign: 'center',
- color: colors.icon,
- fontSize: SIZE.xs,
}}>
{dialogData.paragraph}
- </Text>
+ </Paragraph>
</View>
</BaseDialog>
);
diff --git a/apps/mobile/src/components/RecoveryKeyDialog/index.js b/apps/mobile/src/components/RecoveryKeyDialog/index.js
index 835160ac9..b9e30b750 100644
--- a/apps/mobile/src/components/RecoveryKeyDialog/index.js
+++ b/apps/mobile/src/components/RecoveryKeyDialog/index.js
@@ -19,6 +19,8 @@ import {Toast} from '../Toast';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
import {db} from '../../utils/DB';
import Storage from '../../utils/storage';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
class RecoveryKeyDialog extends React.Component {
constructor(props) {
super(props);
@@ -141,19 +143,16 @@ class RecoveryKeyDialog extends React.Component {
borderRadius: 10,
paddingTop: 10,
}}>
- <Text
+ <Heading
numberOfLines={2}
style={{
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.xl,
width: '85%',
maxWidth: '85%',
paddingRight: 10,
marginTop: 10,
- color: colors.heading,
}}>
- Your Recovery Key
- </Text>
+ Recovery Key
+ </Heading>
<View
style={{
@@ -162,18 +161,17 @@ class RecoveryKeyDialog extends React.Component {
padding: 10,
marginTop: 10,
}}>
- <Text
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.md}
numberOfLines={2}
style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.md,
width: '100%',
maxWidth: '100%',
paddingRight: 10,
- color: colors.icon,
}}>
{this.state.key}
- </Text>
+ </Paragraph>
</View>
<Seperator />
@@ -236,18 +234,16 @@ class RecoveryKeyDialog extends React.Component {
borderRadius: 10,
}}>
<Icon color={colors.errorText} size={SIZE.lg} name="alert-circle" />
- <Text
+ <Paragraph
+ color={colors.errorText}
style={{
- color: colors.errorText,
- fontFamily: WEIGHT.regular,
marginLeft: 10,
- fontSize: SIZE.sm,
width: '90%',
}}>
We request you to save your recovery key and keep it in multiple
places. If you forget your password, you can only recover your
data or reset your password using this recovery key.
- </Text>
+ </Paragraph>
</View>
<Seperator />
<Button
diff --git a/apps/mobile/src/components/RestoreDialog/index.js b/apps/mobile/src/components/RestoreDialog/index.js
index 74d39b312..42b393eae 100644
--- a/apps/mobile/src/components/RestoreDialog/index.js
+++ b/apps/mobile/src/components/RestoreDialog/index.js
@@ -1,26 +1,27 @@
-import React, { useEffect, useState } from 'react';
-import { FlatList, Platform, Text, View } from 'react-native';
-import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import React, {useEffect, useState} from 'react';
+import {FlatList, Platform, Text, View} from 'react-native';
+import {useSafeAreaInsets} from 'react-native-safe-area-context';
import RNFetchBlob from 'rn-fetch-blob';
-import { useTracked } from '../../provider';
-import { Actions } from '../../provider/Actions';
-import { DDS } from '../../services/DeviceDetection';
+import {useTracked} from '../../provider';
+import {Actions} from '../../provider/Actions';
+import {DDS} from '../../services/DeviceDetection';
import {
eSubscribeEvent,
eUnSubscribeEvent,
- ToastEvent
+ ToastEvent,
} from '../../services/EventManager';
-import { getElevation } from '../../utils';
-import { db } from '../../utils/DB';
-import { eCloseRestoreDialog, eOpenRestoreDialog } from '../../utils/Events';
-import { ph, SIZE, WEIGHT } from '../../utils/SizeUtils';
+import {getElevation} from '../../utils';
+import {db} from '../../utils/DB';
+import {eCloseRestoreDialog, eOpenRestoreDialog} from '../../utils/Events';
+import {ph, SIZE, WEIGHT} from '../../utils/SizeUtils';
import storage from '../../utils/storage';
-import { sleep } from '../../utils/TimeUtils';
-import { Button } from '../Button';
+import {sleep} from '../../utils/TimeUtils';
+import {Button} from '../Button';
import BaseDialog from '../Dialog/base-dialog';
import DialogButtons from '../Dialog/dialog-buttons';
import DialogHeader from '../Dialog/dialog-header';
-import { Loading } from '../Loading';
+import {Loading} from '../Loading';
+import Paragraph from '../Typography/Paragraph';
const RestoreDialog = () => {
const [state, dispatch] = useTracked();
@@ -108,16 +109,15 @@ const RestoreDialog = () => {
paddingVertical: 20,
}}>
<Loading height={40} tagline="Resoring your data" />
- <Text
+ <Paragraph
+ size={SIZE.xs}
+ color={colors.icon}
style={{
- fontFamily: WEIGHT.regular,
alignSelf: 'center',
textAlign: 'center',
- color: colors.icon,
- fontSize: SIZE.xs,
}}>
Your data is being restored
- </Text>
+ </Paragraph>
</View>
</BaseDialog>
@@ -146,16 +146,11 @@ const RestoreDialog = () => {
borderBottomWidth: 0.5,
borderBottomColor: colors.nav,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.xs + 1,
- color: colors.pri,
- }}>
+ <Paragraph size={SIZE.xs}>
{item.filename
.replace('notesnook_backup_', '')
.replace('.nnbackup', '')}
- </Text>
+ </Paragraph>
<Button
title="Restore"
diff --git a/apps/mobile/src/components/ResultDialog/index.js b/apps/mobile/src/components/ResultDialog/index.js
index 13832b313..d8a3291e3 100644
--- a/apps/mobile/src/components/ResultDialog/index.js
+++ b/apps/mobile/src/components/ResultDialog/index.js
@@ -10,6 +10,8 @@ import {ph, SIZE, WEIGHT} from '../../utils/SizeUtils';
import {Button} from '../Button';
import BaseDialog from '../Dialog/base-dialog';
import Seperator from '../Seperator';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
const ResultDialog = () => {
const [state, dispatch] = useTracked();
@@ -54,27 +56,23 @@ const ResultDialog = () => {
alignItems: 'center',
}}>
<Icon name={dialogData.icon} color={colors.accent} size={80} />
- <Text
+ <Heading
+ size={SIZE.lg}
style={{
- fontFamily: WEIGHT.bold,
alignSelf: 'center',
textAlign: 'center',
- color: colors.heading,
- fontSize: SIZE.lg,
marginTop: 10,
}}>
{dialogData.title}
- </Text>
- <Text
+ </Heading>
+ <Paragraph
+ color={colors.icon}
style={{
- fontFamily: WEIGHT.regular,
alignSelf: 'center',
textAlign: 'center',
- color: colors.icon,
- fontSize: SIZE.sm,
}}>
{dialogData.paragraph}
- </Text>
+ </Paragraph>
<Seperator />
<Button title={dialogData.button} width="100%" onPress={close} />
</View>
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 2718374ae..3da3b61e8 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -10,6 +10,7 @@ import {
import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
+import {DDS} from '../../services/DeviceDetection';
import {eSendEvent, ToastEvent} from '../../services/EventManager';
import {db} from '../../utils/DB';
import {
@@ -83,23 +84,22 @@ const SimpleList = ({
paddingHorizontal: 12,
height: 35,
}}>
- <Text
+ <Paragraph
onPress={() => {
console.log('clicekd');
if (jumpToDialog) {
eSendEvent(eOpenJumpToDialog);
}
}}
- style={[
- styles.sectionHeader,
- {
- color: colors.accent,
- height: 35,
- minWidth: 60,
- },
- ]}>
+ color={colors.accent}
+ style={{
+ height: 35,
+ minWidth: 60,
+ alignSelf: 'center',
+ textAlignVertical: 'center',
+ }}>
{item.title}
- </Text>
+ </Paragraph>
{index === 1 && sortMenuButton ? <HeaderMenu /> : null}
</View>
);
@@ -209,7 +209,8 @@ const SimpleList = ({
break;
case 'MAIN_HEADER':
dim.width = width;
- dim.height = dataType === 'search' ? 0 : 200;
+ dim.height =
+ dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 200;
break;
default:
dim.width = width;
@@ -321,12 +322,6 @@ const styles = StyleSheet.create({
paddingHorizontal: 12,
height: 40,
},
- sectionHeader: {
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.sm,
- alignSelf: 'center',
- textAlignVertical: 'center',
- },
emptyList: {
height: '100%',
width: '100%',
diff --git a/apps/mobile/src/components/SortDialog/index.js b/apps/mobile/src/components/SortDialog/index.js
index c1a681705..c977b5d6b 100644
--- a/apps/mobile/src/components/SortDialog/index.js
+++ b/apps/mobile/src/components/SortDialog/index.js
@@ -3,174 +3,176 @@ import {Text, TouchableOpacity, View} from 'react-native';
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
import {dWidth, SORT, sortSettings} from '../../utils';
import ActionSheet from '../ActionSheet';
-import {DDS} from "../../services/DeviceDetection";
-import {eCloseSortDialog, eOpenSortDialog} from "../../utils/Events";
-import {PressableButton} from "../PressableButton";
-import {SIZE, WEIGHT} from "../../utils/SizeUtils";
-import {defaultState} from "../../provider/DefaultState";
-import {MMKV} from "../../utils/MMKV";
-import {updateEvent} from "../DialogManager/Recievers";
-import {Actions} from "../../provider/Actions";
-import Icon from "react-native-vector-icons/MaterialCommunityIcons";
-import Seperator from "../Seperator";
+import {DDS} from '../../services/DeviceDetection';
+import {eCloseSortDialog, eOpenSortDialog} from '../../utils/Events';
+import {PressableButton} from '../PressableButton';
+import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import {defaultState} from '../../provider/DefaultState';
+import {MMKV} from '../../utils/mmkv';
+import {updateEvent} from '../DialogManager/recievers';
+import {Actions} from '../../provider/Actions';
+import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
+import Seperator from '../Seperator';
import SettingsService from '../../services/SettingsService';
-
-
+import Paragraph from '../Typography/Paragraph';
+import Heading from '../Typography/Heading';
const actionSheet = createRef();
class SortDialog extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- settings: defaultState.settings
+ constructor(props) {
+ super(props);
+ this.state = {
+ settings: defaultState.settings,
+ };
+ }
+
+ async open() {
+ actionSheet.current?._setModalVisible(true);
+ await this.getSettings();
+ }
+
+ async getSettings() {
+ let settings = await MMKV.getItem('settings');
+ this.setState({
+ settings: JSON.parse(settings),
+ });
+ }
+
+ close() {
+ actionSheet.current?._setModalVisible(false);
+ }
+
+ async componentDidMount() {
+ eSubscribeEvent(eOpenSortDialog, this.open.bind(this));
+ eSubscribeEvent(eCloseSortDialog, this.close.bind(this));
+ }
+
+ componentWillUnmount() {
+ eUnSubscribeEvent(eOpenSortDialog, this.open);
+ eUnSubscribeEvent(eCloseSortDialog, this.close);
+ }
+
+ render() {
+ const {colors} = this.props;
+ return (
+ <ActionSheet
+ containerStyle={{
+ backgroundColor: colors.bg,
+ alignSelf: 'center',
+ width: DDS.isTab ? 500 : '100%',
+ borderRadius: 10,
+ marginBottom: DDS.isTab ? 50 : 0,
+ }}
+ extraScroll={DDS.isTab ? 50 : 0}
+ gestureEnabled={true}
+ footerAlwaysVisible={DDS.isTab}
+ footerHeight={DDS.isTab ? 20 : 10}
+ footerStyle={
+ DDS.isTab
+ ? {
+ borderRadius: 10,
+ backgroundColor: colors.bg,
+ }
+ : null
}
- }
-
- async open() {
- actionSheet.current?._setModalVisible(true);
- await this.getSettings();
- }
-
- async getSettings() {
- let settings = await MMKV.getItem("settings");
- this.setState({
- settings: JSON.parse(settings)
- })
- }
-
- close() {
- actionSheet.current?._setModalVisible(false);
- }
-
- async componentDidMount() {
- eSubscribeEvent(eOpenSortDialog, this.open.bind(this));
- eSubscribeEvent(eCloseSortDialog, this.close.bind(this));
- }
-
- componentWillUnmount() {
- eUnSubscribeEvent(eOpenSortDialog, this.open);
- eUnSubscribeEvent(eCloseSortDialog, this.close);
- }
-
- render() {
- const {colors} = this.props;
- return (
- <ActionSheet
- containerStyle={{
- backgroundColor: colors.bg,
- alignSelf: 'center',
- width: DDS.isTab ? 500 : '100%',
- borderRadius: 10,
- marginBottom: DDS.isTab ? 50 : 0,
+ ref={actionSheet}
+ initialOffsetFromBottom={1}>
+ <View
+ style={{
+ width: DDS.isTab ? 500 : dWidth,
+ backgroundColor: colors.bg,
+ justifyContent: 'space-between',
+ paddingHorizontal: 12,
+ borderRadius: 10,
+ paddingTop: 10,
+ }}>
+ <View>
+ <View
+ style={{
+ flexDirection: 'row',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ }}>
+ <Heading
+ size={SIZE.xl}
+ style={{
+ alignSelf: 'center',
+ }}>
+ Sort by
+ </Heading>
+
+ <TouchableOpacity
+ onPress={async () => {
+ let value =
+ this.state.settings.sortOrder === 'asc' ? 'des' : 'asc';
+ await SettingsService.set('sortOrder', value);
+ sortSettings.sortOrder = value;
+ await this.getSettings();
}}
- extraScroll={DDS.isTab ? 50 : 0}
- gestureEnabled={true}
- footerAlwaysVisible={DDS.isTab}
- footerHeight={DDS.isTab ? 20 : 10}
- footerStyle={
- DDS.isTab
- ? {
- borderRadius: 10,
- backgroundColor: colors.bg,
- }
- : null
+ activeOpacity={1}
+ style={{
+ flexDirection: 'row',
+ alignItems: 'center',
+ }}>
+ <Paragraph
+ style={{
+ marginRight: 5,
+ }}>
+ {this.state.settings.sortOrder === 'asc'
+ ? 'Ascending'
+ : 'Descending'}
+ </Paragraph>
+ <Icon
+ color={colors.pri}
+ name={
+ this.state.settings.sortOrder === 'asc'
+ ? 'sort-ascending'
+ : 'sort-descending'
+ }
+ size={SIZE.md}
+ />
+ </TouchableOpacity>
+ </View>
+ <Seperator />
+ {Object.keys(SORT).map((item, index) => (
+ <PressableButton
+ key={item}
+ color={
+ this.state.settings.sort === item
+ ? colors.shade
+ : 'transparent'
}
- ref={actionSheet}
- initialOffsetFromBottom={1}>
- <View
- style={{
- width: DDS.isTab ? 500 : dWidth,
- backgroundColor: colors.bg,
- justifyContent: 'space-between',
- paddingHorizontal: 12,
- borderRadius: 10,
- paddingTop: 10,
- }}>
- <View>
- <View
- style={{
- flexDirection: "row",
- alignItems: 'center',
- justifyContent: 'space-between',
-
- }}
- >
- <Text
- style={{
- fontSize: SIZE.xl,
- fontFamily: WEIGHT.bold,
- color: colors.heading,
- alignSelf: 'center',
- }}>
- Sort by
- </Text>
-
- <TouchableOpacity
- onPress={async () => {
- let value = this.state.settings.sortOrder === "asc" ? "des" : "asc";
- await SettingsService.set('sortOrder', value)
- sortSettings.sortOrder = value;
- await this.getSettings();
- }}
- activeOpacity={1}
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- }}>
- <Text
- style={{
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- color: colors.pri,
- marginRight: 5
- }}>
- {this.state.settings.sortOrder === "asc" ? "Ascending" : "Descending"}
- </Text>
- <Icon color={colors.pri}
- name={this.state.settings.sortOrder === "asc" ? "sort-ascending" : "sort-descending"}
- size={SIZE.md}/>
- </TouchableOpacity>
-
-
- </View>
- <Seperator/>
- {
- Object.keys(SORT).map((item, index) => <PressableButton
- key={item}
- color={this.state.settings.sort === item ? colors.shade : "transparent"}
- onPress={async () => {
- await SettingsService.set('sort', item);
- await this.getSettings();
- sortSettings.sort = item;
- updateEvent({type: Actions.NOTES})
- }}
- selectedColor={this.state.settings.sort === item ? colors.accent : colors.nav}
- alpha={!colors.night ? -0.02 : 0.02}
- opacity={this.state.settings.sort === item ? 0.12 : 1}
- customStyle={{
- width: "100%",
- height: 50
- }}
-
- >
- <Text
- style={{
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- color: this.state.settings.sort === item ? colors.accent : colors.pri
- }}
- >
- {item.slice(0, 1).toUpperCase() + item.slice(1, item.length)}
- </Text>
- </PressableButton>)
- }
- </View>
-
- </View>
- </ActionSheet>
- );
- }
+ onPress={async () => {
+ await SettingsService.set('sort', item);
+ await this.getSettings();
+ sortSettings.sort = item;
+ updateEvent({type: Actions.NOTES});
+ }}
+ selectedColor={
+ this.state.settings.sort === item ? colors.accent : colors.nav
+ }
+ alpha={!colors.night ? -0.02 : 0.02}
+ opacity={this.state.settings.sort === item ? 0.12 : 1}
+ customStyle={{
+ width: '100%',
+ height: 50,
+ }}>
+ <Paragraph
+ color={
+ this.state.settings.sort === item
+ ? colors.accent
+ : colors.pri
+ }>
+ {item.slice(0, 1).toUpperCase() + item.slice(1, item.length)}
+ </Paragraph>
+ </PressableButton>
+ ))}
+ </View>
+ </View>
+ </ActionSheet>
+ );
+ }
}
export default SortDialog;
diff --git a/apps/mobile/src/components/TagItem/index.js b/apps/mobile/src/components/TagItem/index.js
index cf6659041..63161dd4a 100644
--- a/apps/mobile/src/components/TagItem/index.js
+++ b/apps/mobile/src/components/TagItem/index.js
@@ -4,9 +4,11 @@ import {PressableButton} from '../../components/PressableButton';
import {useTracked} from '../../provider';
import NavigationService from '../../services/Navigation';
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
+import Heading from '../Typography/Heading';
+import Paragraph from '../Typography/Paragraph';
const TagItem = ({item, index}) => {
- const [state, ] = useTracked();
+ const [state] = useTracked();
const {colors} = state;
return (
<PressableButton
@@ -28,26 +30,19 @@ const TagItem = ({item, index}) => {
borderBottomWidth: 1.5,
borderBottomColor: colors.nav,
}}>
- <Text
- style={{
- fontFamily: WEIGHT.bold,
- fontSize: SIZE.md,
- color: colors.heading,
- }}>
- <Text
+ <Heading size={SIZE.md}>
+ <Heading
style={{
color: colors.accent,
}}>
#
- </Text>
-
+ </Heading>
{item.title}
- </Text>
- <Text
+ </Heading>
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
style={{
- fontSize: SIZE.xs,
- color: colors.icon,
- fontFamily: WEIGHT.regular,
marginTop: 5,
}}>
{item && item.noteIds.length && item.noteIds.length > 1
@@ -55,7 +50,7 @@ const TagItem = ({item, index}) => {
: item.noteIds.length === 1
? item.noteIds.length + ' note'
: null}
- </Text>
+ </Paragraph>
</PressableButton>
);
};