From 50442ede3e6f882bd2be6d349bfbd63e068e414e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Vasconcellos?= Date: Fri, 14 Apr 2023 21:21:21 +0000 Subject: [PATCH] [ENG-469] Make Prettier and ESLint work together (#706) * Make Prettier and ESLint work together - Resolve conflicts between Prettier and ESLint regarding indentation and Tailwind rules order - Add `.editorconfig` to standardize basic formatting options across tools and editors - Add `.gitattributes` to hide `pnpm-lock.yaml` in `git diff` output - Include EditorConfig in the recommended extensions for VSCode - Replace some instances of `pnpm exec ` with `pnpm ` - Remove superfluous Tauri config for Linux * Revert Prettier changes (it was working correctly before) - Update ESLint to read Tailwind config from absolute path - Remove redundant Prettier dependency from subprojects - Specify the source folder for the lint script in subprojects * use mobile's tailwind config with eslint * pnpm format + pnpm lint:fix --------- Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com> --- .editorconfig | 56 ++++++++++++ .gitattributes | 2 + .vscode/extensions.json | 3 +- .vscode/launch.json | 6 +- .vscode/settings.json | 10 ++- .vscode/tasks.json | 5 +- apps/desktop/.eslintrc.js | 7 ++ apps/desktop/package.json | 4 +- apps/desktop/src-tauri/build.js | 2 +- apps/desktop/src-tauri/tauri.conf.json | 2 +- apps/desktop/src-tauri/tauri.linux.conf.json | 84 ------------------ apps/mobile/.eslintrc.js | 8 ++ apps/mobile/package.json | 2 +- apps/mobile/src/App.tsx | 2 +- .../components/dialog/CreateLibraryDialog.tsx | 5 +- .../src/components/drawer/DrawerContent.tsx | 2 +- .../drawer/DrawerLibraryManager.tsx | 25 ++++-- .../src/components/drawer/DrawerLocations.tsx | 6 +- .../src/components/drawer/DrawerTags.tsx | 2 +- .../src/components/explorer/Explorer.tsx | 11 ++- .../src/components/explorer/FileRow.tsx | 2 +- .../explorer/sections/InfoTagPills.tsx | 4 +- apps/mobile/src/components/form/Switch.tsx | 14 ++- apps/mobile/src/components/header/Header.tsx | 4 +- .../src/components/key/PasswordMeter.tsx | 2 +- apps/mobile/src/components/layout/Card.tsx | 5 +- apps/mobile/src/components/layout/Dialog.tsx | 18 ++-- apps/mobile/src/components/layout/Modal.tsx | 24 +++-- .../mobile/src/components/menu/SortByMenu.tsx | 8 +- .../modal/inspector/ActionsModal.tsx | 13 +-- .../modal/inspector/FileInfoModal.tsx | 15 +++- .../components/modal/tag/CreateTagModal.tsx | 5 +- .../components/modal/tag/UpdateTagModal.tsx | 9 +- .../src/components/overview/OverviewStats.tsx | 12 ++- .../src/components/primitive/Button.tsx | 2 +- .../src/components/primitive/InfoPill.tsx | 8 +- apps/mobile/src/components/primitive/Menu.tsx | 4 +- .../components/settings/SettingsContainer.tsx | 6 +- .../src/components/settings/SettingsItem.tsx | 15 ++-- apps/mobile/src/main.tsx | 4 +- apps/mobile/src/navigation/index.tsx | 6 +- .../src/navigation/tabs/SpacedropStack.tsx | 6 +- apps/mobile/src/screens/NotFound.tsx | 2 +- apps/mobile/src/screens/Search.tsx | 10 ++- apps/mobile/src/screens/Spacedrop.tsx | 9 +- apps/mobile/src/screens/Spaces.tsx | 2 +- .../screens/onboarding/CreatingLibrary.tsx | 5 +- .../src/screens/onboarding/GetStarted.tsx | 4 +- .../src/screens/onboarding/MasterPassword.tsx | 10 ++- .../src/screens/onboarding/NewLibrary.tsx | 10 +-- .../mobile/src/screens/onboarding/Privacy.tsx | 12 +-- apps/mobile/src/screens/settings/Settings.tsx | 6 +- .../settings/client/GeneralSettings.tsx | 10 +-- .../settings/client/LibrarySettings.tsx | 6 +- .../settings/library/EditLocationSettings.tsx | 4 +- .../settings/library/LocationSettings.tsx | 19 ++-- .../screens/settings/library/TagsSettings.tsx | 14 ++- apps/web/.eslintrc.js | 8 ++ crates/sync/example/web/src/App.tsx | 23 +++-- .../Explorer/AssignTagMenuItems.tsx | 11 ++- .../app/$libraryId/Explorer/ContextMenu.tsx | 6 +- .../$libraryId/Explorer/File/ContextMenu.tsx | 12 ++- .../Explorer/File/DecryptDialog.tsx | 11 ++- .../Explorer/File/EncryptDialog.tsx | 15 ++-- .../app/$libraryId/Explorer/GridView.tsx | 15 +++- .../$libraryId/Explorer/Inspector/Note.tsx | 5 +- .../$libraryId/Explorer/Inspector/index.tsx | 42 ++++++--- .../app/$libraryId/Explorer/ListView.tsx | 47 ++++++++-- .../app/$libraryId/Explorer/QuickPreview.tsx | 12 ++- .../app/$libraryId/Explorer/SearchBar.tsx | 25 ++++-- interface/app/$libraryId/Explorer/TopBar.tsx | 23 +++-- .../app/$libraryId/Explorer/TopBarButton.tsx | 8 +- .../app/$libraryId/Explorer/TopBarMobile.tsx | 13 ++- interface/app/$libraryId/Explorer/index.tsx | 7 +- interface/app/$libraryId/KeyManager/Key.tsx | 10 ++- .../app/$libraryId/KeyManager/Mounter.tsx | 19 +++- .../app/$libraryId/KeyManager/NotUnlocked.tsx | 5 +- .../$libraryId/Layout/Sidebar/Contents.tsx | 2 +- .../Layout/Sidebar/DebugPopover.tsx | 3 +- .../app/$libraryId/Layout/Sidebar/Footer.tsx | 2 +- .../Layout/Sidebar/IsRunningJob.tsx | 2 +- .../$libraryId/Layout/Sidebar/JobManager.tsx | 13 ++- .../Layout/Sidebar/LibrarySection.tsx | 2 +- .../app/$libraryId/Layout/Sidebar/Link.tsx | 2 +- .../app/$libraryId/Layout/Sidebar/Section.tsx | 4 +- .../Layout/Sidebar/WindowControls.tsx | 4 +- .../app/$libraryId/Layout/Sidebar/helpers.ts | 2 +- interface/app/$libraryId/Layout/index.tsx | 4 +- interface/app/$libraryId/PageLayout.tsx | 2 +- interface/app/$libraryId/location/$id.tsx | 3 +- interface/app/$libraryId/overview.tsx | 20 +++-- interface/app/$libraryId/settings/Setting.tsx | 8 +- .../$libraryId/settings/client/general.tsx | 9 +- .../library/keys/BackupRestoreDialog.tsx | 4 +- .../settings/library/keys/KeyViewerDialog.tsx | 23 +++-- .../library/keys/MasterPasswordDialog.tsx | 24 +++-- .../settings/library/keys/index.tsx | 19 +++- .../settings/library/locations/$id.tsx | 26 ++++-- .../library/locations/AddLocationButton.tsx | 4 +- .../library/locations/AddLocationDialog.tsx | 5 +- .../library/locations/IndexerRuleEditor.tsx | 9 +- .../settings/library/locations/ListItem.tsx | 21 ++++- .../settings/library/tags/CreateDialog.tsx | 6 +- .../settings/library/tags/index.tsx | 6 +- .../settings/node/libraries/CreateDialog.tsx | 22 +++-- .../settings/node/libraries/ListItem.tsx | 4 +- .../settings/node/libraries/index.tsx | 6 +- .../app/$libraryId/settings/node/p2p.tsx | 4 +- .../$libraryId/settings/resources/about.tsx | 4 +- .../settings/resources/dependencies.tsx | 8 +- interface/app/$libraryId/spacedrop.tsx | 39 +++++--- interface/app/$libraryId/tag/$id.tsx | 4 +- interface/app/onboarding/Layout.tsx | 4 +- interface/app/onboarding/master-password.tsx | 7 +- interface/app/onboarding/new-library.tsx | 4 +- interface/app/onboarding/privacy.tsx | 7 +- interface/assets/spline/scene.json | 17 ++-- interface/assets/spline/windows.json | 17 ++-- interface/components/TrafficLights.tsx | 5 +- interface/hooks/useToolBarOptions.tsx | 6 +- interface/package.json | 3 +- interface/types/declarations.d.ts | 10 +-- package.json | 4 +- packages/client/package.json | 2 +- packages/client/src/normi/utils.ts | 5 +- packages/client/src/rspc.ts | 5 +- packages/config/.eslintrc.js | 3 + packages/config/eslint/base.js | 18 +++- packages/config/eslint/reactNative.js | 10 +-- packages/config/eslint/tailwind.js | 21 +++++ packages/config/eslint/web.js | 2 +- packages/config/package.json | 15 ++-- packages/config/vite/relativeAliasResolver.ts | 2 +- packages/ui/package.json | 2 +- packages/ui/src/Button.tsx | 14 +-- packages/ui/src/ContextMenu.tsx | 12 +-- packages/ui/src/Dialog.tsx | 18 +++- packages/ui/src/Dropdown.tsx | 9 +- packages/ui/src/DropdownMenu.tsx | 5 +- packages/ui/src/Input.tsx | 10 ++- packages/ui/src/Switch.tsx | 8 +- packages/ui/src/forms/Input.tsx | 6 +- pnpm-lock.yaml | Bin 802183 -> 815131 bytes turbo.json | 3 +- 144 files changed, 981 insertions(+), 463 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 apps/desktop/.eslintrc.js delete mode 100644 apps/desktop/src-tauri/tauri.linux.conf.json create mode 100644 apps/web/.eslintrc.js create mode 100644 packages/config/.eslintrc.js create mode 100644 packages/config/eslint/tailwind.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..eaa6573cf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,56 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# https://github.com/jokeyrhyme/standard-editorconfig + +# top-most EditorConfig file +root = true + +# defaults +[*] +charset = utf-8 +indent_size = 2 +end_of_line = lf +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# BATS: https://github.com/bats-core/bats-core +# https://github.com/bats-core/bats-core/master/.editorconfig +[*.bats] +insert_final_newline = true +max_line_length = 80 +trim_trailing_whitespace = true + +# CSS +# https://google.github.io/styleguide/htmlcssguide.xml#General_Formatting_Rules +# http://cssguidelin.es/#syntax-and-formatting +[*.css] +trim_trailing_whitespace = true + +# HTML +# https://google.github.io/styleguide/htmlcssguide.xml#General_Formatting_Rules +[*.{htm,html}] +trim_trailing_whitespace = true + +# JavaScript, JSON, JSX, JavaScript Modules, TypeScript +# https://github.com/feross/standard +# https://prettier.io +[*.{cjs,js,json,jsx,mjs,ts,tsx}] +indent_size = 4 + +# Kotlin +# https://android.github.io/kotlin-guides/style.html#indentation +[*.{kt,kts}] +indent_size = 4 + +# Python +# https://www.python.org/dev/peps/pep-0008/#code-lay-out +[*.py] +indent_size = 4 + +# Rust +# https://github.com/rust-lang/rust/blob/master/src/doc/style/style/whitespace.md +[*.rs] +indent_size = 4 +insert_final_newline = false +trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d16251ec2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +pnpm-lock.yaml -diff +package-lock.json -diff diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 6ff490004..469c56d32 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "tauri-apps.tauri-vscode", "rust-lang.rust-analyzer", - "oscartbeaumont.rspc-vscode" + "oscartbeaumont.rspc-vscode", + "EditorConfig.EditorConfig" ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 8c91f9cc7..abe6eed11 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,7 +24,11 @@ "request": "launch", "name": "Tauri Production Debug", "cargo": { - "args": ["build", "--release", "--manifest-path=./apps/desktop/src-tauri/Cargo.toml"], + "args": [ + "build", + "--release", + "--manifest-path=./apps/desktop/src-tauri/Cargo.toml" + ], "problemMatcher": "$rustc" }, "sourceLanguages": ["rust"], diff --git a/.vscode/settings.json b/.vscode/settings.json index daff849f3..9951c11b5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -54,10 +54,14 @@ // "apps/mobile/ios": true }, "eslint.workingDirectories": [ + "apps/desktop", "apps/landing", "apps/mobile", - "packages/ui", + "interface", "packages/client", - "packages/interface" - ] + "packages/config", + "packages/ui" + ], + "eslint.packageManager": "pnpm", + "eslint.lintTask.enable": true } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 86d4e9920..75bf45f1b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -47,7 +47,10 @@ { "type": "cargo", "command": "run", - "args": ["--manifest-path=./apps/desktop/src-tauri/Cargo.toml", "--no-default-features"], + "args": [ + "--manifest-path=./apps/desktop/src-tauri/Cargo.toml", + "--no-default-features" + ], "env": { "RUST_BACKTRACE": "short" }, diff --git a/apps/desktop/.eslintrc.js b/apps/desktop/.eslintrc.js new file mode 100644 index 000000000..615ceae2b --- /dev/null +++ b/apps/desktop/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [require.resolve('@sd/config/eslint/web.js')], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +}; diff --git a/apps/desktop/package.json b/apps/desktop/package.json index ac9773577..309f8b85a 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -11,7 +11,8 @@ "tauri": "tauri", "build": "node ./src-tauri/build.js", "dmg": "open ../../target/release/bundle/dmg/", - "typecheck": "tsc -b" + "typecheck": "tsc -b", + "lint": "eslint src --cache" }, "dependencies": { "@rspc/client": "^0.0.0-main-7c0a67c1", @@ -33,7 +34,6 @@ "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", "@vitejs/plugin-react": "^2.1.0", - "prettier": "^2.7.1", "react-devtools": "^4.27.2", "sass": "^1.55.0", "typescript": "^4.8.4", diff --git a/apps/desktop/src-tauri/build.js b/apps/desktop/src-tauri/build.js index fd6ccfa77..eb769e6ea 100644 --- a/apps/desktop/src-tauri/build.js +++ b/apps/desktop/src-tauri/build.js @@ -5,7 +5,7 @@ process.env.BACKGROUND_FILE = path.join(__dirname, './dmg-background.png'); process.env.BACKGROUND_FILE_NAME = path.basename(process.env.BACKGROUND_FILE); process.env.BACKGROUND_CLAUSE = `set background picture of opts to file ".background:${process.env.BACKGROUND_FILE_NAME}"`; -const child = spawn('pnpm', ['exec', 'tauri', 'build']); +const child = spawn('pnpm', ['tauri', 'build']); child.stdout.on('data', (data) => console.log(data.toString())); child.stderr.on('data', (data) => console.error(data.toString())); child.on('exit', (code) => { diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 7b0bf9602..8177671c9 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "distDir": "../dist", "devPath": "http://localhost:8001", "beforeDevCommand": "pnpm dev-vite", - "beforeBuildCommand": "pnpm exec vite build" + "beforeBuildCommand": "pnpm vite build" }, "tauri": { "macOSPrivateApi": true, diff --git a/apps/desktop/src-tauri/tauri.linux.conf.json b/apps/desktop/src-tauri/tauri.linux.conf.json deleted file mode 100644 index 559809919..000000000 --- a/apps/desktop/src-tauri/tauri.linux.conf.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "package": { - "productName": "Spacedrive", - "version": "0.1.0" - }, - "build": { - "distDir": "../dist", - "devPath": "http://localhost:8001", - "beforeDevCommand": "pnpm dev-vite", - "beforeBuildCommand": "pnpm exec vite build" - }, - "tauri": { - "macOSPrivateApi": true, - "bundle": { - "active": true, - "targets": "all", - "identifier": "com.spacedrive.desktop", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ], - "resources": [], - "externalBin": [], - "copyright": "Spacedrive Technology Inc.", - "shortDescription": "The universal file manager.", - "longDescription": "A cross-platform universal file explorer, powered by an open-source virtual distributed filesystem.", - "deb": { - "depends": [] - }, - "macOS": { - "frameworks": [], - "minimumSystemVersion": "10.14", - "exceptionDomain": "", - "signingIdentity": null, - "entitlements": null - }, - "windows": { - "certificateThumbprint": null, - "digestAlgorithm": "sha256", - "timestampUrl": "" - } - }, - "updater": { - "active": false - }, - "allowlist": { - "all": true, - "protocol": { - "assetScope": ["*"] - }, - "os": { - "all": true - }, - "dialog": { - "all": true, - "open": true, - "save": true - } - }, - "windows": [ - { - "title": "Spacedrive", - "width": 1200, - "height": 725, - "minWidth": 700, - "minHeight": 500, - "resizable": true, - "fullscreen": false, - "alwaysOnTop": false, - "focus": false, - "fileDropEnabled": false, - "decorations": true, - "transparent": true, - "center": true - } - ], - "security": { - "csp": "default-src spacedrive: asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" - } - } -} diff --git a/apps/mobile/.eslintrc.js b/apps/mobile/.eslintrc.js index cd041390b..f4dfc334f 100644 --- a/apps/mobile/.eslintrc.js +++ b/apps/mobile/.eslintrc.js @@ -3,5 +3,13 @@ module.exports = { parserOptions: { tsconfigRootDir: __dirname, project: './tsconfig.json' + }, + rules: { + 'tailwindcss/classnames-order': [ + 'warn', + { + config: './tailwind.config.js' + } + ] } }; diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 5d5a032c0..6f75770df 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -10,7 +10,7 @@ "ios": "expo run:ios", "xcode": "open ios/spacedrive.xcworkspace", "android-studio": "open -a '/Applications/Android Studio.app' ./android", - "lint": "eslint src", + "lint": "eslint src --cache", "typecheck": "tsc -b", "clean:android": "cd android && ./gradlew clean && cd ../", "clean:ios": "cd ios && xcodebuild clean && cd ../" diff --git a/apps/mobile/src/App.tsx b/apps/mobile/src/App.tsx index 71780b506..155aff96d 100644 --- a/apps/mobile/src/App.tsx +++ b/apps/mobile/src/App.tsx @@ -107,7 +107,7 @@ function AppContainer() { const { id } = useSnapshot(currentLibraryStore); return ( - + diff --git a/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx b/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx index 6d16aa79b..85ad11d16 100644 --- a/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx +++ b/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx @@ -27,7 +27,10 @@ const CreateLibraryDialog = ({ children, onSubmit, disableBackdropClose }: Props setLibName(''); // We do this instead of invalidating the query because it triggers a full app re-render?? - queryClient.setQueryData(['library.list'], (libraries: any) => [...(libraries || []), lib]); + queryClient.setQueryData(['library.list'], (libraries: any) => [ + ...(libraries || []), + lib + ]); // Switch to the new library currentLibraryStore.id = lib.uuid; diff --git a/apps/mobile/src/components/drawer/DrawerContent.tsx b/apps/mobile/src/components/drawer/DrawerContent.tsx index fe5bbafe8..a9a8fbaf7 100644 --- a/apps/mobile/src/components/drawer/DrawerContent.tsx +++ b/apps/mobile/src/components/drawer/DrawerContent.tsx @@ -24,7 +24,7 @@ const DrawerContent = ({ navigation, state }: DrawerContentComponentProps) => { - Spacedrive + Spacedrive {/* Library Manager */} diff --git a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx index 94df55e5d..8289c3f2c 100644 --- a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx +++ b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx @@ -29,13 +29,15 @@ const DrawerLibraryManager = () => { setDropdownClosed((v) => !v)}> - {currentLibrary?.config.name} + + {currentLibrary?.config.name} + { - + {/* Libraries */} {libraries.data?.map((library) => { // console.log('library', library); return ( - (currentLibraryStore.id = library.uuid)}> + (currentLibraryStore.id = library.uuid)} + > @@ -83,7 +88,9 @@ const DrawerLibraryManager = () => { {/* Manage Library */} navigation.navigate('Settings', { screen: 'LibraryGeneralSettings' })} + onPress={() => + navigation.navigate('Settings', { screen: 'LibraryGeneralSettings' }) + } > diff --git a/apps/mobile/src/components/drawer/DrawerLocations.tsx b/apps/mobile/src/components/drawer/DrawerLocations.tsx index 41507c262..75f91033b 100644 --- a/apps/mobile/src/components/drawer/DrawerLocations.tsx +++ b/apps/mobile/src/components/drawer/DrawerLocations.tsx @@ -63,8 +63,10 @@ const DrawerLocations = ({ stackName }: DrawerLocationsProp) => { {/* Add Location */} importModalRef.current?.present()}> - - Add Location + + + Add Location + diff --git a/apps/mobile/src/components/drawer/DrawerTags.tsx b/apps/mobile/src/components/drawer/DrawerTags.tsx index 1d07ee50d..f0bf7178b 100644 --- a/apps/mobile/src/components/drawer/DrawerTags.tsx +++ b/apps/mobile/src/components/drawer/DrawerTags.tsx @@ -62,7 +62,7 @@ const DrawerTags = ({ stackName }: DrawerTagsProp) => { {/* Add Tag */} createTagModalRef.current?.present()}> - + Add Tag diff --git a/apps/mobile/src/components/explorer/Explorer.tsx b/apps/mobile/src/components/explorer/Explorer.tsx index b27064c5d..15ace1b28 100644 --- a/apps/mobile/src/components/explorer/Explorer.tsx +++ b/apps/mobile/src/components/explorer/Explorer.tsx @@ -32,7 +32,10 @@ const Explorer = ({ data }: ExplorerProps) => { function handlePress(data: ExplorerItem) { if (isPath(data) && data.item.is_dir) { - navigation.push('Location', { id: data.item.location_id, path: data.item.materialized_path }); + navigation.push('Location', { + id: data.item.location_id, + path: data.item.materialized_path + }); } else { setData(data); modalRef.current?.present(); @@ -65,7 +68,11 @@ const Explorer = ({ data }: ExplorerProps) => { keyExtractor={(item) => item.item.id.toString()} renderItem={({ item }) => ( handlePress(item)}> - {layoutMode === 'grid' ? : } + {layoutMode === 'grid' ? ( + + ) : ( + + )} )} extraData={layoutMode} diff --git a/apps/mobile/src/components/explorer/FileRow.tsx b/apps/mobile/src/components/explorer/FileRow.tsx index 0e1c8789c..f28636616 100644 --- a/apps/mobile/src/components/explorer/FileRow.tsx +++ b/apps/mobile/src/components/explorer/FileRow.tsx @@ -20,7 +20,7 @@ const FileRow = ({ data }: FileRowProps) => { > - + {filePath?.name} {filePath?.extension && `.${filePath.extension}`} diff --git a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx index def056832..ac5c1e457 100644 --- a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx +++ b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx @@ -27,7 +27,9 @@ const InfoTagPills = ({ data, style }: Props) => { text={isDir ? 'Folder' : ObjectKind[objectData?.kind || 0]!} /> {/* Extension */} - {filePath?.extension && } + {filePath?.extension && ( + + )} {/* TODO: What happens if I have too many? */} {tagsQuery.data?.map((tag) => ( = ({ ...props }) => { return ( - + ); }; @@ -14,10 +17,13 @@ export const SwitchContainer: FC = ({ title, description, return ( - {title} - {description && {description}} + {title} + {description && {description}} - + ); }; diff --git a/apps/mobile/src/components/header/Header.tsx b/apps/mobile/src/components/header/Header.tsx index febe7b284..6bed71021 100644 --- a/apps/mobile/src/components/header/Header.tsx +++ b/apps/mobile/src/components/header/Header.tsx @@ -17,7 +17,7 @@ export default function Header() { return ( @@ -38,7 +38,7 @@ export default function Header() { style={tw`h-full flex-1 justify-center`} onPress={() => navigation.navigate('Search')} > - Search + Search diff --git a/apps/mobile/src/components/key/PasswordMeter.tsx b/apps/mobile/src/components/key/PasswordMeter.tsx index aa656f160..83cc693fe 100644 --- a/apps/mobile/src/components/key/PasswordMeter.tsx +++ b/apps/mobile/src/components/key/PasswordMeter.tsx @@ -29,7 +29,7 @@ const PasswordMeter = (props: PasswordMeterProps) => { {scoreText} - + { return ( {children} diff --git a/apps/mobile/src/components/layout/Dialog.tsx b/apps/mobile/src/components/layout/Dialog.tsx index 487c1685d..85ba31664 100644 --- a/apps/mobile/src/components/layout/Dialog.tsx +++ b/apps/mobile/src/components/layout/Dialog.tsx @@ -48,7 +48,9 @@ const Dialog = (props: DialogProps) => { {props.trigger && ( (props.setIsVisible ? props.setIsVisible(true) : setVisible(true))} + onPress={() => + props.setIsVisible ? props.setIsVisible(true) : setVisible(true) + } > {props.trigger} @@ -56,7 +58,7 @@ const Dialog = (props: DialogProps) => { {/* Backdrop */} @@ -74,14 +76,14 @@ const Dialog = (props: DialogProps) => { > {/* TODO: Blur may look cool here */} {/* Title */} - {props.title} + {props.title} {/* Description */} {props.description && ( - + {props.description} )} @@ -90,7 +92,7 @@ const Dialog = (props: DialogProps) => { {/* Actions */} {props.loading && } @@ -99,7 +101,7 @@ const Dialog = (props: DialogProps) => { disabled={props.loading} // Disables Close button if loading onPress={handleCloseDialog} > - Close + Close {props.ctaAction && ( )} diff --git a/apps/mobile/src/components/layout/Modal.tsx b/apps/mobile/src/components/layout/Modal.tsx index 89871f5cb..542b65b82 100644 --- a/apps/mobile/src/components/layout/Modal.tsx +++ b/apps/mobile/src/components/layout/Modal.tsx @@ -26,13 +26,13 @@ interface ModalHandle extends BottomSheetHandleProps { const ModalHandle = (props: ModalHandle) => ( {props.showCloseButton && ( props.modalRef.current?.close()} - style={tw`bg-app-button absolute top-5 right-4 h-7 w-7 items-center justify-center rounded-full`} + style={tw`absolute top-5 right-4 h-7 w-7 items-center justify-center rounded-full bg-app-button`} > @@ -61,7 +61,7 @@ export const Modal = forwardRef((props, ref) => { handleComponent={(props) => ModalHandle({ modalRef, showCloseButton, ...props })} {...otherProps} > - {title && {title}} + {title && {title}} {children} ); @@ -107,16 +107,22 @@ export const ConfirmModal = forwardRef((props, ref) ref={modalRef} backgroundStyle={tw`bg-app`} backdropComponent={ModalBackdrop} - handleComponent={(props) => ModalHandle({ modalRef, showCloseButton: false, ...props })} + handleComponent={(props) => + ModalHandle({ modalRef, showCloseButton: false, ...props }) + } snapPoints={props.snapPoints ?? ['25%']} > {/* Title */} {props.title && ( - {props.title} + + {props.title} + )} {/* Description */} - {props.description && {props.description}} + {props.description && ( + {props.description} + )} {/* Children */} {props.children && props.children} {/* Buttons */} @@ -128,7 +134,7 @@ export const ConfirmModal = forwardRef((props, ref) disabled={props.loading} // Disables Close button if loading onPress={() => modalRef.current?.close()} > - Close + Close {props.ctaAction && ( )} diff --git a/apps/mobile/src/components/menu/SortByMenu.tsx b/apps/mobile/src/components/menu/SortByMenu.tsx index 1ab71e105..5f6d135ad 100644 --- a/apps/mobile/src/components/menu/SortByMenu.tsx +++ b/apps/mobile/src/components/menu/SortByMenu.tsx @@ -26,7 +26,7 @@ const SortByMenu = () => { - {sortOptions[sortBy]} + {sortOptions[sortBy]} {sortDirection === 'asc' ? : } } @@ -35,7 +35,11 @@ const SortByMenu = () => { ; const ActionsContainer = ({ children, style }: ActionsContainerProps) => ( - {children} + {children} ); type ActionsItemProps = { @@ -53,7 +53,7 @@ const ActionsItem = ({ icon, onPress, title, isDanger = false }: ActionsItemProp ); }; -const ActionDivider = () => ; +const ActionDivider = () => ; export const ActionsModal = () => { const fileInfoRef = useRef(null); @@ -75,15 +75,18 @@ export const ActionsModal = () => { {/* Name + Extension */} - + {filePath?.name} {filePath?.extension && `.${filePath?.extension}`} - + {formatBytes(Number(filePath?.size_in_bytes || 0))}, - + {' '} {dayjs(filePath?.date_created).format('MMM Do YYYY')} diff --git a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx index ba88a9290..5ce402155 100644 --- a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx +++ b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx @@ -69,13 +69,18 @@ const FileInfoModal = forwardRef((props, ref) => { {data && ( {/* Back Button */} - modalRef.current?.close()} style={tw`absolute z-10 ml-4`}> + modalRef.current?.close()} + style={tw`absolute z-10 ml-4`} + > {/* File Icon / Name */} - {filePathData?.name} + + {filePathData?.name} + {/* Details */} @@ -112,7 +117,11 @@ const FileInfoModal = forwardRef((props, ref) => { <> {/* TODO: Note */} {filePathData.cas_id && ( - + )} {/* Checksum */} {filePathData?.integrity_checksum && ( diff --git a/apps/mobile/src/components/modal/tag/CreateTagModal.tsx b/apps/mobile/src/components/modal/tag/CreateTagModal.tsx index 3144c6213..6b9a62a60 100644 --- a/apps/mobile/src/components/modal/tag/CreateTagModal.tsx +++ b/apps/mobile/src/components/modal/tag/CreateTagModal.tsx @@ -76,7 +76,10 @@ const CreateTagModal = forwardRef((_, ref) => { {showPicker && ( - setTagColor(color)} /> + setTagColor(color)} + /> )} diff --git a/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx b/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx index ea520d7d5..e9fe5f13b 100644 --- a/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx +++ b/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx @@ -56,9 +56,9 @@ const UpdateTagModal = forwardRef((props, ref) => { showCloseButton > - Name + Name setTagName(t)} /> - Color + Color setShowPicker((v) => !v)} @@ -70,7 +70,10 @@ const UpdateTagModal = forwardRef((props, ref) => { {showPicker && ( - setTagColor(color)} /> + setTagColor(color)} + /> )} diff --git a/apps/mobile/src/components/overview/OverviewStats.tsx b/apps/mobile/src/components/overview/OverviewStats.tsx index 4a386cc02..83c2dfccf 100644 --- a/apps/mobile/src/components/overview/OverviewStats.tsx +++ b/apps/mobile/src/components/overview/OverviewStats.tsx @@ -34,7 +34,9 @@ const OverviewStats = () => { const { data: libraryStatistics } = useLibraryQuery(['library.getStatistics']); - const displayableStatItems = Object.keys(StatItemNames) as unknown as keyof typeof StatItemNames; + const displayableStatItems = Object.keys( + StatItemNames + ) as unknown as keyof typeof StatItemNames; // For Demo purposes as we probably wanna save this to database // Sets Total Capacity and Free Space of the device @@ -59,7 +61,13 @@ const OverviewStats = () => { } else if (key === 'total_bytes_capacity') { bytes = BigInt(sizeInfo.totalSpace); } - return ; + return ( + + ); })} ) : ( diff --git a/apps/mobile/src/components/primitive/Button.tsx b/apps/mobile/src/components/primitive/Button.tsx index 2c16d204e..f7c2bdcc9 100644 --- a/apps/mobile/src/components/primitive/Button.tsx +++ b/apps/mobile/src/components/primitive/Button.tsx @@ -10,7 +10,7 @@ const button = cva(['items-center justify-center rounded-md border shadow-sm'], danger: ['border-red-800 bg-red-600'], gray: ['border-app-line bg-app-button'], darkGray: ['border-app-box bg-app'], - accent: ['border-accent-deep bg-accent shadow-app-shade/10 shadow-md'], + accent: ['border-accent-deep bg-accent shadow-md shadow-app-shade/10'], outline: ['border-sidebar-line/60 '] }, size: { diff --git a/apps/mobile/src/components/primitive/InfoPill.tsx b/apps/mobile/src/components/primitive/InfoPill.tsx index 7debddf9a..d41478f0d 100644 --- a/apps/mobile/src/components/primitive/InfoPill.tsx +++ b/apps/mobile/src/components/primitive/InfoPill.tsx @@ -12,11 +12,11 @@ export const InfoPill = (props: Props) => { return ( - + {props.text} @@ -27,11 +27,11 @@ export function PlaceholderPill(props: Props) { return ( - + {props.text} diff --git a/apps/mobile/src/components/primitive/Menu.tsx b/apps/mobile/src/components/primitive/Menu.tsx index db3273743..e74c5889b 100644 --- a/apps/mobile/src/components/primitive/Menu.tsx +++ b/apps/mobile/src/components/primitive/Menu.tsx @@ -20,7 +20,7 @@ export const Menu = (props: MenuProps) => ( {props.trigger} - + {props.children} @@ -44,7 +44,7 @@ export const MenuItem = ({ icon, ...props }: MenuItemProps) => { diff --git a/apps/mobile/src/components/settings/SettingsContainer.tsx b/apps/mobile/src/components/settings/SettingsContainer.tsx index 3a973586c..3eb81dbed 100644 --- a/apps/mobile/src/components/settings/SettingsContainer.tsx +++ b/apps/mobile/src/components/settings/SettingsContainer.tsx @@ -10,9 +10,11 @@ type SettingsContainerProps = PropsWithChildren<{ export function SettingsContainer({ children, title, description }: SettingsContainerProps) { return ( - {title && {title}} + {title && ( + {title} + )} {children} - {description && {description}} + {description && {description}} ); } diff --git a/apps/mobile/src/components/settings/SettingsItem.tsx b/apps/mobile/src/components/settings/SettingsItem.tsx index 277abd85b..0e6e8aa96 100644 --- a/apps/mobile/src/components/settings/SettingsItem.tsx +++ b/apps/mobile/src/components/settings/SettingsItem.tsx @@ -12,12 +12,17 @@ type SettingsItemProps = { export function SettingsItem(props: SettingsItemProps) { return ( - + - {props.leftIcon && props.leftIcon({ size: 20, color: tw.color('ink'), style: tw`mr-3` })} - {props.title} + {props.leftIcon && + props.leftIcon({ size: 20, color: tw.color('ink'), style: tw`mr-3` })} + {props.title} - {props.rightArea ? props.rightArea : } + {props.rightArea ? ( + props.rightArea + ) : ( + + )} ); @@ -26,7 +31,7 @@ export function SettingsItem(props: SettingsItemProps) { export function SettingsItemDivider() { return ( - + ); } diff --git a/apps/mobile/src/main.tsx b/apps/mobile/src/main.tsx index 2960aa316..9910ddb4e 100644 --- a/apps/mobile/src/main.tsx +++ b/apps/mobile/src/main.tsx @@ -40,9 +40,9 @@ globalThis.localStorage = { length: _localStorage.size }; -/* +/* https://github.com/facebook/hermes/issues/23 - + We are using "Hermes" on Android & IOS, which for the current version (0.11), IOS does not support the Intl fully so we need polyfill it. diff --git a/apps/mobile/src/navigation/index.tsx b/apps/mobile/src/navigation/index.tsx index ef8bc15d8..f9d7fb21e 100644 --- a/apps/mobile/src/navigation/index.tsx +++ b/apps/mobile/src/navigation/index.tsx @@ -13,7 +13,11 @@ const Stack = createStackNavigator(); export default function RootNavigator() { return ( - + - + {SharedScreens(Stack as any)} ); diff --git a/apps/mobile/src/screens/NotFound.tsx b/apps/mobile/src/screens/NotFound.tsx index 527009e20..c1014685d 100644 --- a/apps/mobile/src/screens/NotFound.tsx +++ b/apps/mobile/src/screens/NotFound.tsx @@ -15,7 +15,7 @@ export default function NotFoundScreen({ navigation }: RootStackScreenProps<'Not } style={tw`mt-4 py-4`} > - Go to home screen! + Go to home screen! ); diff --git a/apps/mobile/src/screens/Search.tsx b/apps/mobile/src/screens/Search.tsx index 9d9c92f13..04f7393ae 100644 --- a/apps/mobile/src/screens/Search.tsx +++ b/apps/mobile/src/screens/Search.tsx @@ -18,13 +18,17 @@ const SearchScreen = ({ navigation }: RootStackScreenProps<'Search'>) => { {/* Header */} {/* Search Input */} - + {loading ? ( ) : ( - + )} ) => { clearButtonMode="never" // can't change the color?? underlineColorAndroid="transparent" placeholderTextColor={tw.color('ink-dull')} - style={tw`text-ink flex-1 text-sm font-medium`} + style={tw`flex-1 text-sm font-medium text-ink`} textContentType={'none'} autoFocus autoCapitalize="none" diff --git a/apps/mobile/src/screens/Spacedrop.tsx b/apps/mobile/src/screens/Spacedrop.tsx index c55b14eec..2eb9cb97f 100644 --- a/apps/mobile/src/screens/Spacedrop.tsx +++ b/apps/mobile/src/screens/Spacedrop.tsx @@ -50,7 +50,10 @@ const Hexagon = () => { return ( - + ); }; @@ -100,7 +103,9 @@ function DropItem(props: DropItemProps) { style={tw`w-full items-center justify-center`} onPress={() => Alert.alert('TODO')} > - + {icon} {props.name && ( diff --git a/apps/mobile/src/screens/Spaces.tsx b/apps/mobile/src/screens/Spaces.tsx index a8ba83e10..c5c7efb70 100644 --- a/apps/mobile/src/screens/Spaces.tsx +++ b/apps/mobile/src/screens/Spaces.tsx @@ -5,7 +5,7 @@ import { SpacesStackScreenProps } from '~/navigation/tabs/SpacesStack'; export default function SpacesScreen({ navigation }: SpacesStackScreenProps<'Spaces'>) { return ( - Spaces + Spaces ); } diff --git a/apps/mobile/src/screens/onboarding/CreatingLibrary.tsx b/apps/mobile/src/screens/onboarding/CreatingLibrary.tsx index 9da341b35..c40bc6bfa 100644 --- a/apps/mobile/src/screens/onboarding/CreatingLibrary.tsx +++ b/apps/mobile/src/screens/onboarding/CreatingLibrary.tsx @@ -29,7 +29,10 @@ const CreatingLibraryScreen = ({ navigation }: OnboardingStackScreenProps<'Creat const createLibrary = useBridgeMutation('library.create', { onSuccess: (lib) => { resetOnboardingStore(); - queryClient.setQueryData(['library.list'], (libraries: any) => [...(libraries || []), lib]); + queryClient.setQueryData(['library.list'], (libraries: any) => [ + ...(libraries || []), + lib + ]); // Switch to the new library currentLibraryStore.id = lib.uuid; if (obStore.shareTelemetry) { diff --git a/apps/mobile/src/screens/onboarding/GetStarted.tsx b/apps/mobile/src/screens/onboarding/GetStarted.tsx index 023065ea3..de92b8054 100644 --- a/apps/mobile/src/screens/onboarding/GetStarted.tsx +++ b/apps/mobile/src/screens/onboarding/GetStarted.tsx @@ -32,7 +32,7 @@ export function OnboardingContainer({ children }: React.PropsWithChildren) { > {children} - + © 2022 Spacedrive Technology Inc. @@ -72,7 +72,7 @@ const GetStartedScreen = ({ navigation }: OnboardingStackScreenProps<'GetStarted {/* Get Started Button */} navigation.push('NewLibrary')}> - Get Started + Get Started diff --git a/apps/mobile/src/screens/onboarding/MasterPassword.tsx b/apps/mobile/src/screens/onboarding/MasterPassword.tsx index 084dad93a..60c28c526 100644 --- a/apps/mobile/src/screens/onboarding/MasterPassword.tsx +++ b/apps/mobile/src/screens/onboarding/MasterPassword.tsx @@ -120,7 +120,7 @@ const MasterPasswordScreen = ({ navigation }: OnboardingStackScreenProps<'Master disabled={form.formState.isSubmitting} onPress={handleSetPassword} > - + {!showPasswordValidate ? 'Set password' : 'Confirm Password'} @@ -136,7 +136,9 @@ const MasterPasswordScreen = ({ navigation }: OnboardingStackScreenProps<'Master form.reset(); }} > - Remove password + + Remove password + ) : ( )} diff --git a/apps/mobile/src/screens/onboarding/NewLibrary.tsx b/apps/mobile/src/screens/onboarding/NewLibrary.tsx index 570e30f04..19b81db73 100644 --- a/apps/mobile/src/screens/onboarding/NewLibrary.tsx +++ b/apps/mobile/src/screens/onboarding/NewLibrary.tsx @@ -38,8 +38,8 @@ const NewLibraryScreen = ({ navigation }: OnboardingStackScreenProps<'NewLibrary Create a Library - Libraries are a secure, on-device database. Your files remain where they are, the Library - catalogs them and stores all Spacedrive related data. + Libraries are a secure, on-device database. Your files remain where they are, + the Library catalogs them and stores all Spacedrive related data. - OR + OR diff --git a/apps/mobile/src/screens/onboarding/Privacy.tsx b/apps/mobile/src/screens/onboarding/Privacy.tsx index 972d781d5..4dcbcf57a 100644 --- a/apps/mobile/src/screens/onboarding/Privacy.tsx +++ b/apps/mobile/src/screens/onboarding/Privacy.tsx @@ -18,7 +18,7 @@ const RadioButton = ({ title, description, isSelected, style }: RadioButtonProps return ( @@ -31,8 +31,8 @@ const RadioButton = ({ title, description, isSelected, style }: RadioButtonProps {isSelected && } - {title} - {description} + {title} + {description} ); @@ -52,8 +52,8 @@ const PrivacyScreen = ({ navigation }: OnboardingStackScreenProps<'Privacy'>) => Your Privacy - Spacedrive is built for privacy, that's why we're open source and local first. So we'll make - it very clear what data is shared with us. + Spacedrive is built for privacy, that's why we're open source and local first. So + we'll make it very clear what data is shared with us. setShareTelemetry('share-telemetry')}> @@ -73,7 +73,7 @@ const PrivacyScreen = ({ navigation }: OnboardingStackScreenProps<'Privacy'>) => ); diff --git a/apps/mobile/src/screens/settings/Settings.tsx b/apps/mobile/src/screens/settings/Settings.tsx index 6fc0800de..5fde541d1 100644 --- a/apps/mobile/src/screens/settings/Settings.tsx +++ b/apps/mobile/src/screens/settings/Settings.tsx @@ -109,7 +109,7 @@ function renderSectionHeader({ section }: { section: { title: string } }) { return ( @@ -135,9 +135,9 @@ export default function SettingsScreen({ navigation }: SettingsStackScreenProps< renderSectionHeader={renderSectionHeader} ListFooterComponent={ - Spacedrive + Spacedrive {/* TODO: Get this automatically (expo-device have this?) */} - v0.1.0 + v0.1.0 } showsVerticalScrollIndicator={false} diff --git a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx index f62861c86..dd52f072e 100644 --- a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx +++ b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx @@ -17,15 +17,15 @@ const GeneralSettingsScreen = ({ navigation }: SettingsStackScreenProps<'General {/* Card Header */} - Connected Node + Connected Node {/* Peers */} - - 0 Peers + + 0 Peers {/* Status */} - - Running + + Running diff --git a/apps/mobile/src/screens/settings/client/LibrarySettings.tsx b/apps/mobile/src/screens/settings/client/LibrarySettings.tsx index 6b0236b61..124fde4e2 100644 --- a/apps/mobile/src/screens/settings/client/LibrarySettings.tsx +++ b/apps/mobile/src/screens/settings/client/LibrarySettings.tsx @@ -50,15 +50,15 @@ function LibraryItem({ - {library.config.name} - {library.uuid} + {library.config.name} + {library.uuid} diff --git a/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx b/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx index 9ecbb131f..cd8c3abf2 100644 --- a/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx +++ b/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx @@ -110,8 +110,8 @@ const EditLocationSettingsScreen = ({ )} /> - The name of this Location, this is what will be displayed in the sidebar. Will not rename - the actual folder on disk. + The name of this Location, this is what will be displayed in the sidebar. Will + not rename the actual folder on disk. Local Path diff --git a/apps/mobile/src/screens/settings/library/LocationSettings.tsx b/apps/mobile/src/screens/settings/library/LocationSettings.tsx index 80377ada6..ef59ab0cd 100644 --- a/apps/mobile/src/screens/settings/library/LocationSettings.tsx +++ b/apps/mobile/src/screens/settings/library/LocationSettings.tsx @@ -48,7 +48,7 @@ function LocationItem({ location, index, navigation }: LocationItemProps) { ]} > { navigation.navigate('EditLocationSettings', { id: location.id }); swipeable.close(); @@ -60,7 +60,7 @@ function LocationItem({ location, index, navigation }: LocationItemProps) { locationId={location.id} trigger={ @@ -68,7 +68,7 @@ function LocationItem({ location, index, navigation }: LocationItemProps) { /> {/* Full Re-scan IS too much here */} fullRescan.mutate(location.id)} > @@ -80,7 +80,7 @@ function LocationItem({ location, index, navigation }: LocationItemProps) { return ( - + {location.name} - - + + {location.node.name} - + {location.path} diff --git a/apps/mobile/src/screens/settings/library/TagsSettings.tsx b/apps/mobile/src/screens/settings/library/TagsSettings.tsx index c836cea57..2a42162da 100644 --- a/apps/mobile/src/screens/settings/library/TagsSettings.tsx +++ b/apps/mobile/src/screens/settings/library/TagsSettings.tsx @@ -28,7 +28,11 @@ function TagItem({ tag, index }: { tag: Tag; index: number }) { - swipeable.close()} /> + swipeable.close()} + /> updateTagModalRef.current?.present()}> @@ -47,7 +51,7 @@ function TagItem({ tag, index }: { tag: Tag; index: number }) { return ( - - {tag.name} + + {tag.name} diff --git a/apps/web/.eslintrc.js b/apps/web/.eslintrc.js new file mode 100644 index 000000000..a746deaf8 --- /dev/null +++ b/apps/web/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [require.resolve('@sd/config/eslint/web.js')], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + }, + ignorePatterns: ['playwright.config.ts', 'tests/**/*'] +}; diff --git a/crates/sync/example/web/src/App.tsx b/crates/sync/example/web/src/App.tsx index 623138d01..002ef76bc 100644 --- a/crates/sync/example/web/src/App.tsx +++ b/crates/sync/example/web/src/App.tsx @@ -16,13 +16,22 @@ export function App() {
- - -
@@ -143,9 +152,13 @@ function OperationList(props: { db: string }) { {message.id} - {new Date(Number(message.timestamp) / 10000000).toLocaleTimeString()} + {new Date( + Number(message.timestamp) / 10000000 + ).toLocaleTimeString()} + + + {messageType(message.typ)} - {messageType(message.typ)} ))} diff --git a/interface/app/$libraryId/Explorer/AssignTagMenuItems.tsx b/interface/app/$libraryId/Explorer/AssignTagMenuItems.tsx index 30bb56150..629900790 100644 --- a/interface/app/$libraryId/Explorer/AssignTagMenuItems.tsx +++ b/interface/app/$libraryId/Explorer/AssignTagMenuItems.tsx @@ -11,7 +11,9 @@ export default (props: { objectId: number }) => { const submitPlausibleEvent = usePlausibleEvent(); const tags = useLibraryQuery(['tags.list'], { suspense: true }); - const tagsForObject = useLibraryQuery(['tags.getForObject', props.objectId], { suspense: true }); + const tagsForObject = useLibraryQuery(['tags.getForObject', props.objectId], { + suspense: true + }); const assignTag = useLibraryMutation('tags.assign', { onSuccess: () => { @@ -42,7 +44,9 @@ export default (props: { objectId: number }) => { iconProps={{ size: 15 }} keybind="⌘N" onClick={() => { - dialogManager.create((dp) => ); + dialogManager.create((dp) => ( + + )); }} /> @@ -91,7 +95,8 @@ export default (props: { objectId: number }) => {
diff --git a/interface/app/$libraryId/Explorer/ContextMenu.tsx b/interface/app/$libraryId/Explorer/ContextMenu.tsx index 9b23d64bf..0c270aedd 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu.tsx @@ -116,14 +116,16 @@ export default (props: PropsWithChildren) => { - store.locationId && generateThumbsForLocation.mutate({ id: store.locationId, path: '' }) + store.locationId && + generateThumbsForLocation.mutate({ id: store.locationId, path: '' }) } label="Regen Thumbnails" icon={Image} /> - store.locationId && objectValidator.mutate({ id: store.locationId, path: '' }) + store.locationId && + objectValidator.mutate({ id: store.locationId, path: '' }) } label="Generate Checksums" icon={ShieldCheck} diff --git a/interface/app/$libraryId/Explorer/File/ContextMenu.tsx b/interface/app/$libraryId/Explorer/File/ContextMenu.tsx index 192290dff..37ea082de 100644 --- a/interface/app/$libraryId/Explorer/File/ContextMenu.tsx +++ b/interface/app/$libraryId/Explorer/File/ContextMenu.tsx @@ -161,7 +161,11 @@ export default ({ data, className, ...props }: Props) => { onClick={() => { if (keyManagerUnlocked && hasMountedKeys) { dialogManager.create((dp) => ( - + )); } else if (!keyManagerUnlocked) { showAlertDialog({ @@ -184,7 +188,11 @@ export default ({ data, className, ...props }: Props) => { onClick={() => { if (keyManagerUnlocked) { dialogManager.create((dp) => ( - + )); } else { showAlertDialog({ diff --git a/interface/app/$libraryId/Explorer/File/DecryptDialog.tsx b/interface/app/$libraryId/Explorer/File/DecryptDialog.tsx index d2272ba19..2bbdf7286 100644 --- a/interface/app/$libraryId/Explorer/File/DecryptDialog.tsx +++ b/interface/app/$libraryId/Explorer/File/DecryptDialog.tsx @@ -42,8 +42,7 @@ export default (props: Props) => { onSuccess: () => { showAlertDialog({ title: 'Success', - value: - 'The decryption job has started successfully. You may track the progress in the job overview panel.' + value: 'The decryption job has started successfully. You may track the progress in the job overview panel.' }); }, onError: () => { @@ -123,7 +122,9 @@ export default (props: Props) => { checked={form.watch('mountAssociatedKey')} onCheckedChange={(e) => form.setValue('mountAssociatedKey', e)} /> - Automatically mount key + + Automatically mount key + @@ -143,7 +144,9 @@ export default (props: Props) => { size="sm" {...form.register('saveToKeyManager')} /> - Save to Key Manager + + Save to Key Manager + diff --git a/interface/app/$libraryId/Explorer/File/EncryptDialog.tsx b/interface/app/$libraryId/Explorer/File/EncryptDialog.tsx index f5b06fe3e..56a9761aa 100644 --- a/interface/app/$libraryId/Explorer/File/EncryptDialog.tsx +++ b/interface/app/$libraryId/Explorer/File/EncryptDialog.tsx @@ -48,8 +48,7 @@ export default (props: Props) => { onSuccess: () => { showAlertDialog({ title: 'Success', - value: - 'The encryption job has started successfully. You may track the progress in the job overview panel.' + value: 'The encryption job has started successfully. You may track the progress in the job overview panel.' }); }, onError: () => { @@ -154,9 +153,15 @@ export default (props: Props) => { Argon2id (standard) Argon2id (hardened) Argon2id (paranoid) - BLAKE3-Balloon (standard) - BLAKE3-Balloon (hardened) - BLAKE3-Balloon (paranoid) + + BLAKE3-Balloon (standard) + + + BLAKE3-Balloon (hardened) + + + BLAKE3-Balloon (paranoid) +
diff --git a/interface/app/$libraryId/Explorer/GridView.tsx b/interface/app/$libraryId/Explorer/GridView.tsx index 234b4e3c0..ab27007a3 100644 --- a/interface/app/$libraryId/Explorer/GridView.tsx +++ b/interface/app/$libraryId/Explorer/GridView.tsx @@ -46,7 +46,10 @@ const GridViewItem = memo(({ data, selected, index, ...props }: GridViewItemProp { const index = explorerStore.selectedRowIndex; if ( explorerStore.showInspector && - ((lastSelectedIndex === -1 && index !== -1) || (lastSelectedIndex !== -1 && index === -1)) + ((lastSelectedIndex === -1 && index !== -1) || + (lastSelectedIndex !== -1 && index === -1)) ) { handleWindowResize(); } @@ -186,7 +190,12 @@ export default () => { if (!item) return null; return ( - + ); })}
diff --git a/interface/app/$libraryId/Explorer/Inspector/Note.tsx b/interface/app/$libraryId/Explorer/Inspector/Note.tsx index dce412ac6..034fc2aa3 100644 --- a/interface/app/$libraryId/Explorer/Inspector/Note.tsx +++ b/interface/app/$libraryId/Explorer/Inspector/Note.tsx @@ -26,7 +26,10 @@ export default function Note(props: Props) { ); // eslint-disable-next-line react-hooks/exhaustive-deps - const debouncedNote = useCallback((note: string) => debounce(note), [props.data.id, fileSetNote]); + const debouncedNote = useCallback( + (note: string) => debounce(note), + [props.data.id, fileSetNote] + ); // when input is updated, cache note function handleNoteUpdate(e: React.ChangeEvent) { diff --git a/interface/app/$libraryId/Explorer/Inspector/index.tsx b/interface/app/$libraryId/Explorer/Inspector/index.tsx index 6804782a8..f6e731fcc 100644 --- a/interface/app/$libraryId/Explorer/Inspector/index.tsx +++ b/interface/app/$libraryId/Explorer/Inspector/index.tsx @@ -120,10 +120,18 @@ export const Inspector = ({ data, context, onScroll, ...elementProps }: Props) =
- {isDir ? 'Folder' : ObjectKind[objectData?.kind || 0]} - {filePathData?.extension && {filePathData.extension}} + + {isDir ? 'Folder' : ObjectKind[objectData?.kind || 0]} + + {filePathData?.extension && ( + {filePathData.extension} + )} {tags?.data?.map((tag) => ( - + Size - {formatBytes(Number(filePathData?.size_in_bytes || 0))} + + {formatBytes(Number(filePathData?.size_in_bytes || 0))} + {fullObjectData.data?.media_data?.duration_seconds && ( Duration - {fullObjectData.data.media_data.duration_seconds} + + {fullObjectData.data.media_data.duration_seconds} + )} @@ -165,14 +177,18 @@ export const Inspector = ({ data, context, onScroll, ...elementProps }: Props) = Created - {dayjs(item?.date_created).format('MMM Do YYYY')} + + {dayjs(item?.date_created).format('MMM Do YYYY')} + Indexed - {dayjs(filePathData?.date_indexed).format('MMM Do YYYY')} + + {dayjs(filePathData?.date_indexed).format('MMM Do YYYY')} + @@ -193,8 +209,12 @@ export const Inspector = ({ data, context, onScroll, ...elementProps }: Props) = - Checksum - {filePathData?.integrity_checksum} + + Checksum + + + {filePathData?.integrity_checksum} + )} @@ -202,7 +222,9 @@ export const Inspector = ({ data, context, onScroll, ...elementProps }: Props) = - Object ID + + Object ID + {pub_id} diff --git a/interface/app/$libraryId/Explorer/ListView.tsx b/interface/app/$libraryId/Explorer/ListView.tsx index 30b1d9960..7b43a7b75 100644 --- a/interface/app/$libraryId/Explorer/ListView.tsx +++ b/interface/app/$libraryId/Explorer/ListView.tsx @@ -182,7 +182,12 @@ export default () => { const tableHeaderHeight = 34; const tableEnd = virtualRows[virtualRows.length - 1]?.end || 0; const padding = - scrollHeight - TOP_BAR_HEIGHT - tableHeaderHeight - paddingY - tableEnd - scrollBarWidth; + scrollHeight - + TOP_BAR_HEIGHT - + tableHeaderHeight - + paddingY - + tableEnd - + scrollBarWidth; return padding > 0 ? padding : paddingY; }, [virtualRows]); @@ -195,7 +200,14 @@ export default () => { return { ...sizing, ...(scrollWidth && nameWidth - ? { Name: nameWidth + scrollWidth - paddingX * 2 - scrollBarWidth - tableLength } + ? { + Name: + nameWidth + + scrollWidth - + paddingX * 2 - + scrollBarWidth - + tableLength + } : {}) }; }); @@ -233,7 +245,8 @@ export default () => { const index = explorerStore.selectedRowIndex; if ( explorerStore.showInspector && - ((lastSelectedIndex === -1 && index !== -1) || (lastSelectedIndex !== -1 && index === -1)) + ((lastSelectedIndex === -1 && index !== -1) || + (lastSelectedIndex !== -1 && index === -1)) ) { handleResize(); } @@ -258,7 +271,9 @@ export default () => { (e) => { e.preventDefault(); if (explorerStore.selectedRowIndex > 0) { - const currentIndex = rows.findIndex((row) => row.index === explorerStore.selectedRowIndex); + const currentIndex = rows.findIndex( + (row) => row.index === explorerStore.selectedRowIndex + ); const newIndex = rows[currentIndex - 1]?.index; if (newIndex !== undefined) getExplorerStore().selectedRowIndex = newIndex; } @@ -275,7 +290,9 @@ export default () => { explorerStore.selectedRowIndex !== -1 && explorerStore.selectedRowIndex !== (data.length ?? 1) - 1 ) { - const currentIndex = rows.findIndex((row) => row.index === explorerStore.selectedRowIndex); + const currentIndex = rows.findIndex( + (row) => row.index === explorerStore.selectedRowIndex + ); const newIndex = rows[currentIndex + 1]?.index; if (newIndex !== undefined) getExplorerStore().selectedRowIndex = newIndex; } @@ -293,7 +310,11 @@ export default () => { )} > {table.getHeaderGroups().map((headerGroup) => ( -
+
{headerGroup.headers.map((header, i) => { const size = header.column.getSize(); return ( @@ -313,7 +334,10 @@ export default () => { > {header.isPlaceholder ? null : (
- {flexRender(header.column.columnDef.header, header.getContext())} + {flexRender( + header.column.columnDef.header, + header.getContext() + )}
{{ @@ -322,7 +346,8 @@ export default () => { }[header.column.getIsSorted() as string] ?? null} {(i !== headerGroup.headers.length - 1 || - (i === headerGroup.headers.length - 1 && !locked)) && ( + (i === headerGroup.headers.length - 1 && + !locked)) && (
e.stopPropagation()} onMouseDown={(e) => { @@ -348,7 +373,11 @@ export default () => { const row = rows[virtualRow.index]!; const selected = explorerStore.selectedRowIndex === row.index; return ( -
+
diff --git a/interface/app/$libraryId/Explorer/SearchBar.tsx b/interface/app/$libraryId/Explorer/SearchBar.tsx index e518adbd6..e9639fccb 100644 --- a/interface/app/$libraryId/Explorer/SearchBar.tsx +++ b/interface/app/$libraryId/Explorer/SearchBar.tsx @@ -19,7 +19,10 @@ export default forwardRef((props, forwardedRef) => { if ((event.key === 'f' && event.metaKey) || event.ctrlKey) { event.preventDefault(); forwardedRef?.current?.focus(); - } else if (forwardedRef?.current === document.activeElement && event.key === 'Escape') { + } else if ( + forwardedRef?.current === document.activeElement && + event.key === 'Escape' + ) { forwardedRef.current?.blur(); setSearchValue(''); } @@ -39,7 +42,10 @@ export default forwardRef((props, forwardedRef) => { else if (forwardedRef) forwardedRef.current = el; }} placeholder="Search" - className={clsx('w-52 transition-all duration-200 focus-within:w-60', props.className)} + className={clsx( + 'w-52 transition-all duration-200 focus-within:w-60', + props.className + )} size="sm" onChange={(e) => setSearchValue(e.target.value)} onBlur={() => setSearchValue('')} @@ -51,11 +57,20 @@ export default forwardRef((props, forwardedRef) => { )} > {platform === 'browser' ? ( - + ) : os === 'macOS' ? ( - + ) : ( - + )}
} diff --git a/interface/app/$libraryId/Explorer/TopBar.tsx b/interface/app/$libraryId/Explorer/TopBar.tsx index 1b3858018..8abe560d1 100644 --- a/interface/app/$libraryId/Explorer/TopBar.tsx +++ b/interface/app/$libraryId/Explorer/TopBar.tsx @@ -45,7 +45,8 @@ export default () => { }, [topBarRef]); const topBarCondition = - (topBarWidth < 1000 && countToolOptions >= 8) || (topBarWidth < 600 && countToolOptions >= 6); + (topBarWidth < 1000 && countToolOptions >= 8) || + (topBarWidth < 600 && countToolOptions >= 6); return (
{ -
-
+
+
{toolBarRouteOptions[getPageName].options.map((group) => { return (Object.keys(group) as groupKeys[]).map((groupKey) => { return group[groupKey]?.map( ( - { icon, onClick, popOverComponent, toolTipLabel, topBarActive, individual }, + { + icon, + onClick, + popOverComponent, + toolTipLabel, + topBarActive, + individual + }, index ) => { const groupCount = Object.keys(group).length; @@ -108,7 +119,9 @@ export default () => { } > -
{popOverComponent}
+
+ {popOverComponent} +
) : ( ( ({ active, rounding, className, ...props }, ref) => { return ( -
@@ -96,13 +98,24 @@ export default (props: UseDialogProps) => {
Hashing - {}} + > Argon2id (standard) Argon2id (hardened) Argon2id (paranoid) - BLAKE3-Balloon (standard) - BLAKE3-Balloon (hardened) - BLAKE3-Balloon (paranoid) + + BLAKE3-Balloon (standard) + + + BLAKE3-Balloon (hardened) + + + BLAKE3-Balloon (paranoid) +
diff --git a/interface/app/$libraryId/settings/library/keys/MasterPasswordDialog.tsx b/interface/app/$libraryId/settings/library/keys/MasterPasswordDialog.tsx index c6159515b..75cea9c7d 100644 --- a/interface/app/$libraryId/settings/library/keys/MasterPasswordDialog.tsx +++ b/interface/app/$libraryId/settings/library/keys/MasterPasswordDialog.tsx @@ -110,14 +110,18 @@ export default (props: UseDialogProps) => {
diff --git a/interface/app/$libraryId/settings/library/keys/index.tsx b/interface/app/$libraryId/settings/library/keys/index.tsx index b55a67325..9c68bc8b8 100644 --- a/interface/app/$libraryId/settings/library/keys/index.tsx +++ b/interface/app/$libraryId/settings/library/keys/index.tsx @@ -130,7 +130,10 @@ export const Component = () => { if (masterPassword !== '') { setMasterPassword(''); setSecretKey(''); - unlockKeyManager.mutate({ password: masterPassword, secret_key: secretKey }); + unlockKeyManager.mutate({ + password: masterPassword, + secret_key: secretKey + }); } }} > @@ -188,7 +191,11 @@ export const Component = () => { {!viewSecretKey && (
-
@@ -215,7 +222,9 @@ export const Component = () => { size="sm" variant="gray" className="mr-2" - onClick={() => dialogManager.create((dp) => )} + onClick={() => + dialogManager.create((dp) => ) + } > Change Master Password @@ -257,7 +266,9 @@ export const Component = () => { size="sm" variant="gray" className="mr-2" - onClick={() => dialogManager.create((dp) => )} + onClick={() => + dialogManager.create((dp) => ) + } > Restore diff --git a/interface/app/$libraryId/settings/library/locations/$id.tsx b/interface/app/$libraryId/settings/library/locations/$id.tsx index fbf7add4d..c4f9b79cf 100644 --- a/interface/app/$libraryId/settings/library/locations/$id.tsx +++ b/interface/app/$libraryId/settings/library/locations/$id.tsx @@ -122,8 +122,8 @@ export const Component = () => { - The name of this Location, this is what will be displayed in the sidebar. Will not - rename the actual folder on disk. + The name of this Location, this is what will be displayed in the + sidebar. Will not rename the actual folder on disk. @@ -134,7 +134,8 @@ export const Component = () => { {...form.register('path')} /> - The path to this Location, this is where the files will be stored on disk. + The path to this Location, this is where the files will be stored on + disk.
@@ -145,7 +146,9 @@ export const Component = () => { - + @@ -174,7 +177,11 @@ export const Component = () => {
- @@ -194,12 +201,17 @@ export const Component = () => {
- Extract data from Library as an archive, useful to preserve Location folder structure. + Extract data from Library as an archive, useful to preserve Location + folder structure.
- diff --git a/interface/app/$libraryId/settings/library/locations/AddLocationButton.tsx b/interface/app/$libraryId/settings/library/locations/AddLocationButton.tsx index 2a4c520d7..983a5a0ed 100644 --- a/interface/app/$libraryId/settings/library/locations/AddLocationButton.tsx +++ b/interface/app/$libraryId/settings/library/locations/AddLocationButton.tsx @@ -16,7 +16,9 @@ export const AddLocationButton = ({ className, ...props }: ButtonProps) => { openDirectoryPickerDialog(platform) .then((path) => { if (path !== '') - dialogManager.create((dp) => ); + dialogManager.create((dp) => ( + + )); }) .catch((error) => showAlertDialog({ title: 'Error', value: String(error) })) } diff --git a/interface/app/$libraryId/settings/library/locations/AddLocationDialog.tsx b/interface/app/$libraryId/settings/library/locations/AddLocationDialog.tsx index fd8a80fa9..fdde0c0fc 100644 --- a/interface/app/$libraryId/settings/library/locations/AddLocationDialog.tsx +++ b/interface/app/$libraryId/settings/library/locations/AddLocationDialog.tsx @@ -85,7 +85,10 @@ export const AddLocationDialog = (props: Props) => { // }); break; case 'ADD_LIBRARY': - await addLocationToLibrary.mutateAsync({ path, indexer_rules_ids: indexerRulesIds }); + await addLocationToLibrary.mutateAsync({ + path, + indexer_rules_ids: indexerRulesIds + }); break; default: throw new Error('Unimplemented custom remote error handling'); diff --git a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor.tsx b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor.tsx index b056dab62..7ff2cf6b4 100644 --- a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor.tsx +++ b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor.tsx @@ -37,12 +37,17 @@ export function IndexerRuleEditor({ onClick={() => field.onChange( enabled - ? field.value.filter((fieldValue) => fieldValue !== rule.id) + ? field.value.filter( + (fieldValue) => fieldValue !== rule.id + ) : [...field.value, rule.id] ) } variant={enabled ? 'colored' : 'outline'} - className={clsx('m-1 flex-auto', enabled && 'border-accent bg-accent')} + className={clsx( + 'm-1 flex-auto', + enabled && 'border-accent bg-accent' + )} > {name} diff --git a/interface/app/$libraryId/settings/library/locations/ListItem.tsx b/interface/app/$libraryId/settings/library/locations/ListItem.tsx index a3685519e..20066d982 100644 --- a/interface/app/$libraryId/settings/library/locations/ListItem.tsx +++ b/interface/app/$libraryId/settings/library/locations/ListItem.tsx @@ -33,7 +33,9 @@ export default ({ location }: Props) => {

{location.name}

- {location.node.name} + + {location.node.name} + {location.path}

@@ -48,8 +50,15 @@ export default ({ location }: Props) => { variant="gray" className="pointer-events-none flex !py-1.5 !px-2" > -
- {online ? 'Online' : 'Offline'} +
+ + {online ? 'Online' : 'Offline'} +
{selectedTag ? ( - setSelectedTag(null)} /> + setSelectedTag(null)} + /> ) : (
No Tag Selected
)} diff --git a/interface/app/$libraryId/settings/node/libraries/CreateDialog.tsx b/interface/app/$libraryId/settings/node/libraries/CreateDialog.tsx index 369bc0ef3..c4aaca481 100644 --- a/interface/app/$libraryId/settings/node/libraries/CreateDialog.tsx +++ b/interface/app/$libraryId/settings/node/libraries/CreateDialog.tsx @@ -155,7 +155,10 @@ export default (props: UseDialogProps) => { > -
@@ -169,7 +172,10 @@ export default (props: UseDialogProps) => { type={showMasterPassword2 ? 'text' : 'password'} className="mt-2" right={ - } @@ -198,9 +204,15 @@ export default (props: UseDialogProps) => { Argon2id (standard) Argon2id (hardened) Argon2id (paranoid) - BLAKE3-Balloon (standard) - BLAKE3-Balloon (hardened) - BLAKE3-Balloon (paranoid) + + BLAKE3-Balloon (standard) + + + BLAKE3-Balloon (hardened) + + + BLAKE3-Balloon (paranoid) +
diff --git a/interface/app/$libraryId/settings/node/libraries/ListItem.tsx b/interface/app/$libraryId/settings/node/libraries/ListItem.tsx index aac83359c..15ec0cdd8 100644 --- a/interface/app/$libraryId/settings/node/libraries/ListItem.tsx +++ b/interface/app/$libraryId/settings/node/libraries/ListItem.tsx @@ -39,7 +39,9 @@ export default (props: Props) => ( className="!p-1.5" variant="gray" onClick={() => { - dialogManager.create((dp) => ); + dialogManager.create((dp) => ( + + )); }} > diff --git a/interface/app/$libraryId/settings/node/libraries/index.tsx b/interface/app/$libraryId/settings/node/libraries/index.tsx index 16b56dcdc..3aee483f3 100644 --- a/interface/app/$libraryId/settings/node/libraries/index.tsx +++ b/interface/app/$libraryId/settings/node/libraries/index.tsx @@ -37,7 +37,11 @@ export const Component = () => { return 0; }) .map((lib) => ( - + ))}
diff --git a/interface/app/$libraryId/settings/node/p2p.tsx b/interface/app/$libraryId/settings/node/p2p.tsx index 1590a97f5..32689591d 100644 --- a/interface/app/$libraryId/settings/node/p2p.tsx +++ b/interface/app/$libraryId/settings/node/p2p.tsx @@ -25,7 +25,9 @@ export const Component = () => { diff --git a/interface/app/$libraryId/settings/resources/about.tsx b/interface/app/$libraryId/settings/resources/about.tsx index 3d864eeca..2c8346569 100644 --- a/interface/app/$libraryId/settings/resources/about.tsx +++ b/interface/app/$libraryId/settings/resources/about.tsx @@ -18,7 +18,9 @@ export const Component = () => {

Spacedrive {os !== 'unknown' && <>for {currentPlatformNiceName}}

- The file manager from the future. + + The file manager from the future. + v{buildInfo.data?.version || '-.-.-'} - {buildInfo.data?.commit || 'dev'} diff --git a/interface/app/$libraryId/settings/resources/dependencies.tsx b/interface/app/$libraryId/settings/resources/dependencies.tsx index 61ce5221b..f05bfa703 100644 --- a/interface/app/$libraryId/settings/resources/dependencies.tsx +++ b/interface/app/$libraryId/settings/resources/dependencies.tsx @@ -3,7 +3,10 @@ import { ScreenHeading } from '@sd/ui'; import { usePlatform } from '~/util/Platform'; export const Component = () => { - const frontEnd = useQuery(['frontend-deps'], () => import('@sd/assets/deps/frontend-deps.json')); + const frontEnd = useQuery( + ['frontend-deps'], + () => import('@sd/assets/deps/frontend-deps.json') + ); const backEnd = useQuery(['backend-deps'], () => import('@sd/assets/deps/backend-deps.json')); const platform = usePlatform(); @@ -21,7 +24,8 @@ export const Component = () => { platform.openLink(item.url ?? '')}>

- {item.title.trimEnd().substring(0, 24) + (item.title.length > 24 ? '...' : '')} + {item.title.trimEnd().substring(0, 24) + + (item.title.length > 24 ? '...' : '')}

diff --git a/interface/app/$libraryId/spacedrop.tsx b/interface/app/$libraryId/spacedrop.tsx index c64c4fd66..12aedf702 100644 --- a/interface/app/$libraryId/spacedrop.tsx +++ b/interface/app/$libraryId/spacedrop.tsx @@ -41,7 +41,7 @@ function DropItem(props: DropItemProps) { } if (brandIconSrc) { icon = ( -
+
{props.name}
); @@ -54,13 +54,16 @@ function DropItem(props: DropItemProps) { return (
-
+
{/* */} -
{icon}
+
{icon}
@@ -119,10 +122,11 @@ function TemporarySpacedropDemo() {
Spacedrop Demo

- Note: Right now the file must be less than 255 bytes long and only contain UTF-8 chars. - Create a txt file in Vscode to test (note macOS TextEdit cause that is rtf by default) + Note: Right now the file must be less than 255 bytes long and only contain UTF-8 + chars. Create a txt file in Vscode to test (note macOS TextEdit cause that is rtf by + default)

-
+
- - form.setValue('target_peer', e)} + value={form.watch('target_peer')} + > {[...discoveredPeers.entries()].map(([peerId, metadata], index) => ( {metadata.name} @@ -145,7 +152,7 @@ function TemporarySpacedropDemo() {
-

© 2022 Spacedrive Technology Inc.

+

+ © 2022 Spacedrive Technology Inc. +

diff --git a/interface/app/onboarding/master-password.tsx b/interface/app/onboarding/master-password.tsx index dad389fdf..a16ffd79e 100644 --- a/interface/app/onboarding/master-password.tsx +++ b/interface/app/onboarding/master-password.tsx @@ -129,7 +129,12 @@ export default function OnboardingNewLibrary() { Remove password )} -
diff --git a/interface/app/onboarding/new-library.tsx b/interface/app/onboarding/new-library.tsx index 6dac1b8a1..ad9c069ba 100644 --- a/interface/app/onboarding/new-library.tsx +++ b/interface/app/onboarding/new-library.tsx @@ -46,8 +46,8 @@ export default function OnboardingNewLibrary() { Create a Library - Libraries are a secure, on-device database. Your files remain where they are, the Library - catalogs them and stores all Spacedrive related data. + Libraries are a secure, on-device database. Your files remain where they are, + the Library catalogs them and stores all Spacedrive related data. {importMode ? ( diff --git a/interface/app/onboarding/privacy.tsx b/interface/app/onboarding/privacy.tsx index 8b539550f..5520fe3b4 100644 --- a/interface/app/onboarding/privacy.tsx +++ b/interface/app/onboarding/privacy.tsx @@ -11,7 +11,8 @@ const shareTelemetry = RadioGroup.options([ ]).details({ 'share-telemetry': { heading: 'Share anonymous usage', - description: 'Share completely anonymous telemetry data to help the developers improve the app' + description: + 'Share completely anonymous telemetry data to help the developers improve the app' }, 'no-telemetry': { heading: 'Share nothing', @@ -46,8 +47,8 @@ export default function OnboardingPrivacy() { Your Privacy - Spacedrive is built for privacy, that's why we're open source and local first. So we'll - make it very clear what data is shared with us. + Spacedrive is built for privacy, that's why we're open source and local first. + So we'll make it very clear what data is shared with us.
diff --git a/interface/assets/spline/scene.json b/interface/assets/spline/scene.json index 424459998..0659b3ec2 100644 --- a/interface/assets/spline/scene.json +++ b/interface/assets/spline/scene.json @@ -11,7 +11,8 @@ "objectType": "LightDirectional", "name": "Directional Light", "matrix": [ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -491.00000000000006, 382, 292.47744883990526, 1 + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -491.00000000000006, 382, + 292.47744883990526, 1 ], "castShadow": true, "layers": 1, @@ -190,7 +191,8 @@ "objectType": "Mesh3D", "name": "Cube", "matrix": [ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -52.00000000000006, 52.749999999999986, 5.5, 1 + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -52.00000000000006, 52.749999999999986, 5.5, + 1 ], "castShadow": true, "receiveShadow": true, @@ -237,9 +239,10 @@ "objectType": "CombinedCamera", "name": "Default Camera", "matrix": [ - 0.9592203497819743, 1.3877787807814457e-17, 0.28265937197295754, 0, -0.1403466409943231, - 0.8680240479778703, 0.47627415686106955, 0, -0.24535513225884917, -0.49652215673835953, - 0.832626330920498, 0, -245.35513225884878, -496.52215673835894, 832.6263309204967, 1 + 0.9592203497819743, 1.3877787807814457e-17, 0.28265937197295754, 0, + -0.1403466409943231, 0.8680240479778703, 0.47627415686106955, 0, + -0.24535513225884917, -0.49652215673835953, 0.832626330920498, 0, + -245.35513225884878, -496.52215673835894, 832.6263309204967, 1 ], "layers": 1, "userData": { "activeCamera": true }, @@ -387,8 +390,8 @@ "userData": { "shape": { "points": [ - -165, 165, -165, 165, -165, 165, 20, 165, 165, 165, 165, 165, 165, 20, 165, -165, 165, - -165, 165, -165, 20, -165, -165, -165, -165, -165, -165, 20 + -165, 165, -165, 165, -165, 165, 20, 165, 165, 165, 165, 165, 165, 20, 165, + -165, 165, -165, 165, -165, 20, -165, -165, -165, -165, -165, -165, 20 ], "shapeHoles": [], "isClosed": true, diff --git a/interface/assets/spline/windows.json b/interface/assets/spline/windows.json index 424459998..0659b3ec2 100644 --- a/interface/assets/spline/windows.json +++ b/interface/assets/spline/windows.json @@ -11,7 +11,8 @@ "objectType": "LightDirectional", "name": "Directional Light", "matrix": [ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -491.00000000000006, 382, 292.47744883990526, 1 + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -491.00000000000006, 382, + 292.47744883990526, 1 ], "castShadow": true, "layers": 1, @@ -190,7 +191,8 @@ "objectType": "Mesh3D", "name": "Cube", "matrix": [ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -52.00000000000006, 52.749999999999986, 5.5, 1 + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -52.00000000000006, 52.749999999999986, 5.5, + 1 ], "castShadow": true, "receiveShadow": true, @@ -237,9 +239,10 @@ "objectType": "CombinedCamera", "name": "Default Camera", "matrix": [ - 0.9592203497819743, 1.3877787807814457e-17, 0.28265937197295754, 0, -0.1403466409943231, - 0.8680240479778703, 0.47627415686106955, 0, -0.24535513225884917, -0.49652215673835953, - 0.832626330920498, 0, -245.35513225884878, -496.52215673835894, 832.6263309204967, 1 + 0.9592203497819743, 1.3877787807814457e-17, 0.28265937197295754, 0, + -0.1403466409943231, 0.8680240479778703, 0.47627415686106955, 0, + -0.24535513225884917, -0.49652215673835953, 0.832626330920498, 0, + -245.35513225884878, -496.52215673835894, 832.6263309204967, 1 ], "layers": 1, "userData": { "activeCamera": true }, @@ -387,8 +390,8 @@ "userData": { "shape": { "points": [ - -165, 165, -165, 165, -165, 165, 20, 165, 165, 165, 165, 165, 165, 20, 165, -165, 165, - -165, 165, -165, 20, -165, -165, -165, -165, -165, -165, 20 + -165, 165, -165, 165, -165, 165, 20, 165, 165, 165, 165, 165, 165, 20, 165, + -165, 165, -165, 165, -165, 20, -165, -165, -165, -165, -165, -165, 20 ], "shapeHoles": [], "isClosed": true, diff --git a/interface/components/TrafficLights.tsx b/interface/components/TrafficLights.tsx index 0799bed35..7519ac20f 100644 --- a/interface/components/TrafficLights.tsx +++ b/interface/components/TrafficLights.tsx @@ -16,7 +16,10 @@ export function MacTrafficLights(props: TrafficLightsProps) { const [focused] = useFocusState(); return ( -
+
diff --git a/interface/hooks/useToolBarOptions.tsx b/interface/hooks/useToolBarOptions.tsx index 8b7c3e8b3..aaad4c0e3 100644 --- a/interface/hooks/useToolBarOptions.tsx +++ b/interface/hooks/useToolBarOptions.tsx @@ -93,7 +93,8 @@ export const useToolBarRouteOptions = () => { className={TOP_BAR_ICON_STYLE} /> ), - onClick: () => (getExplorerStore().tagAssignMode = !store.tagAssignMode), + onClick: () => + (getExplorerStore().tagAssignMode = !store.tagAssignMode), topBarActive: store.tagAssignMode, individual: true }, @@ -112,7 +113,8 @@ export const useToolBarRouteOptions = () => { }, { toolTipLabel: 'Show Inspector', - onClick: () => (getExplorerStore().showInspector = !store.showInspector), + onClick: () => + (getExplorerStore().showInspector = !store.showInspector), icon: ( { - className:? string - } -} \ No newline at end of file + interface ColumnMeta { + className?: string; + } +} diff --git a/package.json b/package.json index 7509dc90f..c1889dc6d 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "@cspell/dict-typescript": "^2.0.2", "@trivago/prettier-plugin-sort-imports": "^4.1.1", "cspell": "^6.12.0", - "markdown-link-check": "^3.10.3", "prettier": "^2.8.7", "prettier-plugin-tailwindcss": "^0.2.6", "rimraf": "^4.3", @@ -52,5 +51,6 @@ "npm": "pnpm", "yarn": "pnpm", "node": ">=18.0.0" - } + }, + "eslintConfig": {} } diff --git a/packages/client/package.json b/packages/client/package.json index dc255f288..90f106529 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -8,7 +8,7 @@ ], "scripts": { "test": "jest", - "lint": "eslint src", + "lint": "eslint src --cache", "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", "typecheck": "tsc -b", "build": "tsc" diff --git a/packages/client/src/normi/utils.ts b/packages/client/src/normi/utils.ts index a37126d36..6f3497edb 100644 --- a/packages/client/src/normi/utils.ts +++ b/packages/client/src/normi/utils.ts @@ -36,7 +36,10 @@ export function normaliseValue(value: any, normiCache: NormiCache): any { return value; } else if (typeof value === 'object') { if ('$id' in value && '$type' in value) { - getOrCreate(normiCache, value.$type).set(value.$id, normaliseValueForStorage(value, true)); + getOrCreate(normiCache, value.$type).set( + value.$id, + normaliseValueForStorage(value, true) + ); delete value.$id; delete value.$type; } else if ('$type' in value && 'edges' in value) { diff --git a/packages/client/src/rspc.ts b/packages/client/src/rspc.ts index 1b98287a1..8a336aabf 100644 --- a/packages/client/src/rspc.ts +++ b/packages/client/src/rspc.ts @@ -62,7 +62,10 @@ const libraryHooks = hooks.createHooks< const libraryId = currentLibraryCache.id; if (libraryId === null) throw new Error('Attempted to do library operation with no library set!'); - return next([keyAndInput[0], { library_id: libraryId, arg: keyAndInput[1] ?? null }]); + return next([ + keyAndInput[0], + { library_id: libraryId, arg: keyAndInput[1] ?? null } + ]); } }; }) diff --git a/packages/config/.eslintrc.js b/packages/config/.eslintrc.js new file mode 100644 index 000000000..a2e730a90 --- /dev/null +++ b/packages/config/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('./eslint/base.js')] +}; diff --git a/packages/config/eslint/base.js b/packages/config/eslint/base.js index d82d3192a..a5dec2ae6 100644 --- a/packages/config/eslint/base.js +++ b/packages/config/eslint/base.js @@ -1,4 +1,6 @@ +const path = require('node:path'); module.exports = { + root: true, parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { @@ -12,10 +14,11 @@ module.exports = { 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:@typescript-eslint/recommended', - 'prettier', - 'turbo' + 'turbo', + 'plugin:editorconfig/all', + 'plugin:prettier/recommended' ], - plugins: ['react'], + plugins: ['react', 'editorconfig'], rules: { 'react/display-name': 'off', 'react/prop-types': 'off', @@ -32,7 +35,14 @@ module.exports = { '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-empty-function': 'off', 'no-control-regex': 'off', - 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'] + 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'], + 'editorconfig/indent': 'off', + 'turbo/no-undeclared-env-vars': [ + 'error', + { + cwd: path.resolve(path.join(__dirname, '..', '..', '..')) + } + ] }, ignorePatterns: ['dist', '**/*.js', '**/*.json', 'node_modules'], settings: { diff --git a/packages/config/eslint/reactNative.js b/packages/config/eslint/reactNative.js index a2e9ce599..84e8c8f22 100644 --- a/packages/config/eslint/reactNative.js +++ b/packages/config/eslint/reactNative.js @@ -1,5 +1,5 @@ module.exports = { - extends: [require.resolve('./base.js'), 'plugin:tailwindcss/recommended'], + extends: [require.resolve('./tailwind.js')], env: { 'react-native/react-native': true }, @@ -23,14 +23,6 @@ module.exports = { ] } ], - 'tailwindcss/no-custom-classname': 'off', 'tailwindcss/no-contradicting-classname': 'warn' - }, - settings: { - tailwindcss: { - config: './apps/mobile/tailwind.config.js', - callees: ['classnames', 'clsx', 'ctl', 'cva', 'tw', `twStyle`], - tags: ['tw', 'twStyle'] - } } }; diff --git a/packages/config/eslint/tailwind.js b/packages/config/eslint/tailwind.js new file mode 100644 index 000000000..210f7e37e --- /dev/null +++ b/packages/config/eslint/tailwind.js @@ -0,0 +1,21 @@ +const path = require('node:path'); +module.exports = { + extends: [require.resolve('./base.js'), 'plugin:tailwindcss/recommended'], + rules: { + 'tailwindcss/no-custom-classname': 'off', + 'tailwindcss/classnames-order': [ + 'warn', + { + config: path.resolve( + path.join(__dirname, '../../..', 'packages/ui/tailwind.config.js') + ) + } + ] + }, + settings: { + tailwindcss: { + callees: ['classnames', 'clsx', 'ctl', 'cva', 'tw', 'twStyle'], + tags: ['tw', 'twStyle'] + } + } +}; diff --git a/packages/config/eslint/web.js b/packages/config/eslint/web.js index ef780ffc1..57d85a553 100644 --- a/packages/config/eslint/web.js +++ b/packages/config/eslint/web.js @@ -1,5 +1,5 @@ module.exports = { - extends: [require.resolve('./base.js')], + extends: [require.resolve('./tailwind.js')], ignorePatterns: ['public', 'vite.config.ts'], env: { browser: true, diff --git a/packages/config/package.json b/packages/config/package.json index d22847ceb..f4d984f77 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -6,18 +6,23 @@ "./*": "./*", "./vite": "./vite" }, + "scripts": { + "lint": "eslint . --cache" + }, "files": [ "eslint-react.js" ], "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.57.0", - "@typescript-eslint/parser": "^5.57.0", - "eslint": "^8.37.0", + "@typescript-eslint/eslint-plugin": "^5.58.0", + "@typescript-eslint/parser": "^5.58.0", + "eslint": "^8.38.0", "eslint-config-prettier": "^8.8.0", - "eslint-config-turbo": "^1.8.8", + "eslint-config-turbo": "^1.9.1", + "eslint-plugin-editorconfig": "^4.0.2", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-tailwindcss": "^3.10.3", + "eslint-plugin-tailwindcss": "^3.11.0", "vite-plugin-html": "^3.2.0", "vite-plugin-svgr": "^2.2.1" } diff --git a/packages/config/vite/relativeAliasResolver.ts b/packages/config/vite/relativeAliasResolver.ts index f07d3d8cf..8ec85e96e 100644 --- a/packages/config/vite/relativeAliasResolver.ts +++ b/packages/config/vite/relativeAliasResolver.ts @@ -2,7 +2,7 @@ import fs from 'fs/promises'; import path from 'path'; import { Alias } from 'vite'; -let pkgJsonCache = new Map(); +const pkgJsonCache = new Map(); const resolver: Alias = { find: /^(~\/.+)/, diff --git a/packages/ui/package.json b/packages/ui/package.json index ea7700fdf..47c740940 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -14,7 +14,7 @@ "./package.json": "./package.json" }, "scripts": { - "lint": "eslint src", + "lint": "eslint src --cache", "typecheck": "tsc -b", "build": "tsc" }, diff --git a/packages/ui/src/Button.tsx b/packages/ui/src/Button.tsx index e87344403..73b4c6064 100644 --- a/packages/ui/src/Button.tsx +++ b/packages/ui/src/Button.tsx @@ -25,7 +25,7 @@ const styles = cva( [ 'cursor-default items-center rounded-md border outline-none transition-colors duration-100', 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-70', - 'ring-offset-app-box focus:ring-accent focus:ring-2 focus:ring-offset-2' + 'ring-offset-app-box focus:ring-2 focus:ring-accent focus:ring-offset-2' ], { variants: { @@ -37,24 +37,24 @@ const styles = cva( }, variant: { default: [ - 'active:bg-app-selected hover:bg-app-hover bg-transparent', - 'hover:border-app-line active:border-app-line border-transparent' + 'bg-transparent hover:bg-app-hover active:bg-app-selected', + 'border-transparent hover:border-app-line active:border-app-line' ], subtle: [ - 'hover:border-app-line/50 active:border-app-line active:bg-app-box/30 border-transparent' + 'border-transparent hover:border-app-line/50 active:border-app-line active:bg-app-box/30' ], outline: [ - 'border-sidebar-line/60 hover:border-sidebar-line active:border-sidebar-line active:border-sidebar-line/30' + 'border-sidebar-line/60 hover:border-sidebar-line active:border-sidebar-line/30' ], dotted: [ `rounded border border-dashed border-sidebar-line/70 text-center text-xs font-medium text-ink-faint transition hover:border-sidebar-line hover:bg-sidebar-selected/5` ], gray: [ - 'bg-app-button active:bg-app-selected hover:bg-app-hover', + 'bg-app-button hover:bg-app-hover active:bg-app-selected', 'border-app-line hover:border-app-line active:border-app-active' ], accent: [ - 'bg-accent active:bg-accent hover:bg-accent-faint border-accent-deep hover:border-accent active:border-accent-deep shadow-app-shade/10 text-white shadow-md' + 'border-accent-deep bg-accent text-white shadow-md shadow-app-shade/10 hover:border-accent hover:bg-accent-faint active:border-accent-deep active:bg-accent' ], colored: ['text-white shadow-sm hover:bg-opacity-90 active:bg-opacity-100'], bare: '' diff --git a/packages/ui/src/ContextMenu.tsx b/packages/ui/src/ContextMenu.tsx index a5af2294a..9eda3b3e8 100644 --- a/packages/ui/src/ContextMenu.tsx +++ b/packages/ui/src/ContextMenu.tsx @@ -11,8 +11,8 @@ interface ContextMenuProps extends RadixCM.MenuContentProps { export const contextMenuClassNames = clsx( 'z-50 max-h-[calc(100vh-20px)] overflow-y-auto', 'my-2 min-w-[12rem] max-w-[16rem] py-0.5', - 'bg-menu cool-shadow', - 'border-menu-line border', + 'cool-shadow bg-menu', + 'border border-menu-line', 'cursor-default select-none rounded-md', 'animate-in fade-in' ); @@ -65,9 +65,9 @@ const SubMenu = ({ const contextMenuItemStyles = cva( [ 'flex h-[26px] items-center space-x-2 overflow-hidden rounded px-2', - 'text-ink text-sm', + 'text-sm text-ink', 'group-radix-highlighted:text-white dark:group-radix-highlighted:text-ink', - 'group-radix-disabled:text-ink/50 group-radix-disabled:pointer-events-none', + 'group-radix-disabled:pointer-events-none group-radix-disabled:text-ink/50', 'group-radix-state-open:bg-accent group-radix-state-open:text-white dark:group-radix-state-open:text-ink' ], { @@ -109,7 +109,9 @@ const Item = ({ }: ContextMenuItemProps & RadixCM.MenuItemProps) => { return ( - + ); }; diff --git a/packages/ui/src/Dialog.tsx b/packages/ui/src/Dialog.tsx index aa3f08fc1..9fddb5f6e 100644 --- a/packages/ui/src/Dialog.tsx +++ b/packages/ui/src/Dialog.tsx @@ -141,7 +141,9 @@ export function Dialog({ return ( - {props.trigger && {props.trigger}} + {props.trigger && ( + {props.trigger} + )} {transitions((styles, show) => show ? ( @@ -181,16 +183,24 @@ export function Dialog({ {form.formState.isSubmitting && }
- diff --git a/packages/ui/src/Dropdown.tsx b/packages/ui/src/Dropdown.tsx index f1cefc9d3..16b219146 100644 --- a/packages/ui/src/Dropdown.tsx +++ b/packages/ui/src/Dropdown.tsx @@ -14,7 +14,7 @@ const itemStyles = cva( { variants: { selected: { - true: 'bg-accent hover:!bg-accent text-white', + true: 'bg-accent text-white hover:!bg-accent', undefined: 'hover:bg-menu-hover', false: 'hover:bg-menu-hover' }, @@ -63,7 +63,12 @@ export const Item = ({ to, className, icon: Icon, children, ...props }: Dropdown export const Button = forwardRef( ({ children, className, ...props }, ref) => { return ( - + {children} - + diff --git a/packages/ui/src/Input.tsx b/packages/ui/src/Input.tsx index 15ff2925a..fb4b8762c 100644 --- a/packages/ui/src/Input.tsx +++ b/packages/ui/src/Input.tsx @@ -23,8 +23,8 @@ export const inputStyles = cva( variants: { variant: { default: [ - 'bg-app-input focus-within:bg-app-focus placeholder-ink-faint border-app-line', - 'focus-within:ring-app-selected/30 focus-within:border-app-divider/80' + 'border-app-line bg-app-input placeholder-ink-faint focus-within:bg-app-focus', + 'focus-within:border-app-divider/80 focus-within:ring-app-selected/30' ] }, error: { @@ -106,7 +106,11 @@ export const TextArea = ({ size, variant, error, ...props }: TextareaProps) => { return (