From 302ae5ddb48bd610f3e66a42731bb435b57572c5 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Sat, 28 Mar 2026 09:57:51 +0500 Subject: [PATCH] mobile: format all files It seems prettier was not working properly. Pin prettier version to 2.8.8 in apps/mobile and ran prettier on all files to fix formatting issues. --- apps/mobile/app.json | 2 +- apps/mobile/app/common/database/encryption.ts | 5 +- apps/mobile/app/common/database/index.ts | 2 +- apps/mobile/app/common/filesystem/utils.ts | 8 +- apps/mobile/app/components/app-lock/index.tsx | 4 +- apps/mobile/app/components/auth/login.tsx | 4 +- .../components/container/floating-button.tsx | 8 +- .../app/components/dialog/base-dialog.tsx | 8 +- .../dialogs/applock-password/index.tsx | 18 +- apps/mobile/app/components/list/index.tsx | 8 +- .../app/components/properties/items.tsx | 16 +- .../app/components/sheets/link-note/index.tsx | 4 +- .../components/sheets/references/index.tsx | 4 +- .../app/components/sheets/user/index.tsx | 8 +- .../mobile/app/components/side-menu/index.tsx | 9 +- .../app/components/side-menu/menu-item.tsx | 4 +- .../components/side-menu/notebook-item.tsx | 8 +- apps/mobile/app/components/toast/index.tsx | 20 +- apps/mobile/app/components/ui/input/index.tsx | 4 +- .../app/components/ui/pressable/index.tsx | 4 +- apps/mobile/app/hooks/use-pricing-plans.ts | 16 +- .../app/navigation/fluid-panels-view.tsx | 4 +- .../mobile/app/screens/add-reminder/index.tsx | 122 +- .../editor/tiptap/use-editor-events.tsx | 5 +- .../app/screens/link-notebooks/index.tsx | 9 +- apps/mobile/app/screens/manage-tags/index.tsx | 8 +- .../app/screens/move-notebook/index.tsx | 5 +- apps/mobile/app/screens/settings/2fa.tsx | 16 +- apps/mobile/app/screens/settings/debug.tsx | 8 +- .../app/screens/settings/picker/pickers.jsx | 12 +- .../app/screens/settings/settings-data.tsx | 18 +- apps/mobile/app/services/message.tsx | 2 +- apps/mobile/app/share/search.tsx | 12 +- apps/mobile/app/share/share.tsx | 4 +- apps/mobile/e2e/tests/utils.ts | 5 +- apps/mobile/package-lock.json | 7 +- apps/mobile/package.json | 1 - apps/mobile/worker.js | 3638 +++++++++-------- 38 files changed, 2203 insertions(+), 1837 deletions(-) diff --git a/apps/mobile/app.json b/apps/mobile/app.json index 69640f6ab..a9fc9c671 100644 --- a/apps/mobile/app.json +++ b/apps/mobile/app.json @@ -1,4 +1,4 @@ { "name": "Notesnook", "displayName": "Notesnook" -} \ No newline at end of file +} diff --git a/apps/mobile/app/common/database/encryption.ts b/apps/mobile/app/common/database/encryption.ts index 03027c18b..051ade492 100644 --- a/apps/mobile/app/common/database/encryption.ts +++ b/apps/mobile/app/common/database/encryption.ts @@ -205,8 +205,9 @@ export async function getDatabaseKey(appLockPassword?: string) { } if (await Keychain.hasInternetCredentials("notesnook")) { - const userKeyCredentials = - await Keychain.getInternetCredentials("notesnook"); + const userKeyCredentials = await Keychain.getInternetCredentials( + "notesnook" + ); if (userKeyCredentials) { const userKeyCipher: Cipher = (await encrypt( diff --git a/apps/mobile/app/common/database/index.ts b/apps/mobile/app/common/database/index.ts index ec65abff6..63731f200 100644 --- a/apps/mobile/app/common/database/index.ts +++ b/apps/mobile/app/common/database/index.ts @@ -72,7 +72,7 @@ export async function setupDatabase(password?: string) { ({ compress: Gzip.deflate, decompress: Gzip.inflate - }) as ICompressor, + } as ICompressor), batchSize: 50, sqliteOptions: { dialect: (name) => ({ diff --git a/apps/mobile/app/common/filesystem/utils.ts b/apps/mobile/app/common/filesystem/utils.ts index 9717dadb5..425af83cb 100644 --- a/apps/mobile/app/common/filesystem/utils.ts +++ b/apps/mobile/app/common/filesystem/utils.ts @@ -161,10 +161,10 @@ export async function checkUpload( size === 0 ? `File size is 0.` : size === -1 - ? `File verification check failed.` - : expectedSize !== decryptedLength - ? `File size mismatch. Expected ${size} bytes but got ${decryptedLength} bytes.` - : undefined; + ? `File verification check failed.` + : expectedSize !== decryptedLength + ? `File size mismatch. Expected ${size} bytes but got ${decryptedLength} bytes.` + : undefined; if (error) throw new Error(error); } diff --git a/apps/mobile/app/components/app-lock/index.tsx b/apps/mobile/app/components/app-lock/index.tsx index e6a644291..b652e4bc5 100644 --- a/apps/mobile/app/components/app-lock/index.tsx +++ b/apps/mobile/app/components/app-lock/index.tsx @@ -239,8 +239,8 @@ const AppLocked = () => { deviceMode !== "mobile" ? "50%" : Platform.OS == "ios" - ? "95%" - : "100%", + ? "95%" + : "100%", paddingHorizontal: 12, marginBottom: 30, marginTop: 15, diff --git a/apps/mobile/app/components/auth/login.tsx b/apps/mobile/app/components/auth/login.tsx index 5fb5b72b8..e1e2741f4 100644 --- a/apps/mobile/app/components/auth/login.tsx +++ b/apps/mobile/app/components/auth/login.tsx @@ -195,8 +195,8 @@ export const Login = ({ ? "50%" : "49.99%" : focused - ? "100%" - : "99.9%", + ? "100%" + : "99.9%", backgroundColor: colors.primary.background, alignSelf: "center", paddingHorizontal: DDS.isTab ? 0 : DefaultAppStyles.GAP, diff --git a/apps/mobile/app/components/container/floating-button.tsx b/apps/mobile/app/components/container/floating-button.tsx index f9d8715f8..4baef0bc5 100644 --- a/apps/mobile/app/components/container/floating-button.tsx +++ b/apps/mobile/app/components/container/floating-button.tsx @@ -161,10 +161,10 @@ const FloatingButton = ({ icon ? icon : route.name === "Notebooks" - ? "notebook-plus" - : route.name === "Trash" - ? "delete" - : "plus" + ? "notebook-plus" + : route.name === "Trash" + ? "delete" + : "plus" } color={color || colors.primary.accent} size={size === "small" ? AppFontSize.xl : AppFontSize.xxxl} diff --git a/apps/mobile/app/components/dialog/base-dialog.tsx b/apps/mobile/app/components/dialog/base-dialog.tsx index 03cad8d60..7712c6d4f 100644 --- a/apps/mobile/app/components/dialog/base-dialog.tsx +++ b/apps/mobile/app/components/dialog/base-dialog.tsx @@ -136,8 +136,8 @@ const BaseDialog = ({ backgroundColor: background ? background : transparent - ? "transparent" - : "rgba(0,0,0,0.3)" + ? "transparent" + : "rgba(0,0,0,0.3)" }} > diff --git a/apps/mobile/app/components/dialogs/applock-password/index.tsx b/apps/mobile/app/components/dialogs/applock-password/index.tsx index 70b2c6de3..1c98ebfda 100644 --- a/apps/mobile/app/components/dialogs/applock-password/index.tsx +++ b/apps/mobile/app/components/dialogs/applock-password/index.tsx @@ -201,14 +201,12 @@ export const AppLockPassword = () => { accountPass ? strings.enterAccountPassword() : mode === "change" - ? keyboardType === "pin" - ? strings.newPin() - : strings.newPassword() - : `${ - keyboardType === "pin" - ? strings.pin() - : strings.password() - }` + ? keyboardType === "pin" + ? strings.newPin() + : strings.newPassword() + : `${ + keyboardType === "pin" ? strings.pin() : strings.password() + }` } /> @@ -385,8 +383,8 @@ export const AppLockPassword = () => { mode === "remove" ? strings.remove() : mode === "change" - ? strings.change() - : strings.save() + ? strings.change() + : strings.save() } negativeTitle={strings.cancel()} positiveType="transparent" diff --git a/apps/mobile/app/components/list/index.tsx b/apps/mobile/app/components/list/index.tsx index cc8a07d5a..54279e358 100644 --- a/apps/mobile/app/components/list/index.tsx +++ b/apps/mobile/app/components/list/index.tsx @@ -77,10 +77,10 @@ export default function List(props: ListProps) { props.renderedInRoute === "Notes" ? "home" : props.renderedInRoute === "Favorites" - ? "favorites" - : props.renderedInRoute === "Trash" || props.dataType === "trash" - ? "trash" - : `${props.dataType}s`; + ? "favorites" + : props.renderedInRoute === "Trash" || props.dataType === "trash" + ? "trash" + : `${props.dataType}s`; const groupOptions = useGroupOptions(groupType); diff --git a/apps/mobile/app/components/properties/items.tsx b/apps/mobile/app/components/properties/items.tsx index a79afbce9..ef28b21bd 100644 --- a/apps/mobile/app/components/properties/items.tsx +++ b/apps/mobile/app/components/properties/items.tsx @@ -173,15 +173,15 @@ export const Items = ({ DDS.isTab ? AppFontSize.xxl : shouldShrink - ? AppFontSize.xxl - : AppFontSize.lg + ? AppFontSize.xxl + : AppFontSize.lg } color={ item.checked ? item.activeColor || colors.primary.accent : item.id.match(/(delete|trash)/g) - ? colors.error.icon - : colors.secondary.icon + ? colors.error.icon + : colors.secondary.icon } /> @@ -212,8 +212,8 @@ export const Items = ({ text: item.checked ? item.activeColor || colors.primary.accent : item.id === "delete" || item.id === "trash" - ? colors.error.paragraph - : colors.primary.paragraph + ? colors.error.paragraph + : colors.primary.paragraph }} testID={"icon-" + item.id} onPress={item.onPress} @@ -277,8 +277,8 @@ export const Items = ({ item.checked ? item.activeColor || colors.primary.accent : item.id === "delete" || item.id === "trash" - ? colors.error.icon - : colors.secondary.icon + ? colors.error.icon + : colors.secondary.icon } /> diff --git a/apps/mobile/app/components/sheets/link-note/index.tsx b/apps/mobile/app/components/sheets/link-note/index.tsx index 1f7964747..7d97d2828 100644 --- a/apps/mobile/app/components/sheets/link-note/index.tsx +++ b/apps/mobile/app/components/sheets/link-note/index.tsx @@ -118,8 +118,8 @@ const ListBlockItem = ({ {item?.content.length > 200 ? item?.content.slice(0, 200) + "..." : !item.content || item.content.trim() === "" - ? strings.linkNoteEmptyBlock() - : item.content} + ? strings.linkNoteEmptyBlock() + : item.content} 200 ? item?.content.slice(0, 200) + "..." : !item.content || item.content.trim() === "" - ? strings.linkNoteEmptyBlock() - : item.content} + ? strings.linkNoteEmptyBlock() + : item.content} { progress ? `(${progress.current})` : "" }` : lastSyncStatus === SyncStatus.Failed - ? strings.syncFailed() - : strings.synced()}{" "} + ? strings.syncFailed() + : strings.synced()}{" "} {!syncing ? ( { !user || lastSyncStatus === SyncStatus.Failed ? colors.error.icon : isOffline - ? colors.static.orange - : colors.success.icon + ? colors.static.orange + : colors.success.icon } /> diff --git a/apps/mobile/app/components/side-menu/index.tsx b/apps/mobile/app/components/side-menu/index.tsx index a4972a38e..4d12c9809 100644 --- a/apps/mobile/app/components/side-menu/index.tsx +++ b/apps/mobile/app/components/side-menu/index.tsx @@ -136,8 +136,8 @@ const SimpleTabView = ({ {loadedKeysRef.current.has(route.key) ? getSceneForRoute(route) : navigationState.index === routeIndex - ? getSceneForRoute(route) - : null} + ? getSceneForRoute(route) + : null} ))} @@ -435,8 +435,9 @@ const TabBar = (props: SimpleTabBarProps) => { color={colors.primary.icon} onPress={async () => { if (props.navigationState.index === 1) { - const notebooksFeature = - await isFeatureAvailable("notebooks"); + const notebooksFeature = await isFeatureAvailable( + "notebooks" + ); if (!notebooksFeature.isAllowed) { PaywallSheet.present(notebooksFeature); return; diff --git a/apps/mobile/app/components/side-menu/menu-item.tsx b/apps/mobile/app/components/side-menu/menu-item.tsx index da56da1e6..37ac890c6 100644 --- a/apps/mobile/app/components/side-menu/menu-item.tsx +++ b/apps/mobile/app/components/side-menu/menu-item.tsx @@ -151,8 +151,8 @@ export function MenuItem({ item.icon === "crown" ? colors.static.yellow : isFocused - ? colors.selected.icon - : colors.secondary.icon + ? colors.selected.icon + : colors.secondary.icon } size={AppFontSize.md} /> diff --git a/apps/mobile/app/components/side-menu/notebook-item.tsx b/apps/mobile/app/components/side-menu/notebook-item.tsx index f3aae9fbc..e6538e0f9 100644 --- a/apps/mobile/app/components/side-menu/notebook-item.tsx +++ b/apps/mobile/app/components/side-menu/notebook-item.tsx @@ -98,8 +98,8 @@ export const NotebookItem = ({ item.depth === 0 ? undefined : item.depth < 6 - ? 15 * item.depth - : 15 * 5, + ? 15 * item.depth + : 15 * 5, width: "100%", marginTop: 2 }} @@ -187,8 +187,8 @@ export const NotebookItem = ({ !item.hasChildren || disableExpand ? "book-outline" : expanded - ? "chevron-down" - : "chevron-right" + ? "chevron-down" + : "chevron-right" } /> diff --git a/apps/mobile/app/components/toast/index.tsx b/apps/mobile/app/components/toast/index.tsx index 3535ae1b4..f894b2bc4 100644 --- a/apps/mobile/app/components/toast/index.tsx +++ b/apps/mobile/app/components/toast/index.tsx @@ -158,22 +158,22 @@ export const Toast = ({ context = "global" }) => { toastOptions.icon ? toastOptions.icon : toastOptions.type === "success" - ? "check" - : toastOptions.type === "info" - ? "information" - : "close" + ? "check" + : toastOptions.type === "info" + ? "information" + : "close" } size={isFullToastMessage ? AppFontSize.xxxl : AppFontSize.xl} color={ toastOptions?.icon ? toastOptions?.icon : toastOptions.type === "error" - ? colors.error.icon - : toastOptions.type === "info" - ? isDark - ? colors.static.white - : colors.static.black - : colors.success.icon + ? colors.error.icon + : toastOptions.type === "info" + ? isDark + ? colors.static.white + : colors.static.black + : colors.success.icon } /> diff --git a/apps/mobile/app/components/ui/input/index.tsx b/apps/mobile/app/components/ui/input/index.tsx index 19da9fde2..bca8d6a88 100644 --- a/apps/mobile/app/components/ui/input/index.tsx +++ b/apps/mobile/app/components/ui/input/index.tsx @@ -121,8 +121,8 @@ const Input = ({ const color = error ? colors.error.border : focus - ? customColor || colors.selected.border - : colors.primary.border; + ? customColor || colors.selected.border + : colors.primary.border; const validate = async (value: string) => { if (!validationType) return; diff --git a/apps/mobile/app/components/ui/pressable/index.tsx b/apps/mobile/app/components/ui/pressable/index.tsx index 9d354b22d..f43da699c 100644 --- a/apps/mobile/app/components/ui/pressable/index.tsx +++ b/apps/mobile/app/components/ui/pressable/index.tsx @@ -268,8 +268,8 @@ export const Pressable = ({ const opacity = customOpacity ? customOpacity : type === "accent" - ? 1 - : colorOpacity; + ? 1 + : colorOpacity; const alpha = customAlpha ? customAlpha : isDark ? 0.03 : -0.03; const { fontScale } = useWindowDimensions(); const growFactor = 1 + (fontScale - 1) / 8; diff --git a/apps/mobile/app/hooks/use-pricing-plans.ts b/apps/mobile/app/hooks/use-pricing-plans.ts index 14eb181bc..72deaf64b 100644 --- a/apps/mobile/app/hooks/use-pricing-plans.ts +++ b/apps/mobile/app/hooks/use-pricing-plans.ts @@ -276,8 +276,8 @@ const usePricingPlans = (options?: PricingPlansOptions) => { (product as Plan).period === "yearly" ? (product as Plan).price.gross : (product as Plan).period === "5-year" - ? (product as Plan).price.gross - : (product as Plan).price.gross + ? (product as Plan).price.gross + : (product as Plan).price.gross }`; } @@ -432,8 +432,8 @@ const usePricingPlans = (options?: PricingPlansOptions) => { return period.endsWith("W") ? "week" : period.endsWith("M") - ? "month" - : "year"; + ? "month" + : "year"; } else { const unit = (product as RNIap.SubscriptionIOS) ?.subscriptionPeriodUnitIOS; @@ -475,8 +475,8 @@ const usePricingPlans = (options?: PricingPlansOptions) => { type: phase.billingPeriod.endsWith("W") ? "week" : phase.billingPeriod.endsWith("M") - ? "month" - : "year" + ? "month" + : "year" }; } else { const productIos = product as RNIap.SubscriptionIOS; @@ -607,8 +607,8 @@ const usePricingPlans = (options?: PricingPlansOptions) => { (product as Plan).period === "yearly" ? ((product as Plan).price.gross / 12).toFixed(2) : (product as Plan).period === "5-year" - ? ((product as Plan).price.gross / (12 * 5)).toFixed(2) - : (product as Plan).price.gross + ? ((product as Plan).price.gross / (12 * 5)).toFixed(2) + : (product as Plan).price.gross }`; } diff --git a/apps/mobile/app/navigation/fluid-panels-view.tsx b/apps/mobile/app/navigation/fluid-panels-view.tsx index eef4f57f4..570a3bdad 100644 --- a/apps/mobile/app/navigation/fluid-panels-view.tsx +++ b/apps/mobile/app/navigation/fluid-panels-view.tsx @@ -243,8 +243,8 @@ export const FluidPanelsView = React.memo( const nextDeviceMode = DDS.isLargeTablet() ? "tablet" : DDS.isSmallTab - ? "smallTablet" - : "mobile"; + ? "smallTablet" + : "mobile"; setDeviceMode(nextDeviceMode, size); }, [orientation, setDeviceMode, setDimensions] diff --git a/apps/mobile/app/screens/add-reminder/index.tsx b/apps/mobile/app/screens/add-reminder/index.tsx index 1bd0a234a..a8c78d930 100644 --- a/apps/mobile/app/screens/add-reminder/index.tsx +++ b/apps/mobile/app/screens/add-reminder/index.tsx @@ -400,45 +400,17 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) { recurringMode === RecurringModes.Year ? null : recurringMode === RecurringModes.Week - ? (weekFormat === "Mon" ? WeekDaysMon : WeekDays).map( - (item) => ( -