Skip to content

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

mobile: refactor

ammarahm-ed13cd2d4daa64
diff --git a/apps/mobile/app/components/announcements/cta.js b/apps/mobile/app/components/announcements/cta.js
index 2a08032ff..84428a39d 100644
--- a/apps/mobile/app/components/announcements/cta.js
+++ b/apps/mobile/app/components/announcements/cta.js
@@ -148,7 +148,7 @@ export const Cta = ({ actions, style = {}, color, inline }) => {
<Button
key={item.title}
title={item.title}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
type="gray"
onPress={() => onPress(item)}
width={null}
diff --git a/apps/mobile/app/components/announcements/title.js b/apps/mobile/app/components/announcements/title.js
index ecc908bb7..ed60205cc 100644
--- a/apps/mobile/app/components/announcements/title.js
+++ b/apps/mobile/app/components/announcements/title.js
@@ -67,7 +67,7 @@ export const Title = ({ text, style = {}, inline }) => {
right: 0
}}
iconSize={24}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{
borderRadius: 100,
paddingVertical: 0,
diff --git a/apps/mobile/app/components/attachments/actions.js b/apps/mobile/app/components/attachments/actions.js
index 161185606..6d16c9a6e 100644
--- a/apps/mobile/app/components/attachments/actions.js
+++ b/apps/mobile/app/components/attachments/actions.js
@@ -209,7 +209,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
}}
>
<Paragraph
- size={SIZE.xs + 1}
+ size={SIZE.xs}
style={{
marginRight: 10
}}
@@ -221,7 +221,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
style={{
marginRight: 10
}}
- size={SIZE.xs + 1}
+ size={SIZE.xs}
color={colors.icon}
>
{formatBytes(attachment.length)}
@@ -232,7 +232,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
style={{
marginRight: 10
}}
- size={SIZE.xs + 1}
+ size={SIZE.xs}
color={colors.icon}
>
{attachment.noteIds.length} note
@@ -248,7 +248,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
context: "local"
});
}}
- size={SIZE.xs + 1}
+ size={SIZE.xs}
color={colors.icon}
>
{attachment.metadata.hash}
@@ -304,7 +304,7 @@ const Actions = ({ attachment, setAttachments, fwdRef }) => {
}}
key={item.id}
>
- <Paragraph size={SIZE.xs + 1}>{item.title}</Paragraph>
+ <Paragraph size={SIZE.xs}>{item.title}</Paragraph>
</PressableButton>
))}
</>
diff --git a/apps/mobile/app/components/dialogs/result/pro-features.js b/apps/mobile/app/components/dialogs/result/pro-features.js
index d736e4db1..d89ad5e5d 100644
--- a/apps/mobile/app/components/dialogs/result/pro-features.js
+++ b/apps/mobile/app/components/dialogs/result/pro-features.js
@@ -86,7 +86,7 @@ export const ProFeatures = ({ count = 6 }) => {
await sleep(300);
eSendEvent(eOpenPremiumDialog);
}}
- size={SIZE.xs + 1}
+ size={SIZE.xs}
style={{
textDecorationLine: "underline",
color: colors.icon
diff --git a/apps/mobile/app/components/list-items/reminder/index.tsx b/apps/mobile/app/components/list-items/reminder/index.tsx
index 715920212..1d59f3afd 100644
--- a/apps/mobile/app/components/list-items/reminder/index.tsx
+++ b/apps/mobile/app/components/list-items/reminder/index.tsx
@@ -108,7 +108,7 @@ const ReminderItem = React.memo(
color={colors.errorText}
/>
<Paragraph
- size={SIZE.xs + 1}
+ size={SIZE.xs}
color={colors.icon}
style={{ marginLeft: 5 }}
>
@@ -133,7 +133,7 @@ const ReminderItem = React.memo(
>
<Icon name="reload" size={SIZE.md} color={colors.accent} />
<Paragraph
- size={SIZE.xs + 1}
+ size={SIZE.xs}
color={colors.icon}
style={{ marginLeft: 5 }}
>
@@ -147,7 +147,7 @@ const ReminderItem = React.memo(
<ReminderTime
reminder={item}
checkIsActive={false}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{
justifyContent: "flex-start",
borderWidth: 0,
diff --git a/apps/mobile/app/components/premium/expiring.js b/apps/mobile/app/components/premium/expiring.js
index 48da35566..6f4e71f38 100644
--- a/apps/mobile/app/components/premium/expiring.js
+++ b/apps/mobile/app/components/premium/expiring.js
@@ -143,7 +143,7 @@ export const Expiring = () => {
await sleep(300);
eSendEvent(eOpenPremiumDialog, promo);
}}
- size={SIZE.xs + 1}
+ size={SIZE.xs}
style={{
textDecorationLine: "underline",
color: colors.icon,
diff --git a/apps/mobile/app/components/properties/date-meta.js b/apps/mobile/app/components/properties/date-meta.js
index 0d21c710d..0c7841a2c 100644
--- a/apps/mobile/app/components/properties/date-meta.js
+++ b/apps/mobile/app/components/properties/date-meta.js
@@ -62,10 +62,10 @@ export const DateMeta = ({ item }) => {
paddingVertical: 3
}}
>
- <Paragraph size={SIZE.xs + 1} color={colors.icon}>
+ <Paragraph size={SIZE.xs} color={colors.icon}>
{getNameFromKey(key)}
</Paragraph>
- <Paragraph size={SIZE.xs + 1} color={colors.icon}>
+ <Paragraph size={SIZE.xs} color={colors.icon}>
{timeConverter(item[key])}
</Paragraph>
</View>
diff --git a/apps/mobile/app/components/properties/index.js b/apps/mobile/app/components/properties/index.js
index 62a66e07e..924d9bd12 100644
--- a/apps/mobile/app/components/properties/index.js
+++ b/apps/mobile/app/components/properties/index.js
@@ -108,7 +108,7 @@ export const Properties = ({ close = () => {}, item, buttons = [] }) => {
backgroundColor: "transparent",
paddingHorizontal: 0
}}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
/>
) : null}
</View>
diff --git a/apps/mobile/app/components/properties/items.js b/apps/mobile/app/components/properties/items.js
index 1c8ab6e4e..12b578145 100644
--- a/apps/mobile/app/components/properties/items.js
+++ b/apps/mobile/app/components/properties/items.js
@@ -115,12 +115,12 @@ export const Items = ({ item, buttons, close }) => {
onPress={item.func}
key={item.id}
testID={"icon-" + item.id}
+ activeOpacity={1}
customStyle={{
alignSelf: "flex-start",
- width: topBarItemWidth,
marginRight: isLast ? 0 : 10,
- backgroundColor: "transparent",
- paddingHorizontal: 0
+ paddingHorizontal: 0,
+ width: topBarItemWidth
}}
>
<PressableButton
@@ -183,7 +183,7 @@ export const Items = ({ item, buttons, close }) => {
horizontal
style={{
paddingHorizontal: 12,
- paddingTop: 12
+ paddingVertical: 12
}}
>
{topBarItems.map(renderTopBarItem)}
diff --git a/apps/mobile/app/components/properties/notebooks.js b/apps/mobile/app/components/properties/notebooks.js
index 1fa084325..eac495f32 100644
--- a/apps/mobile/app/components/properties/notebooks.js
+++ b/apps/mobile/app/components/properties/notebooks.js
@@ -162,7 +162,7 @@ export default function Notebooks({ note, close, full }) {
title={topic.title}
type="gray"
height={30}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
icon="bookmark-outline"
style={{
marginRight: 5,
@@ -191,7 +191,7 @@ export default function Notebooks({ note, close, full }) {
{noteNotebooks.length > 1 && !full ? (
<Button
title={`See all linked notebooks`}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{
alignSelf: "flex-end",
marginRight: 12,
diff --git a/apps/mobile/app/components/properties/synced.js b/apps/mobile/app/components/properties/synced.js
index 023726ab0..afb1f6536 100644
--- a/apps/mobile/app/components/properties/synced.js
+++ b/apps/mobile/app/components/properties/synced.js
@@ -91,7 +91,7 @@ export const Synced = ({ item, close }) => {
console.error(e);
}
}}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
title="Learn more"
height={30}
type="grayAccent"
diff --git a/apps/mobile/app/components/properties/tags.js b/apps/mobile/app/components/properties/tags.js
index b77504685..2bd3dd7ed 100644
--- a/apps/mobile/app/components/properties/tags.js
+++ b/apps/mobile/app/components/properties/tags.js
@@ -57,7 +57,7 @@ export const Tags = ({ item, close }) => {
icon="plus"
iconPosition="right"
height={30}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{
marginRight: 5,
borderRadius: 100,
@@ -107,7 +107,7 @@ const TagItem = ({ tag, close }) => {
title={"#" + tag}
type="grayBg"
height={20}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={style}
textStyle={{
textDecorationLine: "underline"
diff --git a/apps/mobile/app/components/properties/topics.js b/apps/mobile/app/components/properties/topics.js
index 0e7ec2c7c..fc34daf07 100644
--- a/apps/mobile/app/components/properties/topics.js
+++ b/apps/mobile/app/components/properties/topics.js
@@ -39,7 +39,7 @@ export const Topics = ({ item, close }) => {
height={30}
onPress={() => open(topic)}
icon="bookmark-outline"
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{
marginRight: 5,
paddingHorizontal: 8,
diff --git a/apps/mobile/app/components/sheets/move-notes/movenote.tsx b/apps/mobile/app/components/sheets/move-notes/movenote.tsx
index 9c100f3d1..304272b24 100644
--- a/apps/mobile/app/components/sheets/move-notes/movenote.tsx
+++ b/apps/mobile/app/components/sheets/move-notes/movenote.tsx
@@ -158,11 +158,7 @@ export const MoveNotes = ({
{item.title}
</Paragraph>
{item.type == "note" && item.headline ? (
- <Paragraph
- numberOfLines={1}
- color={colors.icon}
- size={SIZE.xs + 1}
- >
+ <Paragraph numberOfLines={1} color={colors.icon} size={SIZE.xs}>
{item.headline}
</Paragraph>
) : null}
diff --git a/apps/mobile/app/components/sheets/reminder-notify/index.tsx b/apps/mobile/app/components/sheets/reminder-notify/index.tsx
index 0049b4df2..4c109617d 100644
--- a/apps/mobile/app/components/sheets/reminder-notify/index.tsx
+++ b/apps/mobile/app/components/sheets/reminder-notify/index.tsx
@@ -119,7 +119,7 @@ export default function ReminderNotify({
marginTop: 10
}}
>
- <Paragraph size={SIZE.xs + 1}>Remind me in:</Paragraph>
+ <Paragraph size={SIZE.xs}>Remind me in:</Paragraph>
{QuickActions.map((item) => {
return (
<Button
@@ -127,7 +127,7 @@ export default function ReminderNotify({
key={item.title}
title={item.title}
height={30}
- fontSize={SIZE.xs + 1}
+ fontSize={SIZE.xs}
style={{ marginLeft: 10, borderRadius: 100 }}
onPress={() => onSnooze(item.time)}
/>
@@ -150,7 +150,7 @@ export default function ReminderNotify({
<Paragraph
style={{
color: colors.icon,
- fontSize: SIZE.xs + 1,
+ fontSize: SIZE.xs,
marginBottom: 10
}}
>
diff --git a/apps/mobile/app/components/sheets/reminder/index.tsx b/apps/mobile/app/components/sheets/reminder/index.tsx
index 050d170ad..2df109b6d 100644
--- a/apps/mobile/app/components/sheets/reminder/index.tsx
+++ b/apps/mobile/app/components/sheets/reminder/index.tsx
@@ -550,7 +550,7 @@ export default function ReminderSheet({
}}
>
<>
- <Paragraph size={SIZE.xs + 1} color={colors.icon}>
+ <Paragraph size={SIZE.xs} color={colors.icon}>
{recurringMode === RecurringModes.Daily
? "Repeats daily " + `at ${dayjs(date).format("hh:mm A")}.`
: selectedDays.length === 7 &&
diff --git a/apps/mobile/app/components/ui/notice/index.tsx b/apps/mobile/app/components/ui/notice/index.tsx
index efda55353..7847610e2 100644
--- a/apps/mobile/app/components/ui/notice/index.tsx
+++ b/apps/mobile/app/components/ui/notice/index.tsx
@@ -65,7 +65,7 @@ export const Notice = ({
flexShrink: 1
}}
selectable={selectable}
- size={isSmall ? SIZE.xs + 1 : SIZE.sm}
+ size={isSmall ? SIZE.xs : SIZE.sm}
>
{text}
</Paragraph>
diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.js
index 80da7c661..827847ec3 100644
--- a/apps/mobile/app/hooks/use-actions.js
+++ b/apps/mobile/app/hooks/use-actions.js
@@ -613,7 +613,7 @@ export const useActions = ({ close = () => null, item }) => {
},
{
id: "pin",
- title: "Pin",
+ title: item.pinned ? "Unpin" : "Pin",
icon: item.pinned ? "pin-off-outline" : "pin-outline",
func: pinItem,
close: false,
@@ -623,7 +623,7 @@ export const useActions = ({ close = () => null, item }) => {
},
{
id: "favorite",
- title: "Favorite",
+ title: item.favorite ? "Unfavorite" : "Favorite",
icon: item.favorite ? "star-off" : "star-outline",
func: addToFavorites,
close: false,
@@ -701,7 +701,7 @@ export const useActions = ({ close = () => null, item }) => {
},
{
id: "read-only",
- title: "Read only",
+ title: "Readonly",
icon: "pencil-lock",
func: toggleReadyOnlyMode,
on: item.readonly
diff --git a/apps/mobile/app/screens/settings/user-section.js b/apps/mobile/app/screens/settings/user-section.js
index 27659edca..8a0ecab7e 100644
--- a/apps/mobile/app/screens/settings/user-section.js
+++ b/apps/mobile/app/screens/settings/user-section.js
@@ -109,7 +109,7 @@ const SettingsUserSection = ({ item }) => {
flexGrow: 1
}}
>
- <Heading color={colors.accent} size={SIZE.xs + 1}>
+ <Heading color={colors.accent} size={SIZE.xs}>
{SUBSCRIPTION_STATUS_STRINGS[
user.subscription?.type
]?.toUpperCase() || "Basic"}