diff --git a/.circleci/src/jobs/@common-jobs.yml b/.circleci/src/jobs/@common-jobs.yml index 88c8478862b..b51ca4e30e1 100644 --- a/.circleci/src/jobs/@common-jobs.yml +++ b/.circleci/src/jobs/@common-jobs.yml @@ -23,7 +23,6 @@ common-init: paths: - node_modules - packages/common/node_modules - - packages/common/dist common-test: working_directory: ~/audius-protocol diff --git a/.circleci/src/jobs/@mobile-jobs.yml b/.circleci/src/jobs/@mobile-jobs.yml index 63b9483a9fc..9447456c1c0 100644 --- a/.circleci/src/jobs/@mobile-jobs.yml +++ b/.circleci/src/jobs/@mobile-jobs.yml @@ -36,7 +36,6 @@ mobile-init: - packages/stems/node_modules - packages/stems/dist - packages/common/node_modules - - packages/common/dist - packages/libs/node_modules - packages/libs/dist - packages/mobile/.env.stage diff --git a/.circleci/src/jobs/@web-jobs.yml b/.circleci/src/jobs/@web-jobs.yml index 372a1b706d6..4d4ba15b64d 100644 --- a/.circleci/src/jobs/@web-jobs.yml +++ b/.circleci/src/jobs/@web-jobs.yml @@ -35,7 +35,6 @@ web-init: - packages/harmony/node_modules - packages/harmony/dist - packages/common/node_modules - - packages/common/dist - packages/libs/node_modules - packages/libs/dist diff --git a/package-lock.json b/package-lock.json index e4f192e34ea..5fa18956527 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16805,21 +16805,6 @@ "rollup": "^2.38.3" } }, - "node_modules/@rollup/plugin-image": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "mini-svg-data-uri": "^1.2.3" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0 || ^2.0.0" - } - }, "node_modules/@rollup/plugin-inject": { "version": "4.0.4", "dev": true, @@ -43347,6 +43332,150 @@ "npm": ">=6" } }, + "node_modules/babel-plugin-module-resolver": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.0.tgz", + "integrity": "sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==", + "dev": true, + "dependencies": { + "find-babel-config": "^2.0.0", + "glob": "^8.0.3", + "pkg-up": "^3.1.0", + "reselect": "^4.1.7", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">= 16" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/pkg-up": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-module-resolver/node_modules/reselect": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz", + "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==", + "dev": true + }, "node_modules/babel-plugin-named-asset-import": { "version": "0.2.3", "dev": true, @@ -56907,6 +57036,19 @@ "version": "2.0.0", "license": "MIT" }, + "node_modules/find-babel-config": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.0.0.tgz", + "integrity": "sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==", + "dev": true, + "dependencies": { + "json5": "^2.1.1", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/find-cache-dir": { "version": "2.1.0", "license": "MIT", @@ -72212,14 +72354,6 @@ "version": "1.2.0", "license": "MIT" }, - "node_modules/mini-svg-data-uri": { - "version": "1.4.4", - "dev": true, - "license": "MIT", - "bin": { - "mini-svg-data-uri": "cli.js" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "license": "ISC" @@ -93881,20 +94015,6 @@ "node": ">=8.0" } }, - "node_modules/rollup": { - "version": "2.76.0", - "dev": true, - "license": "MIT", - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/rollup-plugin-babel": { "version": "4.4.0", "dev": true, @@ -93990,38 +94110,6 @@ "node": ">=8" } }, - "node_modules/rollup-plugin-dts": { - "version": "4.2.2", - "dev": true, - "license": "LGPL-3.0", - "dependencies": { - "magic-string": "^0.26.1" - }, - "engines": { - "node": ">=v12.22.11" - }, - "funding": { - "url": "https://github.com/sponsors/Swatinem" - }, - "optionalDependencies": { - "@babel/code-frame": "^7.16.7" - }, - "peerDependencies": { - "rollup": "^2.55", - "typescript": "^4.1" - } - }, - "node_modules/rollup-plugin-dts/node_modules/magic-string": { - "version": "0.26.7", - "dev": true, - "license": "MIT", - "dependencies": { - "sourcemap-codec": "^1.4.8" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/rollup-plugin-ignore": { "version": "1.0.10", "dev": true, @@ -94792,112 +94880,6 @@ "node": ">=10" } }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.32.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "find-cache-dir": "^3.3.2", - "fs-extra": "^10.0.0", - "resolve": "^1.20.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/find-cache-dir": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/fs-extra": { - "version": "10.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/jsonfile": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/make-dir": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/pkg-dir": { - "version": "4.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/tslib": { - "version": "2.6.2", - "dev": true, - "license": "0BSD" - }, - "node_modules/rollup-plugin-typescript2/node_modules/universalify": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/rollup-plugin-url": { "version": "2.2.4", "dev": true, @@ -94981,18 +94963,6 @@ "dev": true, "license": "MIT" }, - "node_modules/rollup/node_modules/fsevents": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/rotating-file-stream": { "version": "2.1.6", "dev": true, @@ -112487,7 +112457,6 @@ }, "devDependencies": { "@reduxjs/toolkit": "1.6.1", - "@rollup/plugin-image": "^2.1.1", "@stripe/crypto": "0.0.4", "@types/bn.js": "5.1.0", "@types/jest": "29.5.7", @@ -112499,9 +112468,6 @@ "eslint": "8.56.0", "jest": "29.7.0", "react": "18.2.0", - "rollup": "2.76.0", - "rollup-plugin-dts": "4.2.2", - "rollup-plugin-typescript2": "0.32.1", "ts-patch": "3.1.1", "typescript-transform-paths": "3.4.4" }, @@ -131901,6 +131867,7 @@ "@emotion/styled": "11.11.0", "@radix-ui/react-slot": "1.0.2", "@react-spring/web": "9.7.2", + "@rollup/plugin-alias": "5.0.1", "@storybook/addon-a11y": "7.4.0", "@storybook/addon-actions": "7.4.2", "@storybook/addon-essentials": "7.4.2", @@ -132022,6 +131989,26 @@ "node": ">=10.10.0" } }, + "packages/harmony/node_modules/@rollup/plugin-alias": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.0.1.tgz", + "integrity": "sha512-JObvbWdOHoMy9W7SU0lvGhDtWq9PllP5mjpAy+TUslZG/WzOId9u80Hsqq1vCUn9pFJ0cxpdcnAv+QzU2zFH3Q==", + "dev": true, + "dependencies": { + "slash": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "packages/harmony/node_modules/@rollup/pluginutils": { "version": "4.2.1", "dev": true, @@ -132945,6 +132932,18 @@ "node": ">=8" } }, + "packages/harmony/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/harmony/node_modules/source-map": { "version": "0.6.1", "dev": true, @@ -137999,6 +137998,7 @@ }, "devDependencies": { "@babel/core": "7.21.0", + "@babel/plugin-transform-export-namespace-from": "7.23.4", "@babel/plugin-transform-react-jsx": "7.21.0", "@babel/preset-env": "7.20.2", "@babel/runtime": "7.21.0", @@ -138026,6 +138026,7 @@ "babel-jest": "29.6.3", "babel-loader": "8.3.0", "babel-plugin-macros": "3.1.0", + "babel-plugin-module-resolver": "5.0.0", "babel-plugin-transform-remove-console": "6.9.4", "detox": "20.12.1", "eslint": "8.56.0", @@ -138127,6 +138128,22 @@ "@babel/core": "^7.0.0-0" } }, + "packages/mobile/node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz", + "integrity": "sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "packages/mobile/node_modules/@babel/preset-env": { "version": "7.20.2", "dev": true, @@ -146941,7 +146958,6 @@ "vite": "4.5.0", "vite-plugin-glslify": "2.0.2", "vite-plugin-svgr": "4.1.0", - "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.6" } }, diff --git a/packages/common/jest.config.ts b/packages/common/jest.config.ts index 348ede88a08..9fbda1eab7e 100644 --- a/packages/common/jest.config.ts +++ b/packages/common/jest.config.ts @@ -1,3 +1,6 @@ export default { - moduleDirectories: ['node_modules', 'src'] + moduleDirectories: ['node_modules', 'src'], + moduleNameMapper: { + '^~/(.*)$': '/src/$1' + } } diff --git a/packages/common/package.json b/packages/common/package.json index 0140a10de5d..a39afca4728 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -6,22 +6,26 @@ "author": "Audius", "homepage": "https://github.com/AudiusProject/audius-client#readme", "license": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "module": "dist/index.js", - "exports": "./dist/index.js", - "files": [ - "src" - ], + "exports": { + "./api": "./src/api/index.ts", + "./assets": "./src/assets/index.ts", + "./audius-query": "./src/audius-query/index.ts", + "./context": "./src/context/index.ts", + "./hooks": "./src/hooks/index.ts", + "./messages": "./src/messages/index.ts", + "./models": "./src/models/index.ts", + "./schemas": "./src/schemas/index.ts", + "./services": "./src/services/index.ts", + "./store": "./src/store/index.ts", + "./utils": "./src/utils/index.ts" + }, "repository": { "type": "git", "url": "git+https://github.com/AudiusProject/audius-client.git" }, "scripts": { - "build": "rollup -c", "lint": "eslint --cache src", "lint:fix": "npm run lint -- --fix", - "start": "rollup -c -w", "test": "jest", "typecheck": "tsc --noEmit", "verify": "concurrently \"npm:lint:fix\"" @@ -64,7 +68,6 @@ }, "devDependencies": { "@reduxjs/toolkit": "1.6.1", - "@rollup/plugin-image": "^2.1.1", "@types/bn.js": "5.1.0", "@types/jest": "29.5.7", "@types/lodash": "4.14.149", @@ -75,9 +78,6 @@ "eslint": "8.56.0", "jest": "29.7.0", "react": "18.2.0", - "rollup": "2.76.0", - "rollup-plugin-dts": "4.2.2", - "rollup-plugin-typescript2": "0.32.1", "@stripe/crypto": "0.0.4", "ts-patch": "3.1.1", "typescript-transform-paths": "3.4.4" diff --git a/packages/common/rollup.config.js b/packages/common/rollup.config.js deleted file mode 100644 index 667e7dee11c..00000000000 --- a/packages/common/rollup.config.js +++ /dev/null @@ -1,40 +0,0 @@ -import { createRequire } from 'node:module' - -import image from '@rollup/plugin-image' -import rollupTypescript from 'rollup-plugin-typescript2' - -import pkg from './package.json' - -const cjsRequire = createRequire(import.meta.url) -const tspCompiler = cjsRequire('ts-patch/compiler') - -export default [ - { - input: 'src/index.ts', - output: [ - { - dir: 'dist', - format: 'es', - exports: 'named', - sourcemap: true - } - ], - plugins: [ - rollupTypescript({ - typescript: tspCompiler - }), - image() - ], - - external: [ - ...Object.keys(pkg.dependencies), - ...Object.keys(pkg.devDependencies), - ...Object.keys(pkg.peerDependencies), - 'redux-saga/effects', - 'events', - '@audius/sdk/dist/core', - 'dayjs/plugin/timezone', - 'dayjs/plugin/utc' - ] - } -] diff --git a/packages/common/src/api/account.ts b/packages/common/src/api/account.ts index 98282d6f9ac..7cb5e092795 100644 --- a/packages/common/src/api/account.ts +++ b/packages/common/src/api/account.ts @@ -1,4 +1,4 @@ -import { createApi } from 'audius-query' +import { createApi } from '~/audius-query' type ResetPasswordArgs = { email: string diff --git a/packages/common/src/api/collection.ts b/packages/common/src/api/collection.ts index d59b9d8a34b..07e549d4184 100644 --- a/packages/common/src/api/collection.ts +++ b/packages/common/src/api/collection.ts @@ -1,6 +1,6 @@ -import { createApi } from 'audius-query' -import { ID, Kind } from 'models' -import { Nullable } from 'utils' +import { createApi } from '~/audius-query' +import { ID, Kind } from '~/models' +import { Nullable } from '~/utils' const collectionApi = createApi({ reducerPath: 'collectionApi', diff --git a/packages/common/src/api/developerApps.ts b/packages/common/src/api/developerApps.ts index ec62ff9e7cc..c62877b68c7 100644 --- a/packages/common/src/api/developerApps.ts +++ b/packages/common/src/api/developerApps.ts @@ -1,8 +1,8 @@ import { z } from 'zod' -import { createApi } from 'audius-query' -import { ID } from 'models/Identifiers' -import { encodeHashId } from 'utils/hashIds' +import { createApi } from '~/audius-query' +import { ID } from '~/models/Identifiers' +import { encodeHashId } from '~/utils/hashIds' export const DEVELOPER_APP_DESCRIPTION_MAX_LENGTH = 128 export const DEVELOPER_APP_NAME_MAX_LENGTH = 50 diff --git a/packages/common/src/api/favorites.ts b/packages/common/src/api/favorites.ts index 64a1ec7ceaa..ca200d20eb1 100644 --- a/packages/common/src/api/favorites.ts +++ b/packages/common/src/api/favorites.ts @@ -1,6 +1,6 @@ -import { createApi } from 'audius-query' -import { ID } from 'models/Identifiers' -import { Nullable } from 'utils/typeUtils' +import { createApi } from '~/audius-query' +import { ID } from '~/models/Identifiers' +import { Nullable } from '~/utils/typeUtils' type GetFavoritedTrackListArgs = { currentUserId: Nullable diff --git a/packages/common/src/api/library.ts b/packages/common/src/api/library.ts index d6fc097add3..a4d21953136 100644 --- a/packages/common/src/api/library.ts +++ b/packages/common/src/api/library.ts @@ -1,12 +1,12 @@ import type { full } from '@audius/sdk' -import { AudiusQueryContextType, createApi } from 'audius-query' -import { UserCollectionMetadata } from 'models/Collection' -import { Kind } from 'models/Kind' -import { makeActivity } from 'services/audius-api-client/ResponseAdapter' -import { APIActivityV2 } from 'services/audius-api-client/types' -import { encodeHashId } from 'utils/hashIds' -import { removeNullable } from 'utils/typeUtils' +import { AudiusQueryContextType, createApi } from '~/audius-query' +import { UserCollectionMetadata } from '~/models/Collection' +import { Kind } from '~/models/Kind' +import { makeActivity } from '~/services/audius-api-client/ResponseAdapter' +import { APIActivityV2 } from '~/services/audius-api-client/types' +import { encodeHashId } from '~/utils/hashIds' +import { removeNullable } from '~/utils/typeUtils' type GetLibraryItemsArgs = { userId: number diff --git a/packages/common/src/api/purchases.ts b/packages/common/src/api/purchases.ts index b00cbb371cf..269cb847e1a 100644 --- a/packages/common/src/api/purchases.ts +++ b/packages/common/src/api/purchases.ts @@ -1,13 +1,13 @@ import type { full } from '@audius/sdk' -import { createApi } from 'audius-query' -import { ID } from 'models' +import { createApi } from '~/audius-query' +import { ID } from '~/models' import { USDCContentPurchaseType, USDCPurchaseDetails -} from 'models/USDCTransactions' -import { StringUSDC } from 'models/Wallet' -import { Nullable } from 'utils/typeUtils' +} from '~/models/USDCTransactions' +import { StringUSDC } from '~/models/Wallet' +import { Nullable } from '~/utils/typeUtils' import { trackApiFetch } from './track' import { HashId, Id } from './utils' diff --git a/packages/common/src/api/relatedArtists.ts b/packages/common/src/api/relatedArtists.ts index 653216de4bb..1ebe6ced52a 100644 --- a/packages/common/src/api/relatedArtists.ts +++ b/packages/common/src/api/relatedArtists.ts @@ -1,5 +1,5 @@ -import { createApi } from 'audius-query' -import { ID } from 'models/Identifiers' +import { createApi } from '~/audius-query' +import { ID } from '~/models/Identifiers' const relatedArtistsApi = createApi({ reducerPath: 'relatedArtistsApi', diff --git a/packages/common/src/api/signUp.ts b/packages/common/src/api/signUp.ts index cce4af1b6cc..96cad12d792 100644 --- a/packages/common/src/api/signUp.ts +++ b/packages/common/src/api/signUp.ts @@ -1,10 +1,10 @@ import { isEmpty } from 'lodash' -import { createApi } from 'audius-query' -import { FeatureFlags } from 'services/remote-config/feature-flags' -import { IntKeys } from 'services/remote-config/types' -import { parseHandleReservedStatusFromSocial } from 'utils/handleReservedStatus' -import { promiseWithTimeout } from 'utils/promiseWithTimeout' +import { createApi } from '~/audius-query' +import { FeatureFlags } from '~/services/remote-config/feature-flags' +import { IntKeys } from '~/services/remote-config/types' +import { parseHandleReservedStatusFromSocial } from '~/utils/handleReservedStatus' +import { promiseWithTimeout } from '~/utils/promiseWithTimeout' import { userApiFetch } from './user' diff --git a/packages/common/src/api/suggestedTracks.ts b/packages/common/src/api/suggestedTracks.ts index 882baec838a..39b26310c5c 100644 --- a/packages/common/src/api/suggestedTracks.ts +++ b/packages/common/src/api/suggestedTracks.ts @@ -3,17 +3,17 @@ import { useCallback, useEffect, useState } from 'react' import { difference, isEqual, shuffle } from 'lodash' import { useSelector, useDispatch } from 'react-redux' -import { usePaginatedQuery } from 'audius-query' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' -import { TimeRange } from 'models/TimeRange' -import { Track, UserTrackMetadata } from 'models/Track' -import { getUserId } from 'store/account/selectors' -import { addTrackToPlaylist } from 'store/cache/collections/actions' -import { getCollection } from 'store/cache/collections/selectors' -import { getTrack } from 'store/cache/tracks/selectors' -import { CommonState } from 'store/index' -import { removeNullable } from 'utils/typeUtils' +import { usePaginatedQuery } from '~/audius-query' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' +import { TimeRange } from '~/models/TimeRange' +import { Track, UserTrackMetadata } from '~/models/Track' +import { getUserId } from '~/store/account/selectors' +import { addTrackToPlaylist } from '~/store/cache/collections/actions' +import { getCollection } from '~/store/cache/collections/selectors' +import { getTrack } from '~/store/cache/tracks/selectors' +import { CommonState } from '~/store/index' +import { removeNullable } from '~/utils/typeUtils' import { useGetFavoritedTrackList } from './favorites' import { useGetTracksByIds } from './track' diff --git a/packages/common/src/api/topArtists.ts b/packages/common/src/api/topArtists.ts index 085559759e4..5631838c219 100644 --- a/packages/common/src/api/topArtists.ts +++ b/packages/common/src/api/topArtists.ts @@ -1,8 +1,8 @@ import { uniq } from 'lodash' -import { createApi } from 'audius-query' -import { ID } from 'models/Identifiers' -import { Kind } from 'models/Kind' +import { createApi } from '~/audius-query' +import { ID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' import { userApiFetch } from './user' diff --git a/packages/common/src/api/track.ts b/packages/common/src/api/track.ts index aa8d19e6b0e..200fbacd721 100644 --- a/packages/common/src/api/track.ts +++ b/packages/common/src/api/track.ts @@ -1,7 +1,7 @@ -import { createApi } from 'audius-query' -import { ID, Kind } from 'models' -import { parseTrackRouteFromPermalink } from 'utils/stringUtils' -import { Nullable } from 'utils/typeUtils' +import { createApi } from '~/audius-query' +import { ID, Kind } from '~/models' +import { parseTrackRouteFromPermalink } from '~/utils/stringUtils' +import { Nullable } from '~/utils/typeUtils' const trackApi = createApi({ reducerPath: 'trackApi', diff --git a/packages/common/src/api/trending.ts b/packages/common/src/api/trending.ts index 47567953099..b859e1c0b13 100644 --- a/packages/common/src/api/trending.ts +++ b/packages/common/src/api/trending.ts @@ -1,9 +1,9 @@ -import { createApi } from 'audius-query' -import { ID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { TimeRange } from 'models/TimeRange' -import { Genre } from 'utils/genres' -import { Nullable } from 'utils/typeUtils' +import { createApi } from '~/audius-query' +import { ID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { TimeRange } from '~/models/TimeRange' +import { Genre } from '~/utils/genres' +import { Nullable } from '~/utils/typeUtils' type GetTrendingArgs = { timeRange: TimeRange diff --git a/packages/common/src/api/user.ts b/packages/common/src/api/user.ts index f50a611af51..eb915cbee0f 100644 --- a/packages/common/src/api/user.ts +++ b/packages/common/src/api/user.ts @@ -1,14 +1,14 @@ import { full } from '@audius/sdk' -import { createApi } from 'audius-query' -import { ID, Kind, StringUSDC } from 'models' +import { createApi } from '~/audius-query' +import { ID, Kind, StringUSDC } from '~/models' import { USDCTransactionDetails, USDCTransactionMethod, USDCTransactionType -} from 'models/USDCTransactions' -import { getRootSolanaAccount } from 'services/audius-backend/solana' -import { Nullable } from 'utils/typeUtils' +} from '~/models/USDCTransactions' +import { getRootSolanaAccount } from '~/services/audius-backend/solana' +import { Nullable } from '~/utils/typeUtils' import { Id } from './utils' diff --git a/packages/common/src/api/utils.ts b/packages/common/src/api/utils.ts index b828533dcd1..035b0081c04 100644 --- a/packages/common/src/api/utils.ts +++ b/packages/common/src/api/utils.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { decodeHashId, encodeHashId } from 'utils/hashIds' +import { decodeHashId, encodeHashId } from '~/utils/hashIds' export const HashId = z.string().transform((data: string, context) => { const id = decodeHashId(data) diff --git a/packages/common/src/audius-query/AudiusQueryContext.ts b/packages/common/src/audius-query/AudiusQueryContext.ts index 16fa0335e6f..619d316c79b 100644 --- a/packages/common/src/audius-query/AudiusQueryContext.ts +++ b/packages/common/src/audius-query/AudiusQueryContext.ts @@ -3,8 +3,8 @@ import { createContext, useContext } from 'react' import type { AudiusSdk } from '@audius/sdk' import type { Dispatch } from 'redux' -import type { AudiusAPIClient } from 'services/audius-api-client' -import { AudiusBackend, Env, RemoteConfigInstance } from 'services/index' +import type { AudiusAPIClient } from '~/services/audius-api-client' +import { AudiusBackend, Env, RemoteConfigInstance } from '~/services/index' import { ReportToSentryArgs } from '../models' diff --git a/packages/common/src/audius-query/createApi.ts b/packages/common/src/audius-query/createApi.ts index 5d5a4f7fd8c..fae4d068168 100644 --- a/packages/common/src/audius-query/createApi.ts +++ b/packages/common/src/audius-query/createApi.ts @@ -9,20 +9,25 @@ import { denormalize, normalize } from 'normalizr' import { useDispatch, useSelector } from 'react-redux' import { Dispatch } from 'redux' -import { useBooleanOnce } from 'hooks/useBooleanOnce' -import { CollectionMetadata, UserCollectionMetadata } from 'models/Collection' -import { ErrorLevel } from 'models/ErrorReporting' -import { Kind } from 'models/Kind' -import { Status, statusIsNotFinalized } from 'models/Status' -import { UserMetadata } from 'models/User' -import { getCollection } from 'store/cache/collections/selectors' -import { reformatCollection } from 'store/cache/collections/utils/reformatCollection' -import { getTrack } from 'store/cache/tracks/selectors' -import { reformatUser } from 'store/cache/users/utils' -import { CommonState } from 'store/reducers' -import { getErrorMessage } from 'utils/error' -import { Nullable, removeNullable } from 'utils/typeUtils' - +import { useBooleanOnce } from '~/hooks/useBooleanOnce' +import { + Collection, + CollectionMetadata, + UserCollectionMetadata +} from '~/models/Collection' +import { ErrorLevel } from '~/models/ErrorReporting' +import { Kind } from '~/models/Kind' +import { Status, statusIsNotFinalized } from '~/models/Status' +import { User, UserMetadata } from '~/models/User' +import { getCollection } from '~/store/cache/collections/selectors' +import { reformatCollection } from '~/store/cache/collections/utils/reformatCollection' +import { getTrack } from '~/store/cache/tracks/selectors' +import { reformatUser } from '~/store/cache/users/utils' +import { CommonState } from '~/store/reducers' +import { getErrorMessage } from '~/utils/error' +import { Nullable, removeNullable } from '~/utils/typeUtils' + +import { Track } from '../models/Track' import * as cacheActions from '../store/cache/actions' import * as cacheSelectors from '../store/cache/selectors' @@ -50,6 +55,8 @@ import { } from './types' import { capitalize, getKeyFromFetchArgs, selectCommonEntityMap } from './utils' +type Entity = Collection | Track | User + const { addEntries } = cacheActions const defaultRetryConfig: RetryConfig = { @@ -203,7 +210,7 @@ const useQueryState = ( const { kind, idArgKey, idListArgKey, permalinkArgKey, schemaKey } = endpoint.options - let cachedData = null + let cachedData: Nullable = null if (idArgKey && fetchArgs[idArgKey]) { const idAsNumber = typeof fetchArgs[idArgKey] === 'number' diff --git a/packages/common/src/audius-query/hooks/usePaginatedQuery.ts b/packages/common/src/audius-query/hooks/usePaginatedQuery.ts index 39cd7f39ad6..4be49170a68 100644 --- a/packages/common/src/audius-query/hooks/usePaginatedQuery.ts +++ b/packages/common/src/audius-query/hooks/usePaginatedQuery.ts @@ -3,7 +3,7 @@ import { useCallback, useState } from 'react' import { isEqual } from 'lodash' import { useCustomCompareEffect } from 'react-use' -import { Status } from 'models/Status' +import { Status } from '~/models/Status' import { QueryHookOptions, QueryHookResults } from '../types' diff --git a/packages/common/src/audius-query/schema.ts b/packages/common/src/audius-query/schema.ts index 660a7784eaf..767000cd8e9 100644 --- a/packages/common/src/audius-query/schema.ts +++ b/packages/common/src/audius-query/schema.ts @@ -1,6 +1,6 @@ import { schema } from 'normalizr' -import { Kind } from 'models/Kind' +import { Kind } from '~/models/Kind' export type SchemaKey = 'user' | 'users' | 'track' | 'tracks' diff --git a/packages/common/src/audius-query/types.ts b/packages/common/src/audius-query/types.ts index caaa4b47ccf..80aeda7bfb0 100644 --- a/packages/common/src/audius-query/types.ts +++ b/packages/common/src/audius-query/types.ts @@ -11,7 +11,7 @@ import { import AsyncRetry from 'async-retry' import { Dispatch } from 'redux' -import { Kind, Status } from 'models' +import { Kind, Status } from '~/models' import { AudiusQueryContextType } from './AudiusQueryContext' diff --git a/packages/common/src/audius-query/utils.ts b/packages/common/src/audius-query/utils.ts index a7d233368d2..ee0d1710950 100644 --- a/packages/common/src/audius-query/utils.ts +++ b/packages/common/src/audius-query/utils.ts @@ -1,7 +1,7 @@ import { mapValues } from 'lodash' -import { Kind } from 'models/Kind' -import { CommonState } from 'store/reducers' +import { Kind } from '~/models/Kind' +import { CommonState } from '~/store/reducers' import * as cacheSelectors from '../store/cache/selectors' diff --git a/packages/common/src/context/appContext.ts b/packages/common/src/context/appContext.ts index 366f5f14f28..baecb9ab834 100644 --- a/packages/common/src/context/appContext.ts +++ b/packages/common/src/context/appContext.ts @@ -2,10 +2,10 @@ import { createContext, useContext } from 'react' import type { StorageNodeSelectorService } from '@audius/sdk' -import { AnalyticsEvent, AllTrackingEvents } from 'models/Analytics' -import { AudiusBackend } from 'services/audius-backend' -import { LocalStorage } from 'services/local-storage' -import { RemoteConfigInstance } from 'services/remote-config' +import { AnalyticsEvent, AllTrackingEvents } from '~/models/Analytics' +import { AudiusBackend } from '~/services/audius-backend' +import { LocalStorage } from '~/services/local-storage' +import { RemoteConfigInstance } from '~/services/remote-config' type AppContextType = { analytics: { diff --git a/packages/common/src/hooks/chats/types.ts b/packages/common/src/hooks/chats/types.ts index 1f7a9975dde..d543f58251a 100644 --- a/packages/common/src/hooks/chats/types.ts +++ b/packages/common/src/hooks/chats/types.ts @@ -1,3 +1,3 @@ -import { Name } from 'models' +import { Name } from '~/models' export type TrackPlayback = Name.PLAYBACK_PLAY | Name.PLAYBACK_PAUSE diff --git a/packages/common/src/hooks/chats/useCanSendMessage.ts b/packages/common/src/hooks/chats/useCanSendMessage.ts index 6229d4f4fc5..28f19f653ef 100644 --- a/packages/common/src/hooks/chats/useCanSendMessage.ts +++ b/packages/common/src/hooks/chats/useCanSendMessage.ts @@ -1,12 +1,12 @@ import { useSelector } from 'react-redux' -import { useProxySelector } from 'hooks/useProxySelector' -import { User } from 'models/User' -import { ChatPermissionAction, CommonState } from 'store/index' +import { useProxySelector } from '~/hooks/useProxySelector' +import { User } from '~/models/User' +import { ChatPermissionAction, CommonState } from '~/store/index' import { getCanSendMessage, getOtherChatUsers -} from 'store/pages/chat/selectors' +} from '~/store/pages/chat/selectors' /** * Returns whether or not the current user can send messages to the current chat diff --git a/packages/common/src/hooks/chats/useSetInboxPermissions.ts b/packages/common/src/hooks/chats/useSetInboxPermissions.ts index c95019fc0f3..a16413612ae 100644 --- a/packages/common/src/hooks/chats/useSetInboxPermissions.ts +++ b/packages/common/src/hooks/chats/useSetInboxPermissions.ts @@ -4,11 +4,11 @@ import type { AudiusSdk } from '@audius/sdk' import { ChatPermission } from '@audius/sdk' import { useDispatch, useSelector } from 'react-redux' -import { Name } from 'models/Analytics' -import { Status } from 'models/Status' -import { useAppContext } from 'src/context/appContext' -import { accountSelectors } from 'store/account' -import { chatActions, chatSelectors } from 'store/pages' +import { useAppContext } from '~/context/appContext' +import { Name } from '~/models/Analytics' +import { Status } from '~/models/Status' +import { accountSelectors } from '~/store/account' +import { chatActions, chatSelectors } from '~/store/pages' const { fetchPermissions } = chatActions const { getUserChatPermissions } = chatSelectors diff --git a/packages/common/src/hooks/chats/useTrackPlayer.ts b/packages/common/src/hooks/chats/useTrackPlayer.ts index a3c13f71e39..8e852df93cb 100644 --- a/packages/common/src/hooks/chats/useTrackPlayer.ts +++ b/packages/common/src/hooks/chats/useTrackPlayer.ts @@ -2,11 +2,11 @@ import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { ID, Name } from 'models' -import { getPlaying, getUid } from 'store/player/selectors' -import { QueueSource, Queueable, queueActions } from 'store/queue' -import { makeGetCurrent } from 'store/queue/selectors' -import { Nullable } from 'utils' +import { ID, Name } from '~/models' +import { getPlaying, getUid } from '~/store/player/selectors' +import { QueueSource, Queueable, queueActions } from '~/store/queue' +import { makeGetCurrent } from '~/store/queue/selectors' +import { Nullable } from '~/utils' import { TrackPlayback } from './types' diff --git a/packages/common/src/hooks/helpers.ts b/packages/common/src/hooks/helpers.ts index 1e04c3c5036..39050fbd022 100644 --- a/packages/common/src/hooks/helpers.ts +++ b/packages/common/src/hooks/helpers.ts @@ -1,7 +1,7 @@ import { useSelector } from 'react-redux' -import { getAccountUser } from 'store/account/selectors' -import { isRemoteConfigLoaded } from 'store/remote-config/selectors' +import { getAccountUser } from '~/store/account/selectors' +import { isRemoteConfigLoaded } from '~/store/remote-config/selectors' export const useHasAccount = () => !!useSelector(getAccountUser) export const useHasConfigLoaded = () => !!useSelector(isRemoteConfigLoaded) diff --git a/packages/common/src/hooks/purchaseContent/types.ts b/packages/common/src/hooks/purchaseContent/types.ts index d5651271073..48d2fc5ea2f 100644 --- a/packages/common/src/hooks/purchaseContent/types.ts +++ b/packages/common/src/hooks/purchaseContent/types.ts @@ -1,4 +1,4 @@ -import { USDCPurchaseConditions, UserTrackMetadata } from 'models/Track' +import { USDCPurchaseConditions, UserTrackMetadata } from '~/models/Track' /** Denotes the 3 preset amounts to show on the form, values are in cents. */ export type PayExtraAmountPresetValues = { diff --git a/packages/common/src/hooks/purchaseContent/useChallengeCooldownSchedule.ts b/packages/common/src/hooks/purchaseContent/useChallengeCooldownSchedule.ts index a9cae2e343f..0a3c77aa32e 100644 --- a/packages/common/src/hooks/purchaseContent/useChallengeCooldownSchedule.ts +++ b/packages/common/src/hooks/purchaseContent/useChallengeCooldownSchedule.ts @@ -1,13 +1,13 @@ import { useSelector } from 'react-redux' -import { ChallengeRewardID } from 'models/AudioRewards' +import { ChallengeRewardID } from '~/models/AudioRewards' import { UndisbursedUserChallenge, audioRewardsPageSelectors -} from 'store/pages' -import { isCooldownChallengeClaimable } from 'utils/challenges' -import dayjs, { Dayjs } from 'utils/dayjs' -import { utcToLocalTime } from 'utils/timeUtil' +} from '~/store/pages' +import { isCooldownChallengeClaimable } from '~/utils/challenges' +import dayjs, { Dayjs } from '~/utils/dayjs' +import { utcToLocalTime } from '~/utils/timeUtil' const { getUndisbursedUserChallenges } = audioRewardsPageSelectors diff --git a/packages/common/src/hooks/purchaseContent/usePayExtraPresets.ts b/packages/common/src/hooks/purchaseContent/usePayExtraPresets.ts index 3dc6e518086..bbaa70d86a3 100644 --- a/packages/common/src/hooks/purchaseContent/usePayExtraPresets.ts +++ b/packages/common/src/hooks/purchaseContent/usePayExtraPresets.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { StringKeys } from 'services/remote-config' -import { parseIntList } from 'utils/stringUtils' +import { StringKeys } from '~/services/remote-config' +import { parseIntList } from '~/utils/stringUtils' import { useRemoteVar } from '../useRemoteVar' diff --git a/packages/common/src/hooks/purchaseContent/usePurchaseContentErrorMessage.ts b/packages/common/src/hooks/purchaseContent/usePurchaseContentErrorMessage.ts index 3f726cd54d4..af5176e0a8c 100644 --- a/packages/common/src/hooks/purchaseContent/usePurchaseContentErrorMessage.ts +++ b/packages/common/src/hooks/purchaseContent/usePurchaseContentErrorMessage.ts @@ -1,10 +1,10 @@ -import { BuyCryptoErrorCode } from 'store/buy-crypto/types' -import { BuyUSDCErrorCode } from 'store/index' +import { BuyCryptoErrorCode } from '~/store/buy-crypto/types' +import { BuyUSDCErrorCode } from '~/store/index' import { PurchaseContentErrorCode, PurchaseErrorCode -} from 'store/purchase-content' -import { formatPrice } from 'utils/formatUtil' +} from '~/store/purchase-content' +import { formatPrice } from '~/utils/formatUtil' import { useUSDCPurchaseConfig } from './useUSDCPurchaseConfig' diff --git a/packages/common/src/hooks/purchaseContent/usePurchaseContentFormConfiguration.ts b/packages/common/src/hooks/purchaseContent/usePurchaseContentFormConfiguration.ts index a36a9d2d97d..6dcca2c6de7 100644 --- a/packages/common/src/hooks/purchaseContent/usePurchaseContentFormConfiguration.ts +++ b/packages/common/src/hooks/purchaseContent/usePurchaseContentFormConfiguration.ts @@ -4,16 +4,16 @@ import { USDC } from '@audius/fixed-decimal' import BN from 'bn.js' import { useDispatch, useSelector } from 'react-redux' -import { PurchaseMethod, PurchaseVendor } from 'models/PurchaseContent' -import { UserTrackMetadata } from 'models/Track' +import { PurchaseMethod, PurchaseVendor } from '~/models/PurchaseContent' +import { UserTrackMetadata } from '~/models/Track' import { ContentType, PurchaseContentPage, isContentPurchaseInProgress, purchaseContentActions, purchaseContentSelectors -} from 'store/purchase-content' -import { Nullable } from 'utils/typeUtils' +} from '~/store/purchase-content' +import { Nullable } from '~/utils/typeUtils' import { useUSDCBalance } from '../useUSDCBalance' diff --git a/packages/common/src/hooks/purchaseContent/useUSDCPurchaseConfig.ts b/packages/common/src/hooks/purchaseContent/useUSDCPurchaseConfig.ts index 1c30cb871b2..a81b3f0ef01 100644 --- a/packages/common/src/hooks/purchaseContent/useUSDCPurchaseConfig.ts +++ b/packages/common/src/hooks/purchaseContent/useUSDCPurchaseConfig.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { IntKeys } from 'services/remote-config' +import { IntKeys } from '~/services/remote-config' import { useRemoteVar } from '../useRemoteVar' diff --git a/packages/common/src/hooks/purchaseContent/utils.ts b/packages/common/src/hooks/purchaseContent/utils.ts index c14a9ff8598..a1aa9113562 100644 --- a/packages/common/src/hooks/purchaseContent/utils.ts +++ b/packages/common/src/hooks/purchaseContent/utils.ts @@ -1,4 +1,4 @@ -import { UserTrackMetadata, isContentUSDCPurchaseGated } from 'models/Track' +import { UserTrackMetadata, isContentUSDCPurchaseGated } from '~/models/Track' import { PayExtraAmountPresetValues, diff --git a/packages/common/src/hooks/purchaseContent/validation.ts b/packages/common/src/hooks/purchaseContent/validation.ts index c7e2ed4df95..5590687ce9a 100644 --- a/packages/common/src/hooks/purchaseContent/validation.ts +++ b/packages/common/src/hooks/purchaseContent/validation.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { PurchaseMethod, PurchaseVendor } from 'models/PurchaseContent' +import { PurchaseMethod, PurchaseVendor } from '~/models/PurchaseContent' import { AMOUNT_PRESET, diff --git a/packages/common/src/hooks/useAccessAndRemixSettings.ts b/packages/common/src/hooks/useAccessAndRemixSettings.ts index b85971d7f57..4ae3ccd9a56 100644 --- a/packages/common/src/hooks/useAccessAndRemixSettings.ts +++ b/packages/common/src/hooks/useAccessAndRemixSettings.ts @@ -6,10 +6,10 @@ import { isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated -} from 'models/Track' -import { getSupportedUserCollections } from 'store/collectibles/selectors' -import { CommonState } from 'store/index' -import { Nullable } from 'utils/typeUtils' +} from '~/models/Track' +import { getSupportedUserCollections } from '~/store/collectibles/selectors' +import { CommonState } from '~/store/index' +import { Nullable } from '~/utils/typeUtils' type UseAccessAndRemixSettingsProps = { isUpload: boolean diff --git a/packages/common/src/hooks/useAudioBalance.ts b/packages/common/src/hooks/useAudioBalance.ts index 1bc88a8f5e0..964bd210fe2 100644 --- a/packages/common/src/hooks/useAudioBalance.ts +++ b/packages/common/src/hooks/useAudioBalance.ts @@ -3,10 +3,10 @@ import { useMemo } from 'react' import BN from 'bn.js' import { useSelector } from 'react-redux' -import { BNWei } from 'models/Wallet' -import { getAccountUser } from 'store/account/selectors' -import { getAccountTotalBalance } from 'store/wallet/selectors' -import { isNullOrUndefined } from 'utils/typeUtils' +import { BNWei } from '~/models/Wallet' +import { getAccountUser } from '~/store/account/selectors' +import { getAccountTotalBalance } from '~/store/wallet/selectors' +import { isNullOrUndefined } from '~/utils/typeUtils' /** * Pulls balances from account and wallet selectors. Will prefer the wallet diff --git a/packages/common/src/hooks/useCoinflowAdapter.ts b/packages/common/src/hooks/useCoinflowAdapter.ts index 48c7bf32bf3..b40ece36b5d 100644 --- a/packages/common/src/hooks/useCoinflowAdapter.ts +++ b/packages/common/src/hooks/useCoinflowAdapter.ts @@ -3,8 +3,8 @@ import { useEffect, useState } from 'react' import { TransactionHandler } from '@audius/sdk/dist/core' import { Connection, PublicKey, Transaction } from '@solana/web3.js' -import { getRootSolanaAccount } from 'services/audius-backend' -import { useAppContext } from 'src/context' +import { useAppContext } from '~/context' +import { getRootSolanaAccount } from '~/services/audius-backend' type CoinflowAdapter = { wallet: { diff --git a/packages/common/src/hooks/useCreateUserbankIfNeeded.ts b/packages/common/src/hooks/useCreateUserbankIfNeeded.ts index 795e8354792..743bf597091 100644 --- a/packages/common/src/hooks/useCreateUserbankIfNeeded.ts +++ b/packages/common/src/hooks/useCreateUserbankIfNeeded.ts @@ -2,9 +2,12 @@ import { useEffect } from 'react' import { useSelector } from 'react-redux' -import { AnalyticsEvent } from 'models/Analytics' -import { AudiusBackend, createUserBankIfNeeded } from 'services/audius-backend' -import { solanaSelectors } from 'store/solana' +import { AnalyticsEvent } from '~/models/Analytics' +import { + AudiusBackend, + createUserBankIfNeeded +} from '~/services/audius-backend' +import { solanaSelectors } from '~/store/solana' const { getFeePayer } = solanaSelectors export const useCreateUserbankIfNeeded = ({ diff --git a/packages/common/src/hooks/useDownloadTrackButtons.ts b/packages/common/src/hooks/useDownloadTrackButtons.ts index ee873213587..8103d408ac2 100644 --- a/packages/common/src/hooks/useDownloadTrackButtons.ts +++ b/packages/common/src/hooks/useDownloadTrackButtons.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react' import { shallowEqual, useSelector } from 'react-redux' -import dayjs from 'utils/dayjs' +import dayjs from '~/utils/dayjs' import { ID } from '../models/Identifiers' import { stemCategoryFriendlyNames, StemCategory } from '../models/Stems' diff --git a/packages/common/src/hooks/useFeatureFlag.ts b/packages/common/src/hooks/useFeatureFlag.ts index e0f89e0f8e4..9ede2e39535 100644 --- a/packages/common/src/hooks/useFeatureFlag.ts +++ b/packages/common/src/hooks/useFeatureFlag.ts @@ -2,8 +2,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useEffectOnce } from 'react-use' -import { useAppContext } from 'src/context/appContext' -import { Maybe } from 'utils/typeUtils' +import { useAppContext } from '~/context/appContext' +import { Maybe } from '~/utils/typeUtils' import { FeatureFlags, RemoteConfigInstance } from '../services' diff --git a/packages/common/src/hooks/useGatedContent.ts b/packages/common/src/hooks/useGatedContent.ts index 2b9568dc164..1e6a25e784f 100644 --- a/packages/common/src/hooks/useGatedContent.ts +++ b/packages/common/src/hooks/useGatedContent.ts @@ -2,8 +2,9 @@ import { useMemo } from 'react' import { useSelector } from 'react-redux' -import { Chain } from 'models/Chain' -import { ID } from 'models/Identifiers' +import { useGetCurrentUserId } from '~/api' +import { Chain } from '~/models/Chain' +import { ID } from '~/models/Identifiers' import { AccessConditions, Track, @@ -11,13 +12,12 @@ import { isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated -} from 'models/Track' -import { useGetCurrentUserId } from 'src/api' -import { getAccountUser } from 'store/account/selectors' -import { cacheTracksSelectors, cacheUsersSelectors } from 'store/cache' -import { gatedContentSelectors } from 'store/gated-content' -import { CommonState } from 'store/reducers' -import { Nullable, removeNullable } from 'utils' +} from '~/models/Track' +import { getAccountUser } from '~/store/account/selectors' +import { cacheTracksSelectors, cacheUsersSelectors } from '~/store/cache' +import { gatedContentSelectors } from '~/store/gated-content' +import { CommonState } from '~/store/reducers' +import { Nullable, removeNullable } from '~/utils' const { getTrack } = cacheTracksSelectors const { getUser, getUsers } = cacheUsersSelectors diff --git a/packages/common/src/hooks/useGeneratePlaylistArtwork.ts b/packages/common/src/hooks/useGeneratePlaylistArtwork.ts index 65b70abbd11..7bcd19e2def 100644 --- a/packages/common/src/hooks/useGeneratePlaylistArtwork.ts +++ b/packages/common/src/hooks/useGeneratePlaylistArtwork.ts @@ -2,14 +2,14 @@ import { useCallback } from 'react' import { useSelector } from 'react-redux' -import { ID } from 'models/Identifiers' -import { useAppContext } from 'src/context' +import { useAppContext } from '~/context' +import { ID } from '~/models/Identifiers' import { getCollection, getCollectionTracks -} from 'store/cache/collections/selectors' -import { CommonState } from 'store/index' -import { updatePlaylistArtwork } from 'utils/updatePlaylistArtwork' +} from '~/store/cache/collections/selectors' +import { CommonState } from '~/store/index' +import { updatePlaylistArtwork } from '~/utils/updatePlaylistArtwork' export const useGeneratePlaylistArtwork = (collectionId: ID) => { const collection = useSelector((state: CommonState) => diff --git a/packages/common/src/hooks/useGetFirstOrTopSupporter.ts b/packages/common/src/hooks/useGetFirstOrTopSupporter.ts index 86c44da0dbc..9deb806c365 100644 --- a/packages/common/src/hooks/useGetFirstOrTopSupporter.ts +++ b/packages/common/src/hooks/useGetFirstOrTopSupporter.ts @@ -1,9 +1,9 @@ import { useEffect, useState } from 'react' -import { SupportersMap, SupportingMap } from 'store/tipping' -import { parseWeiNumber } from 'utils/formatUtil' -import { Nullable } from 'utils/typeUtils' -import { parseAudioInputToWei, stringWeiToBN } from 'utils/wallet' +import { SupportersMap, SupportingMap } from '~/store/tipping' +import { parseWeiNumber } from '~/utils/formatUtil' +import { Nullable } from '~/utils/typeUtils' +import { parseAudioInputToWei, stringWeiToBN } from '~/utils/wallet' import { ID, Supporter, User, BNWei, StringAudio, StringWei } from '../models' diff --git a/packages/common/src/hooks/useInterval.ts b/packages/common/src/hooks/useInterval.ts index 1f655a27e6e..99dd48bb463 100644 --- a/packages/common/src/hooks/useInterval.ts +++ b/packages/common/src/hooks/useInterval.ts @@ -4,7 +4,7 @@ import { useIsomorphicLayoutEffect } from 'react-use' export function useInterval(callback: () => void, delay: number | null) { const savedCallback = useRef(callback) - const intervalId = useRef() + const intervalId = useRef() // Remember the latest callback if it changes. useIsomorphicLayoutEffect(() => { diff --git a/packages/common/src/hooks/useLinkUnfurlMetadata.ts b/packages/common/src/hooks/useLinkUnfurlMetadata.ts index e150fa53a3c..ba96906af52 100644 --- a/packages/common/src/hooks/useLinkUnfurlMetadata.ts +++ b/packages/common/src/hooks/useLinkUnfurlMetadata.ts @@ -2,8 +2,8 @@ import { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { CommonState } from 'store/index' -import { chatActions, chatSelectors } from 'store/pages/chat' +import { CommonState } from '~/store/index' +import { chatActions, chatSelectors } from '~/store/pages/chat' const { getUnfurlMetadata } = chatSelectors const { fetchLinkUnfurl } = chatActions diff --git a/packages/common/src/hooks/useProxySelector.ts b/packages/common/src/hooks/useProxySelector.ts index 8866ef739df..0f9acbbd6f5 100644 --- a/packages/common/src/hooks/useProxySelector.ts +++ b/packages/common/src/hooks/useProxySelector.ts @@ -12,6 +12,7 @@ export const createProxySelectorHook = () => { deps: DependencyList, equalityFn?: Parameters[1] ): TReturnType => { + // @ts-ignore // eslint-disable-next-line react-hooks/exhaustive-deps return useSelector(useCallback(memoize(fn), deps), equalityFn) } diff --git a/packages/common/src/hooks/usePurchaseMethod.ts b/packages/common/src/hooks/usePurchaseMethod.ts index 14f798d5b40..0b468f84c90 100644 --- a/packages/common/src/hooks/usePurchaseMethod.ts +++ b/packages/common/src/hooks/usePurchaseMethod.ts @@ -3,7 +3,7 @@ import { useEffect } from 'react' import { USDC } from '@audius/fixed-decimal' import BN from 'bn.js' -import { PurchaseMethod } from 'models/PurchaseContent' +import { PurchaseMethod } from '~/models/PurchaseContent' import { useUSDCBalance } from './useUSDCBalance' diff --git a/packages/common/src/hooks/useRemoteVar.ts b/packages/common/src/hooks/useRemoteVar.ts index c71c4a90bd6..daf600ed060 100644 --- a/packages/common/src/hooks/useRemoteVar.ts +++ b/packages/common/src/hooks/useRemoteVar.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { useAppContext } from 'src/context' +import { useAppContext } from '~/context' import { AllRemoteConfigKeys, diff --git a/packages/common/src/hooks/useSavedCollections.ts b/packages/common/src/hooks/useSavedCollections.ts index 1d74a90f3b1..6a87d55f659 100644 --- a/packages/common/src/hooks/useSavedCollections.ts +++ b/packages/common/src/hooks/useSavedCollections.ts @@ -2,8 +2,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' import { CommonState } from '../store' import { diff --git a/packages/common/src/hooks/useTikTokAuth.ts b/packages/common/src/hooks/useTikTokAuth.ts index 3c19f902ea3..0a55c88b837 100644 --- a/packages/common/src/hooks/useTikTokAuth.ts +++ b/packages/common/src/hooks/useTikTokAuth.ts @@ -1,4 +1,4 @@ -import dayjs from 'utils/dayjs' +import dayjs from '~/utils/dayjs' type CreateUseTikTokAuthHookArguments = { authenticate: () => Promise diff --git a/packages/common/src/hooks/useTwitterButtonStatus.ts b/packages/common/src/hooks/useTwitterButtonStatus.ts index 5f284d69a99..e63f9d0c240 100644 --- a/packages/common/src/hooks/useTwitterButtonStatus.ts +++ b/packages/common/src/hooks/useTwitterButtonStatus.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from 'react' -import { User } from 'models/User' -import { Nullable } from 'utils/typeUtils' +import { User } from '~/models/User' +import { Nullable } from '~/utils/typeUtils' type ShareStatus = 'idle' | 'loading' | 'success' diff --git a/packages/common/src/hooks/useUIAudio.ts b/packages/common/src/hooks/useUIAudio.ts index 93fa77d5631..636115e760f 100644 --- a/packages/common/src/hooks/useUIAudio.ts +++ b/packages/common/src/hooks/useUIAudio.ts @@ -2,8 +2,8 @@ import { useMemo } from 'react' import BN from 'bn.js' -import { BNWei, StringWei } from 'models/Wallet' -import { formatWei } from 'utils/wallet' +import { BNWei, StringWei } from '~/models/Wallet' +import { formatWei } from '~/utils/wallet' export const useUIAudio = (weiAudio: StringWei): number => useMemo(() => parseInt(formatWei(new BN(weiAudio) as BNWei), 10), [weiAudio]) diff --git a/packages/common/src/hooks/useUSDCBalance.ts b/packages/common/src/hooks/useUSDCBalance.ts index 1d58c38b995..73231128aca 100644 --- a/packages/common/src/hooks/useUSDCBalance.ts +++ b/packages/common/src/hooks/useUSDCBalance.ts @@ -3,13 +3,13 @@ import { useCallback, useEffect, useState } from 'react' import BN from 'bn.js' import { useDispatch, useSelector } from 'react-redux' -import { Status } from 'models/Status' -import { BNUSDC, StringUSDC } from 'models/Wallet' -import { getUserbankAccountInfo } from 'services/index' -import { useAppContext } from 'src/context/appContext' -import { getRecoveryStatus } from 'store/buy-usdc/selectors' -import { getUSDCBalance } from 'store/wallet/selectors' -import { setUSDCBalance } from 'store/wallet/slice' +import { useAppContext } from '~/context/appContext' +import { Status } from '~/models/Status' +import { BNUSDC, StringUSDC } from '~/models/Wallet' +import { getUserbankAccountInfo } from '~/services/index' +import { getRecoveryStatus } from '~/store/buy-usdc/selectors' +import { getUSDCBalance } from '~/store/wallet/selectors' +import { setUSDCBalance } from '~/store/wallet/slice' import { useInterval } from './useInterval' diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts deleted file mode 100644 index 7a8a1fb440d..00000000000 --- a/packages/common/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './api' -export * from './audius-query' -export * from './context' -export * from './models' -export * from './utils' -export * from './services' -export * from './hooks' -export * from './store' -export * from './schemas' -export * from './assets' -export * from './messages' diff --git a/packages/common/src/messages/sign-on/pages.ts b/packages/common/src/messages/sign-on/pages.ts index 664db1e0606..e878f2e78b4 100644 --- a/packages/common/src/messages/sign-on/pages.ts +++ b/packages/common/src/messages/sign-on/pages.ts @@ -111,7 +111,7 @@ export const createLoginDetailsPageMessages = { signIn: 'Sign In' } -export const selectArtstsPageMessages = { +export const selectArtistsPageMessages = { header: 'Follow At Least 3 Artists', description: 'Curate your feed with tracks uploaded or reposted by anyone you follow. Click the artist’s photo to preview their music.', diff --git a/packages/common/src/models/Analytics.ts b/packages/common/src/models/Analytics.ts index 1432a37cf64..6506dc31be1 100644 --- a/packages/common/src/models/Analytics.ts +++ b/packages/common/src/models/Analytics.ts @@ -1,12 +1,16 @@ import { ChatPermission, Genre } from '@audius/sdk' -import { FeedFilter } from 'models/FeedFilter' -import { ID, PlayableType } from 'models/Identifiers' -import { MonitorPayload, ServiceMonitorType } from 'models/Services' -import { TimeRange } from 'models/TimeRange' -import { SolanaWalletAddress, StringAudio, WalletAddress } from 'models/Wallet' -import { MintName } from 'services/index' -import { Prettify } from 'utils/typeUtils' +import { FeedFilter } from '~/models/FeedFilter' +import { ID, PlayableType } from '~/models/Identifiers' +import { MonitorPayload, ServiceMonitorType } from '~/models/Services' +import { TimeRange } from '~/models/TimeRange' +import { + SolanaWalletAddress, + StringAudio, + WalletAddress +} from '~/models/Wallet' +import { MintName } from '~/services/index' +import { Prettify } from '~/utils/typeUtils' import { Chain } from './Chain' import { PlaylistLibraryKind } from './PlaylistLibrary' diff --git a/packages/common/src/models/Cache.ts b/packages/common/src/models/Cache.ts index defa8930da6..cf6f6ca65c2 100644 --- a/packages/common/src/models/Cache.ts +++ b/packages/common/src/models/Cache.ts @@ -1,6 +1,6 @@ -import { ID, UID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { Status } from 'models/Status' +import { ID, UID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { Status } from '~/models/Status' export type Cacheable = { metadata: T diff --git a/packages/common/src/models/Chat.ts b/packages/common/src/models/Chat.ts index 70e20160795..336204c130a 100644 --- a/packages/common/src/models/Chat.ts +++ b/packages/common/src/models/Chat.ts @@ -1,6 +1,6 @@ import type { ChatMessage, UnfurlResponse } from '@audius/sdk' -import { Status } from 'models' +import { Status } from '~/models' export type ChatMessageWithExtras = ChatMessage & { status?: Status diff --git a/packages/common/src/models/Favorite.ts b/packages/common/src/models/Favorite.ts index ca8716903ce..6113d835710 100644 --- a/packages/common/src/models/Favorite.ts +++ b/packages/common/src/models/Favorite.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' export enum FavoriteType { TRACK = 'track', diff --git a/packages/common/src/models/Lineup.ts b/packages/common/src/models/Lineup.ts index ed653b06ac0..76a10833d1e 100644 --- a/packages/common/src/models/Lineup.ts +++ b/packages/common/src/models/Lineup.ts @@ -1,7 +1,7 @@ -import { ID, UID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { Status } from 'models/Status' -import { Nullable } from 'utils/typeUtils' +import { ID, UID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { Status } from '~/models/Status' +import { Nullable } from '~/utils/typeUtils' export type Lineup = { entries: T[] diff --git a/packages/common/src/models/PlaylistLibrary.ts b/packages/common/src/models/PlaylistLibrary.ts index ca09c7d25b1..4843bd7a5d6 100644 --- a/packages/common/src/models/PlaylistLibrary.ts +++ b/packages/common/src/models/PlaylistLibrary.ts @@ -1,4 +1,4 @@ -import { SmartCollectionVariant } from 'models/SmartCollectionVariant' +import { SmartCollectionVariant } from '~/models/SmartCollectionVariant' import { ID } from './Identifiers' diff --git a/packages/common/src/models/Repost.ts b/packages/common/src/models/Repost.ts index f46a1b62ee7..e3719c17bc0 100644 --- a/packages/common/src/models/Repost.ts +++ b/packages/common/src/models/Repost.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { User } from './User' diff --git a/packages/common/src/models/Search.ts b/packages/common/src/models/Search.ts index de8789cc8d8..c0e24b8b15c 100644 --- a/packages/common/src/models/Search.ts +++ b/packages/common/src/models/Search.ts @@ -1,4 +1,4 @@ -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { CollectionImage } from './Collection' import { Repost } from './Repost' diff --git a/packages/common/src/models/Stems.ts b/packages/common/src/models/Stems.ts index 73e4bc08f88..65dbb75183c 100644 --- a/packages/common/src/models/Stems.ts +++ b/packages/common/src/models/Stems.ts @@ -1,4 +1,4 @@ -import { Track } from 'models/Track' +import { Track } from '~/models/Track' export enum StemCategory { INSTRUMENTAL = 'INSTRUMENTAL', diff --git a/packages/common/src/models/Tipping.ts b/packages/common/src/models/Tipping.ts index 42d6e3e5abc..e0038d93f6f 100644 --- a/packages/common/src/models/Tipping.ts +++ b/packages/common/src/models/Tipping.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { StringWei } from './Wallet' diff --git a/packages/common/src/models/Track.ts b/packages/common/src/models/Track.ts index 0b646c4b28a..dcf8283cb3d 100644 --- a/packages/common/src/models/Track.ts +++ b/packages/common/src/models/Track.ts @@ -1,4 +1,4 @@ -import { License } from 'utils/creativeCommons' +import { License } from '~/utils/creativeCommons' import { Nullable } from '../utils/typeUtils' diff --git a/packages/common/src/models/User.ts b/packages/common/src/models/User.ts index b44ff480726..cfbd990132c 100644 --- a/packages/common/src/models/User.ts +++ b/packages/common/src/models/User.ts @@ -1,10 +1,10 @@ -import { Collectible, CollectiblesMetadata } from 'models/Collectible' -import { Color } from 'models/Color' -import { CID, ID } from 'models/Identifiers' -import { CoverPhotoSizes, ProfilePictureSizes } from 'models/ImageSizes' -import { PlaylistLibrary } from 'models/PlaylistLibrary' -import { SolanaWalletAddress, StringWei, WalletAddress } from 'models/Wallet' -import { Nullable } from 'utils/typeUtils' +import { Collectible, CollectiblesMetadata } from '~/models/Collectible' +import { Color } from '~/models/Color' +import { CID, ID } from '~/models/Identifiers' +import { CoverPhotoSizes, ProfilePictureSizes } from '~/models/ImageSizes' +import { PlaylistLibrary } from '~/models/PlaylistLibrary' +import { SolanaWalletAddress, StringWei, WalletAddress } from '~/models/Wallet' +import { Nullable } from '~/utils/typeUtils' import { Timestamped } from './Timestamped' diff --git a/packages/common/src/models/Wallet.ts b/packages/common/src/models/Wallet.ts index 28fba7b365b..92b7636e4e1 100644 --- a/packages/common/src/models/Wallet.ts +++ b/packages/common/src/models/Wallet.ts @@ -1,6 +1,6 @@ import type BN from 'bn.js' -import { Brand } from 'utils/typeUtils' +import { Brand } from '~/utils/typeUtils' export type StringWei = Brand export type StringAudio = string diff --git a/packages/common/src/schemas/sign-on/createLoginDetailsSchema.ts b/packages/common/src/schemas/sign-on/createLoginDetailsSchema.ts index f77a038666d..6f2920abaa6 100644 --- a/packages/common/src/schemas/sign-on/createLoginDetailsSchema.ts +++ b/packages/common/src/schemas/sign-on/createLoginDetailsSchema.ts @@ -1,7 +1,7 @@ import { z } from 'zod' -import { AudiusQueryContextType } from 'audius-query' -import { isNotCommonPassword } from 'utils/commonPasswordCheck' +import { AudiusQueryContextType } from '~/audius-query' +import { isNotCommonPassword } from '~/utils/commonPasswordCheck' import { emailSchema } from './emailSchema' diff --git a/packages/common/src/schemas/sign-on/emailSchema.ts b/packages/common/src/schemas/sign-on/emailSchema.ts index 0538d9bb49e..0df5b389a25 100644 --- a/packages/common/src/schemas/sign-on/emailSchema.ts +++ b/packages/common/src/schemas/sign-on/emailSchema.ts @@ -1,8 +1,8 @@ import { z } from 'zod' -import { AudiusQueryContextType } from 'audius-query' -import { signUpFetch } from 'src/api' -import { EMAIL_REGEX } from 'utils/email' +import { signUpFetch } from '~/api' +import { AudiusQueryContextType } from '~/audius-query' +import { EMAIL_REGEX } from '~/utils/email' export const emailSchemaMessages = { emailRequired: 'Please enter an email.', diff --git a/packages/common/src/schemas/sign-on/finishProfileSchema.ts b/packages/common/src/schemas/sign-on/finishProfileSchema.ts index 21f7332fd93..d35f5317935 100644 --- a/packages/common/src/schemas/sign-on/finishProfileSchema.ts +++ b/packages/common/src/schemas/sign-on/finishProfileSchema.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { MAX_DISPLAY_NAME_LENGTH } from 'services/oauth/formatSocialProfile' +import { MAX_DISPLAY_NAME_LENGTH } from '~/services/oauth/formatSocialProfile' export const finishProfileSchema = z.object({ displayName: z.string().max(MAX_DISPLAY_NAME_LENGTH, ''), diff --git a/packages/common/src/schemas/sign-on/passwordSchema.ts b/packages/common/src/schemas/sign-on/passwordSchema.ts index b3633e33398..89f38381948 100644 --- a/packages/common/src/schemas/sign-on/passwordSchema.ts +++ b/packages/common/src/schemas/sign-on/passwordSchema.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { isNotCommonPassword } from 'utils/commonPasswordCheck' +import { isNotCommonPassword } from '~/utils/commonPasswordCheck' export const passwordSchema = z .object({ diff --git a/packages/common/src/schemas/sign-on/pickHandleSchema.ts b/packages/common/src/schemas/sign-on/pickHandleSchema.ts index 5fce36dfcc8..55a36dd7243 100644 --- a/packages/common/src/schemas/sign-on/pickHandleSchema.ts +++ b/packages/common/src/schemas/sign-on/pickHandleSchema.ts @@ -1,9 +1,9 @@ import { z } from 'zod' -import { AudiusQueryContextType } from 'audius-query' -import { MAX_HANDLE_LENGTH } from 'services/oauth' -import { signUpFetch } from 'src/api' -import { restrictedHandles as commonRestrictedHandles } from 'utils/restrictedHandles' +import { signUpFetch } from '~/api' +import { AudiusQueryContextType } from '~/audius-query' +import { MAX_HANDLE_LENGTH } from '~/services/oauth' +import { restrictedHandles as commonRestrictedHandles } from '~/utils/restrictedHandles' export const pickHandleErrorMessages = { badCharacterError: 'Please only use A-Z, 0-9, . and _', diff --git a/packages/common/src/schemas/sign-on/selectGenresSchema.ts b/packages/common/src/schemas/sign-on/selectGenresSchema.ts index 12871961365..0e577eb726a 100644 --- a/packages/common/src/schemas/sign-on/selectGenresSchema.ts +++ b/packages/common/src/schemas/sign-on/selectGenresSchema.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { GENRES, Genre, convertGenreLabelToValue } from 'utils/genres' +import { GENRES, Genre, convertGenreLabelToValue } from '~/utils/genres' const excludedGenres = new Set([ Genre.COMEDY, diff --git a/packages/common/src/services/Jupiter.ts b/packages/common/src/services/Jupiter.ts index 4206808c1c8..bdb584110c0 100644 --- a/packages/common/src/services/Jupiter.ts +++ b/packages/common/src/services/Jupiter.ts @@ -1,8 +1,8 @@ import { createJupiterApiClient, Instruction } from '@jup-ag/api' import { PublicKey, TransactionInstruction } from '@solana/web3.js' -import { Name } from 'models/Analytics' -import { CommonStoreContext } from 'store/storeContext' +import { Name } from '~/models/Analytics' +import { CommonStoreContext } from '~/store/storeContext' /** * The error that gets returned if the slippage is exceeded diff --git a/packages/common/src/services/RandomImage.ts b/packages/common/src/services/RandomImage.ts index 2f38c515585..b2bab436542 100644 --- a/packages/common/src/services/RandomImage.ts +++ b/packages/common/src/services/RandomImage.ts @@ -1,4 +1,4 @@ -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' const UNSPLASH_PUBLIC = 'https://source.unsplash.com/random' const UNSPLASH_API_GATEWAY = 'https://api.audius.co/unsplash/photos/random' diff --git a/packages/common/src/services/audio-player.ts b/packages/common/src/services/audio-player.ts index f27700f8c35..69d354ee390 100644 --- a/packages/common/src/services/audio-player.ts +++ b/packages/common/src/services/audio-player.ts @@ -1,4 +1,4 @@ -import { PlaybackRate } from 'store/player' +import { PlaybackRate } from '~/store/player' import { Nullable } from '../utils' diff --git a/packages/common/src/services/audius-api-client/ResponseAdapter.ts b/packages/common/src/services/audius-api-client/ResponseAdapter.ts index 911b4f8d04c..2c96eb24981 100644 --- a/packages/common/src/services/audius-api-client/ResponseAdapter.ts +++ b/packages/common/src/services/audius-api-client/ResponseAdapter.ts @@ -1,6 +1,6 @@ import { full } from '@audius/sdk' -import dayjs from 'utils/dayjs' +import dayjs from '~/utils/dayjs' import { ID, diff --git a/packages/common/src/services/audius-api-client/helper.ts b/packages/common/src/services/audius-api-client/helper.ts index 1595db88c6f..75695dda3be 100644 --- a/packages/common/src/services/audius-api-client/helper.ts +++ b/packages/common/src/services/audius-api-client/helper.ts @@ -1,5 +1,9 @@ -import { UserCollectionMetadata, UserTrackMetadata, UserMetadata } from 'models' -import { removeNullable } from 'utils' +import { + UserCollectionMetadata, + UserTrackMetadata, + UserMetadata +} from '~/models' +import { removeNullable } from '~/utils' import * as adapter from './ResponseAdapter' import { APIResponse, APISearch } from './types' diff --git a/packages/common/src/services/audius-backend/AudiusBackend.ts b/packages/common/src/services/audius-backend/AudiusBackend.ts index d7cb55a2d3f..e3f0646534d 100644 --- a/packages/common/src/services/audius-backend/AudiusBackend.ts +++ b/packages/common/src/services/audius-backend/AudiusBackend.ts @@ -17,8 +17,8 @@ import { import BN from 'bn.js' import queryString from 'query-string' -import { Env } from 'services/env' -import dayjs from 'utils/dayjs' +import { Env } from '~/services/env' +import dayjs from '~/utils/dayjs' import placeholderCoverArt from '../../assets/img/imageBlank2x.png' import imageCoverPhotoBlank from '../../assets/img/imageCoverPhotoBlank.jpg' @@ -390,7 +390,7 @@ export const audiusBackend = ({ const start = preloadImageTimer.start() const timeoutMs = getRemoteVar(IntKeys.IMAGE_QUICK_FETCH_TIMEOUT_MS) ?? undefined - let timeoutId: Nullable = null + let timeoutId: any = null try { const response = await Promise.race([ diff --git a/packages/common/src/services/audius-backend/RecordIP.ts b/packages/common/src/services/audius-backend/RecordIP.ts index 9ae8bd2a0ba..e072f296e60 100644 --- a/packages/common/src/services/audius-backend/RecordIP.ts +++ b/packages/common/src/services/audius-backend/RecordIP.ts @@ -1,4 +1,4 @@ -import { getErrorMessage } from 'utils' +import { getErrorMessage } from '~/utils' import { AudiusBackend, AuthHeaders } from './AudiusBackend' diff --git a/packages/common/src/services/audius-backend/Rewards.ts b/packages/common/src/services/audius-backend/Rewards.ts index b65cc4d12e6..d78594677e2 100644 --- a/packages/common/src/services/audius-backend/Rewards.ts +++ b/packages/common/src/services/audius-backend/Rewards.ts @@ -1,5 +1,5 @@ -import { Name, AnalyticsEvent } from 'models/Analytics' -import { ErrorLevel, ReportToSentryArgs } from 'models/ErrorReporting' +import { Name, AnalyticsEvent } from '~/models/Analytics' +import { ErrorLevel, ReportToSentryArgs } from '~/models/ErrorReporting' /** * Reports Rewards claim outcome to Identity, Amplitude, Sentry diff --git a/packages/common/src/services/audius-backend/solana.ts b/packages/common/src/services/audius-backend/solana.ts index aefe5659a6c..c4dbc4dbafc 100644 --- a/packages/common/src/services/audius-backend/solana.ts +++ b/packages/common/src/services/audius-backend/solana.ts @@ -11,7 +11,7 @@ import { } from '@solana/web3.js' import BN from 'bn.js' -import { BN_USDC_CENT_WEI } from 'utils/wallet' +import { BN_USDC_CENT_WEI } from '~/utils/wallet' import { AnalyticsEvent, ID, Name, SolanaWalletAddress } from '../../models' diff --git a/packages/common/src/services/audius-backend/types.ts b/packages/common/src/services/audius-backend/types.ts index c3989bbecf7..f9c3093c7f3 100644 --- a/packages/common/src/services/audius-backend/types.ts +++ b/packages/common/src/services/audius-backend/types.ts @@ -1,4 +1,4 @@ -import { MonitorPayload } from 'models' +import { MonitorPayload } from '~/models' export type ServiceMonitoring = { healthCheck: (payload: MonitorPayload) => void diff --git a/packages/common/src/services/env.ts b/packages/common/src/services/env.ts index 3dff3318b3c..24a32b1e6fa 100644 --- a/packages/common/src/services/env.ts +++ b/packages/common/src/services/env.ts @@ -1,4 +1,4 @@ -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' export type Environment = 'development' | 'staging' | 'production' diff --git a/packages/common/src/services/local-storage/LocalStorage.ts b/packages/common/src/services/local-storage/LocalStorage.ts index d6332960e09..8b76e59cb20 100644 --- a/packages/common/src/services/local-storage/LocalStorage.ts +++ b/packages/common/src/services/local-storage/LocalStorage.ts @@ -1,7 +1,7 @@ import { CURRENT_USER_EXISTS_LOCAL_STORAGE_KEY } from '@audius/sdk/dist/core' -import { User } from 'models/User' -import { PLAYBACK_RATE_LS_KEY } from 'store/index' +import { User } from '~/models/User' +import { PLAYBACK_RATE_LS_KEY } from '~/store/index' import { Nullable } from '../../utils' diff --git a/packages/common/src/services/oauth/formatSocialProfile.ts b/packages/common/src/services/oauth/formatSocialProfile.ts index d742b505562..eef22ff726c 100644 --- a/packages/common/src/services/oauth/formatSocialProfile.ts +++ b/packages/common/src/services/oauth/formatSocialProfile.ts @@ -2,7 +2,7 @@ import { InstagramProfile, TikTokProfile, TwitterProfile -} from 'store/account/types' +} from '~/store/account/types' export const MAX_HANDLE_LENGTH = 30 export const MAX_DISPLAY_NAME_LENGTH = 32 diff --git a/packages/common/src/services/opensea-client/OpenSeaClient.ts b/packages/common/src/services/opensea-client/OpenSeaClient.ts index 229bcfda4b4..30f1ca79e98 100644 --- a/packages/common/src/services/opensea-client/OpenSeaClient.ts +++ b/packages/common/src/services/opensea-client/OpenSeaClient.ts @@ -1,4 +1,4 @@ -import { allSettled } from 'utils/allSettled' +import { allSettled } from '~/utils/allSettled' import { Collectible, diff --git a/packages/common/src/services/opensea-client/ethCollectibleHelpers.ts b/packages/common/src/services/opensea-client/ethCollectibleHelpers.ts index 9eff5685c4e..40942305eab 100644 --- a/packages/common/src/services/opensea-client/ethCollectibleHelpers.ts +++ b/packages/common/src/services/opensea-client/ethCollectibleHelpers.ts @@ -1,3 +1,5 @@ +import { Nullable } from '~/utils' + import { Chain, Collectible, @@ -155,14 +157,14 @@ export const assetToCollectible = async ( asset: OpenSeaAssetExtended ): Promise => { let mediaType: CollectibleMediaType - let frameUrl = null - let imageUrl = null - let videoUrl = null - let threeDUrl = null - let gifUrl = null + let frameUrl: Nullable = null + let imageUrl: Nullable = null + let videoUrl: Nullable = null + let threeDUrl: Nullable = null + let gifUrl: Nullable = null let hasAudio = false - let animationUrlOverride = null + let animationUrlOverride: Nullable = null const { animation_url, diff --git a/packages/common/src/services/remote-config/index.ts b/packages/common/src/services/remote-config/index.ts index 30a302983ab..3a1aba5e0a7 100644 --- a/packages/common/src/services/remote-config/index.ts +++ b/packages/common/src/services/remote-config/index.ts @@ -1,8 +1,8 @@ export { IntKeys, StringKeys, DoubleKeys, BooleanKeys } from './types' -export { AllRemoteConfigKeys } from './types' +export type { AllRemoteConfigKeys } from './types' export { FeatureFlags } from './feature-flags' export { remoteConfig } from './remote-config' -export { RemoteConfigInstance } from './remote-config' +export type { RemoteConfigInstance } from './remote-config' export { remoteConfigIntDefaults, remoteConfigDoubleDefaults, diff --git a/packages/common/src/services/remote-config/remote-config.ts b/packages/common/src/services/remote-config/remote-config.ts index 9aeac93c311..7433824dbd8 100644 --- a/packages/common/src/services/remote-config/remote-config.ts +++ b/packages/common/src/services/remote-config/remote-config.ts @@ -2,8 +2,8 @@ import { EventEmitter } from 'events' import optimizely from '@optimizely/optimizely-sdk' -import { ID } from 'models' -import { Nullable } from 'utils' +import { ID } from '~/models' +import { Nullable } from '~/utils' import { Environment } from '../env' diff --git a/packages/common/src/services/sdk/storageNodeSelector.ts b/packages/common/src/services/sdk/storageNodeSelector.ts index b491b31056a..6b6fc639aa1 100644 --- a/packages/common/src/services/sdk/storageNodeSelector.ts +++ b/packages/common/src/services/sdk/storageNodeSelector.ts @@ -1,7 +1,7 @@ import type { Auth, StorageNodeSelectorService } from '@audius/sdk' import { StorageNodeSelector } from '@audius/sdk' -import { Maybe } from 'utils/typeUtils' +import { Maybe } from '~/utils/typeUtils' import { Env } from '../env' diff --git a/packages/common/src/services/track-download/TrackDownload.ts b/packages/common/src/services/track-download/TrackDownload.ts index a71418fd1f8..8de090f1c33 100644 --- a/packages/common/src/services/track-download/TrackDownload.ts +++ b/packages/common/src/services/track-download/TrackDownload.ts @@ -1,4 +1,4 @@ -import { AudiusBackend } from 'services/audius-backend' +import { AudiusBackend } from '~/services/audius-backend' export type TrackDownloadConfig = { audiusBackend: AudiusBackend diff --git a/packages/common/src/services/wallet-client/WalletClient.ts b/packages/common/src/services/wallet-client/WalletClient.ts index 69bd3ce5365..5dd8e02092c 100644 --- a/packages/common/src/services/wallet-client/WalletClient.ts +++ b/packages/common/src/services/wallet-client/WalletClient.ts @@ -1,14 +1,14 @@ import BN from 'bn.js' -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { BNWei, SolanaWalletAddress, StringWei, WalletAddress -} from 'models/Wallet' -import { isNullOrUndefined } from 'utils/typeUtils' -import { stringWeiToBN } from 'utils/wallet' +} from '~/models/Wallet' +import { isNullOrUndefined } from '~/utils/typeUtils' +import { stringWeiToBN } from '~/utils/wallet' import { AudiusAPIClient } from '../audius-api-client' import { diff --git a/packages/common/src/store/account/sagas.ts b/packages/common/src/store/account/sagas.ts index 30366d21a66..0f96dc02cea 100644 --- a/packages/common/src/store/account/sagas.ts +++ b/packages/common/src/store/account/sagas.ts @@ -1,7 +1,7 @@ import { call, put, select, takeLatest } from 'typed-redux-saga' -import { getContext } from 'store/effects' -import { UPLOAD_TRACKS_SUCCEEDED } from 'store/upload/actions' +import { getContext } from '~/store/effects' +import { UPLOAD_TRACKS_SUCCEEDED } from '~/store/upload/actions' import { getUserId, getUserHandle } from './selectors' import { fetchAccountSucceeded, fetchHasTracks, setHasTracks } from './slice' diff --git a/packages/common/src/store/account/selectors.ts b/packages/common/src/store/account/selectors.ts index 2f2c85a1ea0..da5da767295 100644 --- a/packages/common/src/store/account/selectors.ts +++ b/packages/common/src/store/account/selectors.ts @@ -1,8 +1,8 @@ import { createSelector } from 'reselect' -import { getCollections } from 'store/cache/collections/selectors' -import { getUser, getUsers } from 'store/cache/users/selectors' -import { removeNullable } from 'utils/typeUtils' +import { getCollections } from '~/store/cache/collections/selectors' +import { getUser, getUsers } from '~/store/cache/users/selectors' +import { removeNullable } from '~/utils/typeUtils' import { CommonState } from '../commonStore' diff --git a/packages/common/src/store/account/slice.ts b/packages/common/src/store/account/slice.ts index 88e72f7ab89..28b86971cd3 100644 --- a/packages/common/src/store/account/slice.ts +++ b/packages/common/src/store/account/slice.ts @@ -1,8 +1,8 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { keyBy } from 'lodash' -import { User } from 'models' -import { Nullable } from 'utils/typeUtils' +import { User } from '~/models' +import { Nullable } from '~/utils/typeUtils' import { ID } from '../../models/Identifiers' import { Status } from '../../models/Status' diff --git a/packages/common/src/store/average-color/index.ts b/packages/common/src/store/average-color/index.ts index 97c61ab91fe..cf2c9a3f564 100644 --- a/packages/common/src/store/average-color/index.ts +++ b/packages/common/src/store/average-color/index.ts @@ -1,5 +1,5 @@ export { default as averageColorReducer, - actions as averageColorActions, - selectors as averageColorSelectors + actions as averageColorActions } from './slice' +export { selectors as averageColorSelectors } from './selectors' diff --git a/packages/common/src/store/average-color/selectors.ts b/packages/common/src/store/average-color/selectors.ts new file mode 100644 index 00000000000..c77470e628c --- /dev/null +++ b/packages/common/src/store/average-color/selectors.ts @@ -0,0 +1,34 @@ +import { CID, Color, Track } from '~/models' +import { Nullable } from '~/utils' + +import { CommonState } from '../reducers' + +export const getAverageColor = ( + state: CommonState, + { multihash }: { multihash: Nullable } +): Nullable => + (multihash && state.ui.averageColor.averageColor[multihash]) || null + +export const getAverageColorByTrack = ( + state: CommonState, + { track }: { track: Nullable } +): Nullable => { + const multihash = track?.cover_art_sizes ?? track?.cover_art + if (!multihash) return null + return state.ui.averageColor.averageColor[multihash] ?? null +} + +export const getDominantColorsByTrack = ( + state: CommonState, + { track }: { track: Nullable } +): Nullable => { + const multihash = track?.cover_art_sizes ?? track?.cover_art + if (!multihash) return null + return state.ui.averageColor.dominantColors[multihash] ?? null +} + +export const selectors = { + getAverageColor, + getAverageColorByTrack, + getDominantColorsByTrack +} diff --git a/packages/common/src/store/average-color/slice.ts b/packages/common/src/store/average-color/slice.ts index 60d41ce715a..986caa99239 100644 --- a/packages/common/src/store/average-color/slice.ts +++ b/packages/common/src/store/average-color/slice.ts @@ -1,11 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' - import { Color } from '../../models/Color' -import { CID } from '../../models/Identifiers' -import { Track } from '../../models/Track' -import { CommonState } from '../commonStore' const initialState: { averageColor: { [multihash: string]: Color } @@ -44,34 +39,4 @@ export const { setAverageColor, setDominantColors } = slice.actions export const actions = slice.actions -export const getAverageColor = ( - state: CommonState, - { multihash }: { multihash: Nullable } -): Nullable => - (multihash && state.ui.averageColor.averageColor[multihash]) || null - -export const getAverageColorByTrack = ( - state: CommonState, - { track }: { track: Nullable } -): Nullable => { - const multihash = track?.cover_art_sizes ?? track?.cover_art - if (!multihash) return null - return state.ui.averageColor.averageColor[multihash] ?? null -} - -export const getDominantColorsByTrack = ( - state: CommonState, - { track }: { track: Nullable } -): Nullable => { - const multihash = track?.cover_art_sizes ?? track?.cover_art - if (!multihash) return null - return state.ui.averageColor.dominantColors[multihash] ?? null -} - -export const selectors = { - getAverageColor, - getAverageColorByTrack, - getDominantColorsByTrack -} - export default slice.reducer diff --git a/packages/common/src/store/buy-crypto/sagas.ts b/packages/common/src/store/buy-crypto/sagas.ts index 9e579101eb0..124dd6555ac 100644 --- a/packages/common/src/store/buy-crypto/sagas.ts +++ b/packages/common/src/store/buy-crypto/sagas.ts @@ -22,14 +22,14 @@ import { takeLatest } from 'typed-redux-saga' -import { Name } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' +import { Name } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' import { SLIPPAGE_TOLERANCE_EXCEEDED_ERROR, jupiterInstance, parseJupiterInstruction, quoteWithAnalytics -} from 'services/Jupiter' +} from '~/services/Jupiter' import { MEMO_PROGRAM_ID, MintName, @@ -41,9 +41,9 @@ import { pollForBalanceChange, pollForTokenBalanceChange, relayVersionedTransaction -} from 'services/audius-backend/solana' -import { FeatureFlags } from 'services/index' -import { IntKeys } from 'services/remote-config/types' +} from '~/services/audius-backend/solana' +import { FeatureFlags } from '~/services/index' +import { IntKeys } from '~/services/remote-config/types' import { onrampCanceled, onrampFailed, @@ -54,15 +54,15 @@ import { buyCryptoSucceeded, buyCryptoRecoverySucceeded, buyCryptoRecoveryFailed -} from 'store/buy-crypto/slice' -import { getBuyUSDCRemoteConfig } from 'store/buy-usdc' -import { getContext } from 'store/commonStore' -import { getFeePayer } from 'store/solana/selectors' -import { TOKEN_LISTING_MAP } from 'store/ui/buy-audio/constants' -import { OnRampProvider } from 'store/ui/buy-audio/types' -import { setVisibility } from 'store/ui/modals/parentSlice' -import { initializeStripeModal } from 'store/ui/stripe-modal/slice' -import { waitForAccount, waitForValue } from 'utils/sagaHelpers' +} from '~/store/buy-crypto/slice' +import { getBuyUSDCRemoteConfig } from '~/store/buy-usdc' +import { getContext } from '~/store/commonStore' +import { getFeePayer } from '~/store/solana/selectors' +import { TOKEN_LISTING_MAP } from '~/store/ui/buy-audio/constants' +import { OnRampProvider } from '~/store/ui/buy-audio/types' +import { setVisibility } from '~/store/ui/modals/parentSlice' +import { initializeStripeModal } from '~/store/ui/stripe-modal/slice' +import { waitForAccount, waitForValue } from '~/utils/sagaHelpers' import { BuyCryptoConfig, @@ -513,7 +513,7 @@ function* doBuyCryptoViaSol({ const preSwapTokenBalance = account?.amount ?? BigInt(0) // Try the swap a few times in hopes the price comes back if it slipped - let swapError = null + let swapError: string | null = null let swapTransactionSignature: string | null = null let retryCount = 0 // TODO: Put these into optimizely? diff --git a/packages/common/src/store/buy-crypto/slice.ts b/packages/common/src/store/buy-crypto/slice.ts index 4c2d0c8ab83..294af4c887b 100644 --- a/packages/common/src/store/buy-crypto/slice.ts +++ b/packages/common/src/store/buy-crypto/slice.ts @@ -1,8 +1,8 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { MintName } from 'services/index' -import { OnRampProvider } from 'store/ui/buy-audio/types' -import { StripeSessionCreationError } from 'store/ui/stripe-modal/types' +import { MintName } from '~/services/index' +import { OnRampProvider } from '~/store/ui/buy-audio/types' +import { StripeSessionCreationError } from '~/store/ui/stripe-modal/types' import { BuyCryptoError } from './types' diff --git a/packages/common/src/store/buy-crypto/types.ts b/packages/common/src/store/buy-crypto/types.ts index b0bc02a8e27..b5248afa673 100644 --- a/packages/common/src/store/buy-crypto/types.ts +++ b/packages/common/src/store/buy-crypto/types.ts @@ -1,5 +1,5 @@ -import { MintName } from 'services/index' -import { OnRampProvider } from 'store/ui/buy-audio/types' +import { MintName } from '~/services/index' +import { OnRampProvider } from '~/store/ui/buy-audio/types' export type BuyCryptoConfig = { /** diff --git a/packages/common/src/store/buy-usdc/sagas.ts b/packages/common/src/store/buy-usdc/sagas.ts index 768eacc6ed1..c48b2d18a5d 100644 --- a/packages/common/src/store/buy-usdc/sagas.ts +++ b/packages/common/src/store/buy-usdc/sagas.ts @@ -5,11 +5,11 @@ import BN from 'bn.js' import { takeLatest } from 'redux-saga/effects' import { call, put, race, select, take, takeLeading } from 'typed-redux-saga' -import { Name } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' -import { PurchaseVendor } from 'models/PurchaseContent' -import { Status } from 'models/Status' -import { StringUSDC } from 'models/Wallet' +import { Name } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' +import { PurchaseVendor } from '~/models/PurchaseContent' +import { Status } from '~/models/Status' +import { StringUSDC } from '~/models/Wallet' import { createPaymentRouterRouteTransaction, createRootWalletRecoveryTransaction, @@ -20,20 +20,20 @@ import { getTokenAccountInfo, pollForTokenBalanceChange, relayTransaction -} from 'services/audius-backend/solana' -import { getAccountUser } from 'store/account/selectors' -import { getContext } from 'store/effects' -import { getFeePayer } from 'store/solana/selectors' +} from '~/services/audius-backend/solana' +import { getAccountUser } from '~/store/account/selectors' +import { getContext } from '~/store/effects' +import { getFeePayer } from '~/store/solana/selectors' import { transactionCanceled as coinflowTransactionCanceled, transactionFailed as coinflowTransactionFailed, transactionSucceeded as coinflowTransactionSucceeded -} from 'store/ui/coinflow-modal/slice' -import { coinflowOnrampModalActions } from 'store/ui/modals/coinflow-onramp-modal' -import { setVisibility } from 'store/ui/modals/parentSlice' -import { initializeStripeModal } from 'store/ui/stripe-modal/slice' -import { setUSDCBalance } from 'store/wallet/slice' -import { waitForValue } from 'utils' +} from '~/store/ui/coinflow-modal/slice' +import { coinflowOnrampModalActions } from '~/store/ui/modals/coinflow-onramp-modal' +import { setVisibility } from '~/store/ui/modals/parentSlice' +import { initializeStripeModal } from '~/store/ui/stripe-modal/slice' +import { setUSDCBalance } from '~/store/wallet/slice' +import { waitForValue } from '~/utils' import { buyUSDCFlowFailed, diff --git a/packages/common/src/store/buy-usdc/selectors.ts b/packages/common/src/store/buy-usdc/selectors.ts index a4826eb4072..8659815bf1e 100644 --- a/packages/common/src/store/buy-usdc/selectors.ts +++ b/packages/common/src/store/buy-usdc/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getBuyUSDCVendor = (state: CommonState) => state.buyUSDC.vendor diff --git a/packages/common/src/store/buy-usdc/slice.ts b/packages/common/src/store/buy-usdc/slice.ts index fd296957f99..57d86bf84f0 100644 --- a/packages/common/src/store/buy-usdc/slice.ts +++ b/packages/common/src/store/buy-usdc/slice.ts @@ -1,8 +1,8 @@ import { Action, createSlice, PayloadAction } from '@reduxjs/toolkit' -import { PurchaseVendor } from 'models/PurchaseContent' -import { Status } from 'models/Status' -import { StripeSessionCreationError } from 'store/ui/stripe-modal/types' +import { PurchaseVendor } from '~/models/PurchaseContent' +import { Status } from '~/models/Status' +import { StripeSessionCreationError } from '~/store/ui/stripe-modal/types' import { BuyUSDCStage, PurchaseInfo, BuyUSDCError } from './types' diff --git a/packages/common/src/store/buy-usdc/utils.ts b/packages/common/src/store/buy-usdc/utils.ts index 432b2a8e7f3..e458618e01e 100644 --- a/packages/common/src/store/buy-usdc/utils.ts +++ b/packages/common/src/store/buy-usdc/utils.ts @@ -1,16 +1,16 @@ import { call, select } from 'typed-redux-saga' -import { createUserBankIfNeeded } from 'services/audius-backend/solana' -import { IntKeys } from 'services/remote-config' +import { createUserBankIfNeeded } from '~/services/audius-backend/solana' +import { IntKeys } from '~/services/remote-config' import { MAX_CONTENT_PRICE_CENTS, MAX_USDC_PURCHASE_AMOUNT_CENTS, MIN_CONTENT_PRICE_CENTS, MIN_USDC_PURCHASE_AMOUNT_CENTS, BUY_TOKEN_VIA_SOL_SLIPPAGE_BPS -} from 'services/remote-config/defaults' -import { getContext } from 'store/effects' -import { getFeePayer } from 'store/solana/selectors' +} from '~/services/remote-config/defaults' +import { getContext } from '~/store/effects' +import { getFeePayer } from '~/store/solana/selectors' /** * Derives a USDC user bank for a given eth address, creating it if necessary. diff --git a/packages/common/src/store/cache/actions.ts b/packages/common/src/store/cache/actions.ts index 2824562c5ec..36af3ffbff3 100644 --- a/packages/common/src/store/cache/actions.ts +++ b/packages/common/src/store/cache/actions.ts @@ -1,6 +1,6 @@ -import { ID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { Status } from 'models/Status' +import { ID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { Status } from '~/models/Status' import { CacheType, diff --git a/packages/common/src/store/cache/collections/reducer.ts b/packages/common/src/store/cache/collections/reducer.ts index 3b5f6dab637..55e692b8d5f 100644 --- a/packages/common/src/store/cache/collections/reducer.ts +++ b/packages/common/src/store/cache/collections/reducer.ts @@ -1,4 +1,4 @@ -import { initialCacheState } from 'store/cache/reducer' +import { initialCacheState } from '~/store/cache/reducer' import { Collection, ID, Kind } from '../../../models' import { diff --git a/packages/common/src/store/cache/collections/selectors.ts b/packages/common/src/store/cache/collections/selectors.ts index df835914e9b..3a163fb4d04 100644 --- a/packages/common/src/store/cache/collections/selectors.ts +++ b/packages/common/src/store/cache/collections/selectors.ts @@ -1,13 +1,13 @@ -import { getAllEntries, getEntry } from 'store/cache/selectors' -import { getTrack, getTracks } from 'store/cache/tracks/selectors' +import { getAllEntries, getEntry } from '~/store/cache/selectors' +import { getTrack, getTracks } from '~/store/cache/tracks/selectors' import { getUser, getUser as getUserById, getUsers -} from 'store/cache/users/selectors' -import type { CommonState } from 'store/commonStore' -import { removeNullable } from 'utils/typeUtils' -import { Uid } from 'utils/uid' +} from '~/store/cache/users/selectors' +import type { CommonState } from '~/store/commonStore' +import { removeNullable } from '~/utils/typeUtils' +import { Uid } from '~/utils/uid' import type { ID, UID, Collection, User } from '../../../models' import { Status, Kind } from '../../../models' diff --git a/packages/common/src/store/cache/collections/utils/reformatCollection.ts b/packages/common/src/store/cache/collections/utils/reformatCollection.ts index 4fea1494d62..2fedd165c55 100644 --- a/packages/common/src/store/cache/collections/utils/reformatCollection.ts +++ b/packages/common/src/store/cache/collections/utils/reformatCollection.ts @@ -5,8 +5,8 @@ import { Variant, Collection, CollectionMetadata -} from 'models/Collection' -import type { AudiusBackend } from 'services/audius-backend/AudiusBackend' +} from '~/models/Collection' +import type { AudiusBackend } from '~/services/audius-backend/AudiusBackend' /** * Reformats a collection to be used internally within the client diff --git a/packages/common/src/store/cache/reducer.ts b/packages/common/src/store/cache/reducer.ts index 304bcb1dd70..39b40b5bd17 100644 --- a/packages/common/src/store/cache/reducer.ts +++ b/packages/common/src/store/cache/reducer.ts @@ -1,7 +1,7 @@ import { mergeWith, add, isEqual } from 'lodash' -import { ID, UID } from 'models/Identifiers' -import { Status } from 'models/Status' +import { ID, UID } from '~/models/Identifiers' +import { Status } from '~/models/Status' import { Kind } from '../../models/Kind' diff --git a/packages/common/src/store/cache/selectors.ts b/packages/common/src/store/cache/selectors.ts index 1d01b914e46..7948da80991 100644 --- a/packages/common/src/store/cache/selectors.ts +++ b/packages/common/src/store/cache/selectors.ts @@ -1,5 +1,5 @@ -import { CommonState } from 'store/commonStore' -import { Uid } from 'utils/uid' +import { CommonState } from '~/store/commonStore' +import { Uid } from '~/utils/uid' import { Collection } from '../../models/Collection' import { ID, UID } from '../../models/Identifiers' diff --git a/packages/common/src/store/cache/tracks/reducer.ts b/packages/common/src/store/cache/tracks/reducer.ts index 7b50bb9ead2..29f1ae7c4b4 100644 --- a/packages/common/src/store/cache/tracks/reducer.ts +++ b/packages/common/src/store/cache/tracks/reducer.ts @@ -1,13 +1,13 @@ import snakecaseKeys from 'snakecase-keys' -import { Cache } from 'models/Cache' -import { ID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { SsrPageProps } from 'models/SsrPageProps' -import { Track } from 'models/Track' -import { makeTrack } from 'services/audius-api-client/ResponseAdapter' -import { initialCacheState } from 'store/cache/reducer' -import { makeUid } from 'utils/uid' +import { Cache } from '~/models/Cache' +import { ID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { SsrPageProps } from '~/models/SsrPageProps' +import { Track } from '~/models/Track' +import { makeTrack } from '~/services/audius-api-client/ResponseAdapter' +import { initialCacheState } from '~/store/cache/reducer' +import { makeUid } from '~/utils/uid' import { AddEntriesAction, diff --git a/packages/common/src/store/cache/tracks/selectors.ts b/packages/common/src/store/cache/tracks/selectors.ts index 33476c02ae6..e702737cc96 100644 --- a/packages/common/src/store/cache/tracks/selectors.ts +++ b/packages/common/src/store/cache/tracks/selectors.ts @@ -1,5 +1,5 @@ -import { getEntry, getAllEntries } from 'store/cache/selectors' -import { CommonState } from 'store/commonStore' +import { getEntry, getAllEntries } from '~/store/cache/selectors' +import { CommonState } from '~/store/commonStore' import { Kind, ID, UID, Status, Track } from '../../../models' diff --git a/packages/common/src/store/cache/types.ts b/packages/common/src/store/cache/types.ts index 2fa3e605be7..6ce4c38dbd9 100644 --- a/packages/common/src/store/cache/types.ts +++ b/packages/common/src/store/cache/types.ts @@ -1,5 +1,5 @@ -import { ID, UID } from 'models/Identifiers' -import { Kind } from 'models/Kind' +import { ID, UID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' export type CacheType = 'normal' | 'fast' | 'safe-fast' diff --git a/packages/common/src/store/cache/users/actions.ts b/packages/common/src/store/cache/users/actions.ts index ef0c8c454fb..669ffab579a 100644 --- a/packages/common/src/store/cache/users/actions.ts +++ b/packages/common/src/store/cache/users/actions.ts @@ -1,4 +1,4 @@ -import { ID, SquareSizes, WidthSizes } from 'models' +import { ID, SquareSizes, WidthSizes } from '~/models' export const REMOVE_BY_HANDLE = 'CACHE/USERS/REMOVE_BY_HANDLE' diff --git a/packages/common/src/store/cache/users/combinedSelectors.ts b/packages/common/src/store/cache/users/combinedSelectors.ts index 33e2d6c44a0..7141410e4b2 100644 --- a/packages/common/src/store/cache/users/combinedSelectors.ts +++ b/packages/common/src/store/cache/users/combinedSelectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID, UID } from '../../../models' import { getCollection } from '../collections/selectors' diff --git a/packages/common/src/store/cache/users/reducer.ts b/packages/common/src/store/cache/users/reducer.ts index 178024627ee..38bff860935 100644 --- a/packages/common/src/store/cache/users/reducer.ts +++ b/packages/common/src/store/cache/users/reducer.ts @@ -1,13 +1,13 @@ import snakecaseKeys from 'snakecase-keys' -import { Cache } from 'models/Cache' -import { ID } from 'models/Identifiers' -import { Kind } from 'models/Kind' -import { SsrPageProps } from 'models/SsrPageProps' -import { User } from 'models/User' -import { makeUser } from 'services/audius-api-client/ResponseAdapter' -import { initialCacheState } from 'store/cache/reducer' -import { makeUid } from 'utils/uid' +import { Cache } from '~/models/Cache' +import { ID } from '~/models/Identifiers' +import { Kind } from '~/models/Kind' +import { SsrPageProps } from '~/models/SsrPageProps' +import { User } from '~/models/User' +import { makeUser } from '~/services/audius-api-client/ResponseAdapter' +import { initialCacheState } from '~/store/cache/reducer' +import { makeUid } from '~/utils/uid' import { AddEntriesAction, diff --git a/packages/common/src/store/cache/users/selectors.ts b/packages/common/src/store/cache/users/selectors.ts index e800a27fde6..b3f09ce25f7 100644 --- a/packages/common/src/store/cache/users/selectors.ts +++ b/packages/common/src/store/cache/users/selectors.ts @@ -2,8 +2,8 @@ import { getAllEntries, getEntry, getEntryTimestamp -} from 'store/cache/selectors' -import type { CommonState } from 'store/commonStore' +} from '~/store/cache/selectors' +import type { CommonState } from '~/store/commonStore' import { Kind } from '../../../models' import type { ID, UID, User } from '../../../models' diff --git a/packages/common/src/store/cache/users/utils.ts b/packages/common/src/store/cache/users/utils.ts index da34817410e..9e0f3ee7f50 100644 --- a/packages/common/src/store/cache/users/utils.ts +++ b/packages/common/src/store/cache/users/utils.ts @@ -1,12 +1,12 @@ import { put } from 'typed-redux-saga' -import { Kind } from 'models/Kind' -import { UserMetadata } from 'models/User' -import { AudiusBackend } from 'services/audius-backend' -import * as cacheActions from 'store/cache/actions' -import { getContext } from 'store/effects' -import { waitForRead } from 'utils/sagaHelpers' -import { makeUid } from 'utils/uid' +import { Kind } from '~/models/Kind' +import { UserMetadata } from '~/models/User' +import { AudiusBackend } from '~/services/audius-backend' +import * as cacheActions from '~/store/cache/actions' +import { getContext } from '~/store/effects' +import { waitForRead } from '~/utils/sagaHelpers' +import { makeUid } from '~/utils/uid' export function* processAndCacheUsers(users: UserMetadata[]) { yield* waitForRead() diff --git a/packages/common/src/store/cast/sagas.ts b/packages/common/src/store/cast/sagas.ts index 81250e892da..4b5c6a9481c 100644 --- a/packages/common/src/store/cast/sagas.ts +++ b/packages/common/src/store/cast/sagas.ts @@ -1,6 +1,6 @@ import { call, put, takeEvery } from 'typed-redux-saga' -import { getContext } from 'store/effects' +import { getContext } from '~/store/effects' import { updateMethod } from './slice' import { CastMethod, CAST_METHOD } from './types' diff --git a/packages/common/src/store/cast/selectors.ts b/packages/common/src/store/cast/selectors.ts index c56f7b9e311..8d22f2be783 100644 --- a/packages/common/src/store/cast/selectors.ts +++ b/packages/common/src/store/cast/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' const getBaseState = (state: CommonState) => state.cast diff --git a/packages/common/src/store/challenges/selectors/optimistic-challenges.ts b/packages/common/src/store/challenges/selectors/optimistic-challenges.ts index 8f75e8b9329..209945d93e8 100644 --- a/packages/common/src/store/challenges/selectors/optimistic-challenges.ts +++ b/packages/common/src/store/challenges/selectors/optimistic-challenges.ts @@ -2,10 +2,10 @@ import { getUndisbursedUserChallenges, getUserChallenges, getUserChallengesOverrides -} from 'store/pages/audio-rewards/selectors' -import { UndisbursedUserChallenge } from 'store/pages/audio-rewards/types' -import { isCooldownChallengeClaimable } from 'utils/challenges' -import { removeNullable } from 'utils/typeUtils' +} from '~/store/pages/audio-rewards/selectors' +import { UndisbursedUserChallenge } from '~/store/pages/audio-rewards/types' +import { isCooldownChallengeClaimable } from '~/utils/challenges' +import { removeNullable } from '~/utils/typeUtils' import { ChallengeRewardID, diff --git a/packages/common/src/store/challenges/selectors/profile-progress.ts b/packages/common/src/store/challenges/selectors/profile-progress.ts index 113e2d1ac29..d0756032d7b 100644 --- a/packages/common/src/store/challenges/selectors/profile-progress.ts +++ b/packages/common/src/store/challenges/selectors/profile-progress.ts @@ -1,5 +1,5 @@ -import { getAccountUser } from 'store/account/selectors' -import { getProfileUserHandle } from 'store/pages/profile/selectors' +import { getAccountUser } from '~/store/account/selectors' +import { getProfileUserHandle } from '~/store/pages/profile/selectors' import { Status } from '../../../models/Status' import { CommonState } from '../../commonStore' diff --git a/packages/common/src/store/change-password/selectors.ts b/packages/common/src/store/change-password/selectors.ts index eef2b9aa347..715f467497c 100644 --- a/packages/common/src/store/change-password/selectors.ts +++ b/packages/common/src/store/change-password/selectors.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit' -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' const changePasswordState = (state: CommonState) => state.ui.changePassword diff --git a/packages/common/src/store/collectibles/selectors.ts b/packages/common/src/store/collectibles/selectors.ts index 00dc6915079..491f9395322 100644 --- a/packages/common/src/store/collectibles/selectors.ts +++ b/packages/common/src/store/collectibles/selectors.ts @@ -1,6 +1,6 @@ import { createSelector } from 'reselect' -import { removeNullable } from 'utils/typeUtils' +import { removeNullable } from '~/utils/typeUtils' import { Chain, diff --git a/packages/common/src/store/confirmer/sagas.ts b/packages/common/src/store/confirmer/sagas.ts index 001bf1d12c5..f6dbd7cd0b5 100644 --- a/packages/common/src/store/confirmer/sagas.ts +++ b/packages/common/src/store/confirmer/sagas.ts @@ -1,7 +1,7 @@ import { call, delay, put, race, select, takeEvery } from 'redux-saga/effects' -import { getContext } from 'store/effects' -import { waitForValue } from 'utils/sagaHelpers' +import { getContext } from '~/store/effects' +import { waitForValue } from '~/utils/sagaHelpers' import * as confirmerActions from './actions' import { diff --git a/packages/common/src/store/confirmer/selectors.ts b/packages/common/src/store/confirmer/selectors.ts index 1b030b38196..8b8ae14b9ea 100644 --- a/packages/common/src/store/confirmer/selectors.ts +++ b/packages/common/src/store/confirmer/selectors.ts @@ -1,6 +1,6 @@ import { findLastIndex } from 'lodash' -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' // Confirmer selectors diff --git a/packages/common/src/store/gated-content/sagas.ts b/packages/common/src/store/gated-content/sagas.ts index 88434cf86ae..ddd6f929e15 100644 --- a/packages/common/src/store/gated-content/sagas.ts +++ b/packages/common/src/store/gated-content/sagas.ts @@ -21,17 +21,17 @@ import { isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated -} from 'models' -import { User } from 'models/User' -import { IntKeys } from 'services/remote-config' -import { accountSelectors } from 'store/account' -import { cacheActions, cacheTracksSelectors } from 'store/cache' -import { collectiblesActions } from 'store/collectibles' -import { getContext } from 'store/effects' -import { musicConfettiActions } from 'store/music-confetti' -import { usersSocialActions } from 'store/social' -import { tippingActions } from 'store/tipping' -import { Nullable } from 'utils/typeUtils' +} from '~/models' +import { User } from '~/models/User' +import { IntKeys } from '~/services/remote-config' +import { accountSelectors } from '~/store/account' +import { cacheActions, cacheTracksSelectors } from '~/store/cache' +import { collectiblesActions } from '~/store/collectibles' +import { getContext } from '~/store/effects' +import { musicConfettiActions } from '~/store/music-confetti' +import { usersSocialActions } from '~/store/social' +import { tippingActions } from '~/store/tipping' +import { Nullable } from '~/utils/typeUtils' import * as gatedContentSelectors from './selectors' import { actions as gatedContentActions } from './slice' diff --git a/packages/common/src/store/gated-content/slice.ts b/packages/common/src/store/gated-content/slice.ts index 3dad2749684..aded50a4d21 100644 --- a/packages/common/src/store/gated-content/slice.ts +++ b/packages/common/src/store/gated-content/slice.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { ID, AccessSignature, GatedTrackStatus } from 'models' -import { Nullable } from 'utils' +import { ID, AccessSignature, GatedTrackStatus } from '~/models' +import { Nullable } from '~/utils' type GatedContentState = { nftAccessSignatureMap: { [id: ID]: Nullable } diff --git a/packages/common/src/store/lineup/actions.ts b/packages/common/src/store/lineup/actions.ts index 93439fa4401..23212438c57 100644 --- a/packages/common/src/store/lineup/actions.ts +++ b/packages/common/src/store/lineup/actions.ts @@ -1,4 +1,4 @@ -import { Collection, LineupEntry, PlaybackSource } from 'models' +import { Collection, LineupEntry, PlaybackSource } from '~/models' import { ID, UID } from '../../models/Identifiers' import { Track, TrackMetadata } from '../../models/Track' diff --git a/packages/common/src/store/lineup/reducer.ts b/packages/common/src/store/lineup/reducer.ts index e89b0e95a6b..e169f4c0ca0 100644 --- a/packages/common/src/store/lineup/reducer.ts +++ b/packages/common/src/store/lineup/reducer.ts @@ -1,6 +1,6 @@ import { Reducer } from 'redux' -import { Status } from 'models/Status' +import { Status } from '~/models/Status' import { FETCH_LINEUP_METADATAS_REQUESTED, FETCH_LINEUP_METADATAS_SUCCEEDED, @@ -12,7 +12,7 @@ import { UPDATE_LINEUP_ORDER, SET_PAGE, stripPrefix -} from 'store/lineup/actions' +} from '~/store/lineup/actions' import { UID } from '../../models/Identifiers' import { LineupState, LineupEntry, Order } from '../../models/Lineup' diff --git a/packages/common/src/store/lineup/registry.ts b/packages/common/src/store/lineup/registry.ts index b62b2daca12..7b1f01ac9bb 100644 --- a/packages/common/src/store/lineup/registry.ts +++ b/packages/common/src/store/lineup/registry.ts @@ -1,4 +1,4 @@ -import { LineupState } from 'models/Lineup' +import { LineupState } from '~/models/Lineup' import { aiPageLineupActions, aiPageSelectors, @@ -25,7 +25,7 @@ import { trendingPlaylistsPageLineupSelectors, trendingUndergroundPageLineupActions, trendingUndergroundPageLineupSelectors -} from 'store/pages' +} from '~/store/pages' import { CommonState } from '..' diff --git a/packages/common/src/store/lineup/selectors.ts b/packages/common/src/store/lineup/selectors.ts index 1f7bb63d0b0..ad55aa6f874 100644 --- a/packages/common/src/store/lineup/selectors.ts +++ b/packages/common/src/store/lineup/selectors.ts @@ -1,9 +1,9 @@ import { createSelector } from 'reselect' -import { Kind } from 'models' -import { getTracksByUid } from 'store/cache/tracks/selectors' -import { getUsers } from 'store/cache/users/selectors' -import { Nullable, removeNullable } from 'utils/typeUtils' +import { Kind } from '~/models' +import { getTracksByUid } from '~/store/cache/tracks/selectors' +import { getUsers } from '~/store/cache/users/selectors' +import { Nullable, removeNullable } from '~/utils/typeUtils' import { LineupState } from '../../models/Lineup' diff --git a/packages/common/src/store/notifications/selectors.ts b/packages/common/src/store/notifications/selectors.ts index 775f26f5e54..84c1d342ea0 100644 --- a/packages/common/src/store/notifications/selectors.ts +++ b/packages/common/src/store/notifications/selectors.ts @@ -1,12 +1,12 @@ -import { getAccountUser } from 'store/account/selectors' +import { getAccountUser } from '~/store/account/selectors' import { getCollection, getCollections -} from 'store/cache/collections/selectors' -import { getTrack, getTracks } from 'store/cache/tracks/selectors' -import { getUser, getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { Nullable } from 'utils' +} from '~/store/cache/collections/selectors' +import { getTrack, getTracks } from '~/store/cache/tracks/selectors' +import { getUser, getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { Nullable } from '~/utils' import { Collection, ID, Status, Track } from '../../models' diff --git a/packages/common/src/store/notifications/slice.ts b/packages/common/src/store/notifications/slice.ts index 55c4f079cc1..d74b974950f 100644 --- a/packages/common/src/store/notifications/slice.ts +++ b/packages/common/src/store/notifications/slice.ts @@ -1,7 +1,7 @@ import { createEntityAdapter, createSlice } from '@reduxjs/toolkit' -import { Status } from 'models/Status' -import { signOut } from 'store/sign-out/slice' +import { Status } from '~/models/Status' +import { signOut } from '~/store/sign-out/slice' import { AddNotificationsAction, diff --git a/packages/common/src/store/notifications/types.ts b/packages/common/src/store/notifications/types.ts index cf4eb660f2e..91aa62ab3a7 100644 --- a/packages/common/src/store/notifications/types.ts +++ b/packages/common/src/store/notifications/types.ts @@ -1,14 +1,14 @@ import { EntityState, PayloadAction } from '@reduxjs/toolkit' -import { ChallengeRewardID } from 'models/AudioRewards' -import { BadgeTier } from 'models/BadgeTier' -import { Collection } from 'models/Collection' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' -import { Track } from 'models/Track' -import { User } from 'models/User' -import { StringUSDC, StringWei } from 'models/Wallet' -import { Nullable } from 'utils' +import { ChallengeRewardID } from '~/models/AudioRewards' +import { BadgeTier } from '~/models/BadgeTier' +import { Collection } from '~/models/Collection' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' +import { Track } from '~/models/Track' +import { User } from '~/models/User' +import { StringUSDC, StringWei } from '~/models/Wallet' +import { Nullable } from '~/utils' export enum NotificationType { Announcement = 'Announcement', diff --git a/packages/common/src/store/pages/ai/lineup/reducer.ts b/packages/common/src/store/pages/ai/lineup/reducer.ts index 54af1727784..d28d9dfd72e 100644 --- a/packages/common/src/store/pages/ai/lineup/reducer.ts +++ b/packages/common/src/store/pages/ai/lineup/reducer.ts @@ -1,5 +1,5 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' import { PREFIX } from './actions' diff --git a/packages/common/src/store/pages/ai/selectors.ts b/packages/common/src/store/pages/ai/selectors.ts index 9ca3a97d54b..f0cbe358dab 100644 --- a/packages/common/src/store/pages/ai/selectors.ts +++ b/packages/common/src/store/pages/ai/selectors.ts @@ -1,5 +1,5 @@ -import { getUser } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' +import { getUser } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' export const getBaseState = (state: CommonState) => state.pages.ai diff --git a/packages/common/src/store/pages/ai/slice.ts b/packages/common/src/store/pages/ai/slice.ts index 9ae6207a3c4..f609366d466 100644 --- a/packages/common/src/store/pages/ai/slice.ts +++ b/packages/common/src/store/pages/ai/slice.ts @@ -1,8 +1,8 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { combineReducers } from 'redux' -import { Status } from 'models/Status' -import { asLineup } from 'store/lineup/reducer' +import { Status } from '~/models/Status' +import { asLineup } from '~/store/lineup/reducer' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/pages/chat/middleware.ts b/packages/common/src/store/pages/chat/middleware.ts index abfd0ba2dd6..2a7ab398ae0 100644 --- a/packages/common/src/store/pages/chat/middleware.ts +++ b/packages/common/src/store/pages/chat/middleware.ts @@ -1,9 +1,9 @@ import { type AudiusSdk, ChatEvents } from '@audius/sdk' import { Middleware } from 'redux' -import { Status } from 'models/Status' -import { getUserId } from 'store/account/selectors' -import { encodeHashId } from 'utils/hashIds' +import { Status } from '~/models/Status' +import { getUserId } from '~/store/account/selectors' +import { encodeHashId } from '~/utils/hashIds' import { actions as chatActions } from './slice' import { ChatWebsocketError } from './types' diff --git a/packages/common/src/store/pages/chat/sagas.ts b/packages/common/src/store/pages/chat/sagas.ts index 93cfe951c82..22167e3651a 100644 --- a/packages/common/src/store/pages/chat/sagas.ts +++ b/packages/common/src/store/pages/chat/sagas.ts @@ -14,13 +14,13 @@ import { } from 'typed-redux-saga' import { ulid } from 'ulid' -import { Name } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' -import * as toastActions from 'src/store/ui/toast/slice' -import { getAccountUser, getUserId } from 'store/account/selectors' -import dayjs from 'utils/dayjs' +import { Name } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' +import { getAccountUser, getUserId } from '~/store/account/selectors' +import * as toastActions from '~/store/ui/toast/slice' +import dayjs from '~/utils/dayjs' import { decodeHashId, encodeHashId, removeNullable } from '../../../utils' import { cacheUsersActions } from '../../cache' diff --git a/packages/common/src/store/pages/chat/selectors.ts b/packages/common/src/store/pages/chat/selectors.ts index e0e683142af..5de3d91b592 100644 --- a/packages/common/src/store/pages/chat/selectors.ts +++ b/packages/common/src/store/pages/chat/selectors.ts @@ -1,14 +1,14 @@ import { ChatPermission, UserChat } from '@audius/sdk' import { createSelector } from 'reselect' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' -import { User } from 'models/User' -import { accountSelectors } from 'store/account' -import { cacheUsersSelectors } from 'store/cache' -import { CommonState } from 'store/reducers' -import { decodeHashId, encodeHashId } from 'utils/hashIds' -import { Maybe, removeNullable } from 'utils/typeUtils' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' +import { User } from '~/models/User' +import { accountSelectors } from '~/store/account' +import { cacheUsersSelectors } from '~/store/cache' +import { CommonState } from '~/store/reducers' +import { decodeHashId, encodeHashId } from '~/utils/hashIds' +import { Maybe, removeNullable } from '~/utils/typeUtils' import { chatMessagesAdapter, chatsAdapter } from './slice' import { ChatPermissionAction } from './types' diff --git a/packages/common/src/store/pages/chat/slice.ts b/packages/common/src/store/pages/chat/slice.ts index fcbcaa9b86a..a5aca394787 100644 --- a/packages/common/src/store/pages/chat/slice.ts +++ b/packages/common/src/store/pages/chat/slice.ts @@ -15,11 +15,11 @@ import { EntityState } from '@reduxjs/toolkit' -import { ID, Status, ChatMessageWithExtras } from 'models' -import { signOut } from 'store/sign-out/slice' -import { hasTail } from 'utils/chatUtils' -import dayjs from 'utils/dayjs' -import { encodeHashId } from 'utils/hashIds' +import { ID, Status, ChatMessageWithExtras } from '~/models' +import { signOut } from '~/store/sign-out/slice' +import { hasTail } from '~/utils/chatUtils' +import dayjs from '~/utils/dayjs' +import { encodeHashId } from '~/utils/hashIds' import { ChatWebsocketError } from './types' diff --git a/packages/common/src/store/pages/chat/utils.ts b/packages/common/src/store/pages/chat/utils.ts index 0ceddb4eb85..38bcf7e46c7 100644 --- a/packages/common/src/store/pages/chat/utils.ts +++ b/packages/common/src/store/pages/chat/utils.ts @@ -1,5 +1,5 @@ -import { ID } from 'models/Identifiers' -import { encodeHashId } from 'utils/hashIds' +import { ID } from '~/models/Identifiers' +import { encodeHashId } from '~/utils/hashIds' export const makeChatId = (userIds: ID[]) => { return userIds.map(encodeHashId).sort().join(':') diff --git a/packages/common/src/store/pages/collection/lineup/reducer.ts b/packages/common/src/store/pages/collection/lineup/reducer.ts index 8ced0e500ba..0b28bf5f08c 100644 --- a/packages/common/src/store/pages/collection/lineup/reducer.ts +++ b/packages/common/src/store/pages/collection/lineup/reducer.ts @@ -1,8 +1,8 @@ -import { Collection } from 'models/Collection' -import { LineupState } from 'models/Lineup' -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/collection/lineup/actions' +import { Collection } from '~/models/Collection' +import { LineupState } from '~/models/Lineup' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/collection/lineup/actions' export const initialState = { ...initialLineupState, diff --git a/packages/common/src/store/pages/collection/reducer.ts b/packages/common/src/store/pages/collection/reducer.ts index 6285067f8e2..8d9e211d5f6 100644 --- a/packages/common/src/store/pages/collection/reducer.ts +++ b/packages/common/src/store/pages/collection/reducer.ts @@ -1,7 +1,7 @@ -import { Collection } from 'models/Collection' +import { Collection } from '~/models/Collection' import tracksReducer, { initialState as initialLineupState -} from 'store/pages/collection/lineup/reducer' +} from '~/store/pages/collection/lineup/reducer' import { Status } from '../../../models/Status' import { LineupActions, asLineup } from '../../../store/lineup/reducer' diff --git a/packages/common/src/store/pages/collection/selectors.ts b/packages/common/src/store/pages/collection/selectors.ts index a023c6aba55..df83bb0ec74 100644 --- a/packages/common/src/store/pages/collection/selectors.ts +++ b/packages/common/src/store/pages/collection/selectors.ts @@ -1,10 +1,10 @@ import { createSelector } from 'reselect' -import { getCollection as getCachedCollection } from 'store/cache/collections/selectors' -import { getUser as getCachedUser } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { getCollection as getSmartCollection } from 'store/pages/smart-collection/selectors' -import { Nullable } from 'utils/typeUtils' +import { getCollection as getCachedCollection } from '~/store/cache/collections/selectors' +import { getUser as getCachedUser } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { getCollection as getSmartCollection } from '~/store/pages/smart-collection/selectors' +import { Nullable } from '~/utils/typeUtils' import { ID, UID, Status } from '../../../models' diff --git a/packages/common/src/store/pages/collection/types.ts b/packages/common/src/store/pages/collection/types.ts index cb2818cbc52..8234c954463 100644 --- a/packages/common/src/store/pages/collection/types.ts +++ b/packages/common/src/store/pages/collection/types.ts @@ -6,8 +6,8 @@ import { SmartCollectionVariant, Status, LineupTrack -} from 'models' -import type { Dayjs } from 'utils/dayjs' +} from '~/models' +import type { Dayjs } from '~/utils/dayjs' export type CollectionTrack = LineupTrack & { dateAdded: Dayjs } & { collectible?: Collectible diff --git a/packages/common/src/store/pages/deactivate-account/index.ts b/packages/common/src/store/pages/deactivate-account/index.ts index eccc917e6d5..9b28b827a50 100644 --- a/packages/common/src/store/pages/deactivate-account/index.ts +++ b/packages/common/src/store/pages/deactivate-account/index.ts @@ -1,7 +1,7 @@ export { default as deactivateAccountReducer, - actions as deactivateAccountActions, - DeactivateAccountState + actions as deactivateAccountActions } from './slice' +export type { DeactivateAccountState } from './slice' export * as deactivateAccountSelectors from './selectors' diff --git a/packages/common/src/store/pages/explore/exploreCollections/selectors.ts b/packages/common/src/store/pages/explore/exploreCollections/selectors.ts index f72f31b62cb..f41c6fa42c1 100644 --- a/packages/common/src/store/pages/explore/exploreCollections/selectors.ts +++ b/packages/common/src/store/pages/explore/exploreCollections/selectors.ts @@ -1,6 +1,6 @@ -import { getCollections as getCachedCollections } from 'store/cache/collections/selectors' -import { getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' +import { getCollections as getCachedCollections } from '~/store/cache/collections/selectors' +import { getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' import { Collection, Status } from '../../../../models' import { ExploreCollectionsVariant } from '../types' diff --git a/packages/common/src/store/pages/explore/selectors.ts b/packages/common/src/store/pages/explore/selectors.ts index 6871d2eb69e..f649e74be29 100644 --- a/packages/common/src/store/pages/explore/selectors.ts +++ b/packages/common/src/store/pages/explore/selectors.ts @@ -1,8 +1,8 @@ import { createSelector } from 'reselect' -import { getCollections } from 'store/cache/collections/selectors' -import { getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' +import { getCollections } from '~/store/cache/collections/selectors' +import { getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' import { UserCollection, Status, User } from '../../../models' import { removeNullable } from '../../../utils' diff --git a/packages/common/src/store/pages/feed/actions.ts b/packages/common/src/store/pages/feed/actions.ts index 114447429fc..81ac0f12926 100644 --- a/packages/common/src/store/pages/feed/actions.ts +++ b/packages/common/src/store/pages/feed/actions.ts @@ -1,5 +1,5 @@ -import { FeedFilter } from 'models/FeedFilter' -import { ID } from 'models/Identifiers' +import { FeedFilter } from '~/models/FeedFilter' +import { ID } from '~/models/Identifiers' export const FETCH_SUGGESTED_FOLLOW_USERS = 'FEED/FETCH_SUGGESTED_FOLLOW_USERS' export const FOLLOW_USERS = 'FEED/FOLLOW_USERS' diff --git a/packages/common/src/store/pages/feed/lineup/reducer.ts b/packages/common/src/store/pages/feed/lineup/reducer.ts index 52582c029b9..7f52c660dc5 100644 --- a/packages/common/src/store/pages/feed/lineup/reducer.ts +++ b/packages/common/src/store/pages/feed/lineup/reducer.ts @@ -1,8 +1,8 @@ -import { LineupState } from 'models/Lineup' -import { Track } from 'models/Track' -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/feed/lineup/actions' +import { LineupState } from '~/models/Lineup' +import { Track } from '~/models/Track' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/feed/lineup/actions' export const initialState = { ...initialLineupState, diff --git a/packages/common/src/store/pages/feed/reducer.ts b/packages/common/src/store/pages/feed/reducer.ts index ae6ed5c45f8..343d966ca80 100644 --- a/packages/common/src/store/pages/feed/reducer.ts +++ b/packages/common/src/store/pages/feed/reducer.ts @@ -1,15 +1,15 @@ -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import { SET_SUGGESTED_FOLLOWS, SET_FEED_FILTER, SetSuggestedFollowsAction, SetFeedFilterAction, FeedPageAction -} from 'store/pages/feed/actions' -import { PREFIX as FeedPrefix } from 'store/pages/feed/lineup/actions' +} from '~/store/pages/feed/actions' +import { PREFIX as FeedPrefix } from '~/store/pages/feed/lineup/actions' import feedReducer, { initialState as feedLinupInitialState -} from 'store/pages/feed/lineup/reducer' +} from '~/store/pages/feed/lineup/reducer' import { FeedFilter, Track } from '../../../models' diff --git a/packages/common/src/store/pages/feed/selectors.ts b/packages/common/src/store/pages/feed/selectors.ts index d55648f78a5..a7af94dcb88 100644 --- a/packages/common/src/store/pages/feed/selectors.ts +++ b/packages/common/src/store/pages/feed/selectors.ts @@ -1,6 +1,6 @@ -import { getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { createShallowSelector } from 'utils/selectorHelpers' +import { getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { createShallowSelector } from '~/utils/selectorHelpers' export const getSuggestedFollows = (state: CommonState) => state.pages.feed.suggestedFollows diff --git a/packages/common/src/store/pages/history-page/lineups/tracks/reducer.ts b/packages/common/src/store/pages/history-page/lineups/tracks/reducer.ts index 31679446c25..39cd61e476a 100644 --- a/packages/common/src/store/pages/history-page/lineups/tracks/reducer.ts +++ b/packages/common/src/store/pages/history-page/lineups/tracks/reducer.ts @@ -1,7 +1,7 @@ -import { LineupState } from 'models/Lineup' -import { Track } from 'models/Track' -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' +import { LineupState } from '~/models/Lineup' +import { Track } from '~/models/Track' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' import { PREFIX } from './actions' diff --git a/packages/common/src/store/pages/history-page/reducer.ts b/packages/common/src/store/pages/history-page/reducer.ts index e7c94f97b5d..c9d8e0008bc 100644 --- a/packages/common/src/store/pages/history-page/reducer.ts +++ b/packages/common/src/store/pages/history-page/reducer.ts @@ -1,5 +1,5 @@ -import { Track } from 'models/Track' -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { Track } from '~/models/Track' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import { PREFIX as tracksPrefix } from './lineups/tracks/actions' import tracksReducer, { diff --git a/packages/common/src/store/pages/history-page/selectors.ts b/packages/common/src/store/pages/history-page/selectors.ts index 563d1cd70b6..674a1e58b0b 100644 --- a/packages/common/src/store/pages/history-page/selectors.ts +++ b/packages/common/src/store/pages/history-page/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getHistory = (state: CommonState) => state.pages.historyPage export const getHistoryTracksLineup = (state: CommonState) => diff --git a/packages/common/src/store/pages/index.ts b/packages/common/src/store/pages/index.ts index 1e1ebbb9dc0..0bcf66812e1 100644 --- a/packages/common/src/store/pages/index.ts +++ b/packages/common/src/store/pages/index.ts @@ -25,7 +25,7 @@ export * as trackPageLineupActions from './track/lineup/actions' export { default as trackPageReducer } from './track/reducer' export * as trackPageActions from './track/actions' export * as trackPageSelectors from './track/selectors' -export { TrackPageState } from './track/types' +export type { TrackPageState } from './track/types' export * as tokenDashboardPageSelectors from './token-dashboard/selectors' export * from './token-dashboard/types' @@ -80,11 +80,8 @@ export { initialState as aiPageLineupInitialState } from './ai/lineup/reducer' export { tracksActions as aiPageLineupActions } from './ai/lineup/actions' -export { - default as aiPageReducer, - actions as aiPageActions, - FetchAiUserAction -} from './ai/slice' +export { default as aiPageReducer, actions as aiPageActions } from './ai/slice' +export type { FetchAiUserAction } from './ai/slice' export * as aiPageSelectors from './ai/selectors' export { default as profilePageFeedLineupReducer } from './profile/lineups/feed/reducer' diff --git a/packages/common/src/store/pages/premium-tracks/lineup/reducer.ts b/packages/common/src/store/pages/premium-tracks/lineup/reducer.ts index 2f90dfe3f64..8a146b04871 100644 --- a/packages/common/src/store/pages/premium-tracks/lineup/reducer.ts +++ b/packages/common/src/store/pages/premium-tracks/lineup/reducer.ts @@ -1,5 +1,5 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' import { Track, LineupState } from '../../../../models' diff --git a/packages/common/src/store/pages/premium-tracks/lineup/selectors.ts b/packages/common/src/store/pages/premium-tracks/lineup/selectors.ts index 7bec53c8077..6cabcc48788 100644 --- a/packages/common/src/store/pages/premium-tracks/lineup/selectors.ts +++ b/packages/common/src/store/pages/premium-tracks/lineup/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getLineup = (state: CommonState) => state.pages.premiumTracks.tracks diff --git a/packages/common/src/store/pages/premium-tracks/slice.ts b/packages/common/src/store/pages/premium-tracks/slice.ts index 0f401ebc188..43a712b5593 100644 --- a/packages/common/src/store/pages/premium-tracks/slice.ts +++ b/packages/common/src/store/pages/premium-tracks/slice.ts @@ -1,6 +1,6 @@ import { combineReducers, createSlice } from '@reduxjs/toolkit' -import { asLineup } from 'store/lineup/reducer' +import { asLineup } from '~/store/lineup/reducer' import { PREFIX } from './lineup/actions' import premiumTracksReducer, { diff --git a/packages/common/src/store/pages/profile/actions.ts b/packages/common/src/store/pages/profile/actions.ts index 1757c16c9fe..b4addc04edc 100644 --- a/packages/common/src/store/pages/profile/actions.ts +++ b/packages/common/src/store/pages/profile/actions.ts @@ -1,4 +1,4 @@ -import { Nullable } from 'utils' +import { Nullable } from '~/utils' import { ID, UID, UserMetadata } from '../../../models' diff --git a/packages/common/src/store/pages/profile/lineups/feed/reducer.ts b/packages/common/src/store/pages/profile/lineups/feed/reducer.ts index d25a735f810..d3752f3e6d7 100644 --- a/packages/common/src/store/pages/profile/lineups/feed/reducer.ts +++ b/packages/common/src/store/pages/profile/lineups/feed/reducer.ts @@ -1,6 +1,6 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/profile/lineups/feed/actions' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/profile/lineups/feed/actions' import { Collection, LineupState, Track } from '../../../../../models' diff --git a/packages/common/src/store/pages/profile/lineups/tracks/reducer.ts b/packages/common/src/store/pages/profile/lineups/tracks/reducer.ts index 68c677c0c1b..d7bc9a0e6f5 100644 --- a/packages/common/src/store/pages/profile/lineups/tracks/reducer.ts +++ b/packages/common/src/store/pages/profile/lineups/tracks/reducer.ts @@ -1,8 +1,8 @@ -import { LineupState } from 'models/Lineup' -import { Track } from 'models/Track' -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/profile/lineups/tracks/actions' +import { LineupState } from '~/models/Lineup' +import { Track } from '~/models/Track' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/profile/lineups/tracks/actions' export const initialState = { ...initialLineupState, diff --git a/packages/common/src/store/pages/profile/reducer.ts b/packages/common/src/store/pages/profile/reducer.ts index 5a3ddab531f..3215b68272c 100644 --- a/packages/common/src/store/pages/profile/reducer.ts +++ b/packages/common/src/store/pages/profile/reducer.ts @@ -1,10 +1,10 @@ -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import feedReducer, { initialState as initialFeedLineupState -} from 'store/pages/profile/lineups/feed/reducer' +} from '~/store/pages/profile/lineups/feed/reducer' import tracksReducer, { initialState as initialTracksLineupState -} from 'store/pages/profile/lineups/tracks/reducer' +} from '~/store/pages/profile/lineups/tracks/reducer' import { Collection, Status, Track } from '../../../models' diff --git a/packages/common/src/store/pages/profile/selectors.ts b/packages/common/src/store/pages/profile/selectors.ts index 802ed29fb56..e9d7859379c 100644 --- a/packages/common/src/store/pages/profile/selectors.ts +++ b/packages/common/src/store/pages/profile/selectors.ts @@ -1,9 +1,9 @@ import { uniq } from 'lodash' -import { getCollections } from 'store/cache/collections/selectors' -import { getUser, getUsers } from 'store/cache/users/selectors' -import type { CommonState } from 'store/commonStore' -import { removeNullable, createDeepEqualSelector, dayjs } from 'utils' +import { getCollections } from '~/store/cache/collections/selectors' +import { getUser, getUsers } from '~/store/cache/users/selectors' +import type { CommonState } from '~/store/commonStore' +import { removeNullable, createDeepEqualSelector, dayjs } from '~/utils' import { Status } from '../../../models' import type { Collection, ID, User, UserCollection } from '../../../models' diff --git a/packages/common/src/store/pages/remixes/lineup/reducer.ts b/packages/common/src/store/pages/remixes/lineup/reducer.ts index 67f1cc37d70..393e5357190 100644 --- a/packages/common/src/store/pages/remixes/lineup/reducer.ts +++ b/packages/common/src/store/pages/remixes/lineup/reducer.ts @@ -1,6 +1,6 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/remixes/lineup/actions' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/remixes/lineup/actions' export const initialState = { ...initialLineupState, diff --git a/packages/common/src/store/pages/remixes/selectors.ts b/packages/common/src/store/pages/remixes/selectors.ts index 119ef2e85d1..8ccdf575ea5 100644 --- a/packages/common/src/store/pages/remixes/selectors.ts +++ b/packages/common/src/store/pages/remixes/selectors.ts @@ -1,6 +1,6 @@ -import { getTrack as getCachedTrack } from 'store/cache/tracks/selectors' -import { getUserFromTrack } from 'store/cache/users/combinedSelectors' -import { CommonState } from 'store/commonStore' +import { getTrack as getCachedTrack } from '~/store/cache/tracks/selectors' +import { getUserFromTrack } from '~/store/cache/users/combinedSelectors' +import { CommonState } from '~/store/commonStore' export const getBaseState = (state: CommonState) => state.pages.remixes diff --git a/packages/common/src/store/pages/remixes/slice.ts b/packages/common/src/store/pages/remixes/slice.ts index 15f1d932897..6dac3912cad 100644 --- a/packages/common/src/store/pages/remixes/slice.ts +++ b/packages/common/src/store/pages/remixes/slice.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { combineReducers } from 'redux' -import { asLineup } from 'store/lineup/reducer' +import { asLineup } from '~/store/lineup/reducer' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/pages/saved-page/actions.ts b/packages/common/src/store/pages/saved-page/actions.ts index f5d2380e662..60363faaa26 100644 --- a/packages/common/src/store/pages/saved-page/actions.ts +++ b/packages/common/src/store/pages/saved-page/actions.ts @@ -1,4 +1,4 @@ -import { Favorite } from 'models/Favorite' +import { Favorite } from '~/models/Favorite' import { LibraryCategory, LibraryCategoryType, SavedPageTabs } from './types' diff --git a/packages/common/src/store/pages/saved-page/lineups/tracks/reducer.ts b/packages/common/src/store/pages/saved-page/lineups/tracks/reducer.ts index 682cabf6086..f2beae6a770 100644 --- a/packages/common/src/store/pages/saved-page/lineups/tracks/reducer.ts +++ b/packages/common/src/store/pages/saved-page/lineups/tracks/reducer.ts @@ -1,8 +1,8 @@ -import { LineupState } from 'models/Lineup' -import { Track } from 'models/Track' -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/saved-page/lineups/tracks/actions' +import { LineupState } from '~/models/Lineup' +import { Track } from '~/models/Track' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/saved-page/lineups/tracks/actions' export const initialState = { ...initialLineupState, diff --git a/packages/common/src/store/pages/saved-page/reducer.ts b/packages/common/src/store/pages/saved-page/reducer.ts index 5ffb63ee0b9..c2dcd487cdc 100644 --- a/packages/common/src/store/pages/saved-page/reducer.ts +++ b/packages/common/src/store/pages/saved-page/reducer.ts @@ -1,7 +1,7 @@ import { Storage, persistReducer } from 'redux-persist' -import { ID } from 'models/Identifiers' -import { asLineup } from 'store/lineup/reducer' +import { ID } from '~/models/Identifiers' +import { asLineup } from '~/store/lineup/reducer' import { ADD_LOCAL_COLLECTION, ADD_LOCAL_TRACK, @@ -16,12 +16,12 @@ import { REMOVE_LOCAL_COLLECTION, REMOVE_LOCAL_TRACK, SET_SELECTED_CATEGORY -} from 'store/pages/saved-page/actions' +} from '~/store/pages/saved-page/actions' import tracksReducer, { initialState as initialLineupState -} from 'store/pages/saved-page/lineups/tracks/reducer' -import { signOut } from 'store/sign-out/slice' -import { ActionsMap } from 'utils/reducer' +} from '~/store/pages/saved-page/lineups/tracks/reducer' +import { signOut } from '~/store/sign-out/slice' +import { ActionsMap } from '~/utils/reducer' import { PREFIX as tracksPrefix } from './lineups/tracks/actions' import { LibraryCategory, LibraryCategoryType, SavedPageState } from './types' diff --git a/packages/common/src/store/pages/saved-page/selectors.ts b/packages/common/src/store/pages/saved-page/selectors.ts index fed17b8c015..13c281f910a 100644 --- a/packages/common/src/store/pages/saved-page/selectors.ts +++ b/packages/common/src/store/pages/saved-page/selectors.ts @@ -1,6 +1,6 @@ import { uniq } from 'lodash' -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/pages/saved-page/types.ts b/packages/common/src/store/pages/saved-page/types.ts index b6c460f6a8b..466e0202dbf 100644 --- a/packages/common/src/store/pages/saved-page/types.ts +++ b/packages/common/src/store/pages/saved-page/types.ts @@ -1,7 +1,7 @@ import { full } from '@audius/sdk' -import type { Dayjs } from 'utils/dayjs' -import { ValueOf } from 'utils/typeUtils' +import type { Dayjs } from '~/utils/dayjs' +import { ValueOf } from '~/utils/typeUtils' import { UID, diff --git a/packages/common/src/store/pages/search-results/lineup/tracks/reducer.ts b/packages/common/src/store/pages/search-results/lineup/tracks/reducer.ts index 2c96f4efda5..a977ae82bad 100644 --- a/packages/common/src/store/pages/search-results/lineup/tracks/reducer.ts +++ b/packages/common/src/store/pages/search-results/lineup/tracks/reducer.ts @@ -1,6 +1,6 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/search-results/lineup/tracks/actions' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/search-results/lineup/tracks/actions' import { LineupState, Track } from '../../../../../models' diff --git a/packages/common/src/store/pages/search-results/reducer.ts b/packages/common/src/store/pages/search-results/reducer.ts index fd3f23aa35e..36d9ab8fa9c 100644 --- a/packages/common/src/store/pages/search-results/reducer.ts +++ b/packages/common/src/store/pages/search-results/reducer.ts @@ -1,4 +1,4 @@ -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import { FETCH_SEARCH_PAGE_RESULTS, FETCH_SEARCH_PAGE_RESULTS_SUCCEEDED, @@ -12,11 +12,11 @@ import { FetchSearchPageTagsAction, FetchSearchPageTagsSucceededAction, FetchSearchPageTagsFailedAction -} from 'store/pages/search-results/actions' -import { PREFIX } from 'store/pages/search-results/lineup/tracks/actions' +} from '~/store/pages/search-results/actions' +import { PREFIX } from '~/store/pages/search-results/lineup/tracks/actions' import tracksReducer, { initialState as initialLineupState -} from 'store/pages/search-results/lineup/tracks/reducer' +} from '~/store/pages/search-results/lineup/tracks/reducer' import { Status, Track } from '../../../models' diff --git a/packages/common/src/store/pages/search-results/selectors.ts b/packages/common/src/store/pages/search-results/selectors.ts index a4ad0f1e9da..c4045d31e71 100644 --- a/packages/common/src/store/pages/search-results/selectors.ts +++ b/packages/common/src/store/pages/search-results/selectors.ts @@ -1,9 +1,9 @@ import { createSelector } from 'reselect' -import { getCollections } from 'store/cache/collections/selectors' -import { getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { createShallowSelector } from 'utils/selectorHelpers' +import { getCollections } from '~/store/cache/collections/selectors' +import { getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { createShallowSelector } from '~/utils/selectorHelpers' // Search Results selectors export const getBaseState = (state: CommonState) => state.pages.searchResults diff --git a/packages/common/src/store/pages/settings/actions.ts b/packages/common/src/store/pages/settings/actions.ts index b2a517742b4..046e39dfb02 100644 --- a/packages/common/src/store/pages/settings/actions.ts +++ b/packages/common/src/store/pages/settings/actions.ts @@ -1,4 +1,4 @@ -import { Permission } from 'utils/browserNotifications' +import { Permission } from '~/utils/browserNotifications' import { BrowserNotificationSetting, diff --git a/packages/common/src/store/pages/settings/reducer.ts b/packages/common/src/store/pages/settings/reducer.ts index 15597dc70a9..20c70b4e3d6 100644 --- a/packages/common/src/store/pages/settings/reducer.ts +++ b/packages/common/src/store/pages/settings/reducer.ts @@ -1,4 +1,4 @@ -import { ActionsMap } from 'utils/reducer' +import { ActionsMap } from '~/utils/reducer' import { ToggleNotificationSetting, diff --git a/packages/common/src/store/pages/settings/selectors.ts b/packages/common/src/store/pages/settings/selectors.ts index 38ba87549ac..beabbbd133b 100644 --- a/packages/common/src/store/pages/settings/selectors.ts +++ b/packages/common/src/store/pages/settings/selectors.ts @@ -1,5 +1,5 @@ -import { getAccountUser } from 'store/account/selectors' -import { CommonState } from 'store/commonStore' +import { getAccountUser } from '~/store/account/selectors' +import { CommonState } from '~/store/commonStore' const getBaseState = (state: CommonState) => state.pages.settings diff --git a/packages/common/src/store/pages/settings/types.ts b/packages/common/src/store/pages/settings/types.ts index 8f993577b3b..f568797edc2 100644 --- a/packages/common/src/store/pages/settings/types.ts +++ b/packages/common/src/store/pages/settings/types.ts @@ -1,4 +1,4 @@ -import { Permission } from 'utils/browserNotifications' +import { Permission } from '~/utils/browserNotifications' export enum BrowserNotificationSetting { BrowserPush = 'browserPush', diff --git a/packages/common/src/store/pages/smart-collection/selectors.ts b/packages/common/src/store/pages/smart-collection/selectors.ts index 948a5537217..7efdb73e129 100644 --- a/packages/common/src/store/pages/smart-collection/selectors.ts +++ b/packages/common/src/store/pages/smart-collection/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { SmartCollectionVariant } from '../../../models/SmartCollectionVariant' diff --git a/packages/common/src/store/pages/token-dashboard/slice.ts b/packages/common/src/store/pages/token-dashboard/slice.ts index a05970eff55..3028b4630aa 100644 --- a/packages/common/src/store/pages/token-dashboard/slice.ts +++ b/packages/common/src/store/pages/token-dashboard/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { Chain } from '../../../models/Chain' import { BNWei, WalletAddress } from '../../../models/Wallet' diff --git a/packages/common/src/store/pages/track/actions.ts b/packages/common/src/store/pages/track/actions.ts index ecde8825a07..7ee8bcdc800 100644 --- a/packages/common/src/store/pages/track/actions.ts +++ b/packages/common/src/store/pages/track/actions.ts @@ -1,5 +1,5 @@ -import { ID } from 'models/Identifiers' -import { TrendingRange } from 'store/notifications' +import { ID } from '~/models/Identifiers' +import { TrendingRange } from '~/store/notifications' export const SET_TRACK_RANK = 'TRACK_PAGE/SET_TRACK_RANK' export const GET_TRACK_RANKS = 'TRACK_PAGE/GET_TRACK_RANKS' diff --git a/packages/common/src/store/pages/track/lineup/reducer.ts b/packages/common/src/store/pages/track/lineup/reducer.ts index 9759a0baf87..fc7aaab7c6f 100644 --- a/packages/common/src/store/pages/track/lineup/reducer.ts +++ b/packages/common/src/store/pages/track/lineup/reducer.ts @@ -1,6 +1,6 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' -import { PREFIX } from 'store/pages/track/lineup/actions' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' +import { PREFIX } from '~/store/pages/track/lineup/actions' import { LineupState, Track } from '../../../../models' diff --git a/packages/common/src/store/pages/track/reducer.ts b/packages/common/src/store/pages/track/reducer.ts index c1611064ed7..135144341ca 100644 --- a/packages/common/src/store/pages/track/reducer.ts +++ b/packages/common/src/store/pages/track/reducer.ts @@ -1,10 +1,10 @@ -import { SsrPageProps } from 'models/SsrPageProps' -import { Track } from 'models/Track' -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { SsrPageProps } from '~/models/SsrPageProps' +import { Track } from '~/models/Track' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import tracksReducer, { initialState as initialLineupState -} from 'store/pages/track/lineup/reducer' -import { decodeHashId } from 'utils/hashIds' +} from '~/store/pages/track/lineup/reducer' +import { decodeHashId } from '~/utils/hashIds' import { SET_TRACK_ID, diff --git a/packages/common/src/store/pages/track/selectors.ts b/packages/common/src/store/pages/track/selectors.ts index d169674203e..f5bc964768e 100644 --- a/packages/common/src/store/pages/track/selectors.ts +++ b/packages/common/src/store/pages/track/selectors.ts @@ -1,10 +1,10 @@ import { getTrack as getCachedTrack, getStatus as getCachedTrackStatus -} from 'store/cache/tracks/selectors' -import { getUser as getCachedUser } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { PREFIX } from 'store/pages/track/lineup/actions' +} from '~/store/cache/tracks/selectors' +import { getUser as getCachedUser } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { PREFIX } from '~/store/pages/track/lineup/actions' import { ID, Track, User } from '../../../models' import { Nullable } from '../../../utils/typeUtils' diff --git a/packages/common/src/store/pages/trending-playlists/lineups/reducer.ts b/packages/common/src/store/pages/trending-playlists/lineups/reducer.ts index 802ab34306b..448984b8892 100644 --- a/packages/common/src/store/pages/trending-playlists/lineups/reducer.ts +++ b/packages/common/src/store/pages/trending-playlists/lineups/reducer.ts @@ -1,5 +1,5 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' import { Collection, LineupState } from '../../../../models' diff --git a/packages/common/src/store/pages/trending-playlists/lineups/selectors.ts b/packages/common/src/store/pages/trending-playlists/lineups/selectors.ts index 38114a1ede0..138a0d74d5b 100644 --- a/packages/common/src/store/pages/trending-playlists/lineups/selectors.ts +++ b/packages/common/src/store/pages/trending-playlists/lineups/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getLineup = (state: CommonState) => state.pages.trendingPlaylists.trending diff --git a/packages/common/src/store/pages/trending-playlists/slice.ts b/packages/common/src/store/pages/trending-playlists/slice.ts index 32e198befc5..d2a36261bcb 100644 --- a/packages/common/src/store/pages/trending-playlists/slice.ts +++ b/packages/common/src/store/pages/trending-playlists/slice.ts @@ -1,6 +1,6 @@ import { combineReducers, createSlice } from '@reduxjs/toolkit' -import { asLineup } from 'store/lineup/reducer' +import { asLineup } from '~/store/lineup/reducer' import { PREFIX } from './lineups/actions' import playlistsReducer, { diff --git a/packages/common/src/store/pages/trending-underground/lineup/reducer.ts b/packages/common/src/store/pages/trending-underground/lineup/reducer.ts index fff4e675d21..a225f49facb 100644 --- a/packages/common/src/store/pages/trending-underground/lineup/reducer.ts +++ b/packages/common/src/store/pages/trending-underground/lineup/reducer.ts @@ -1,5 +1,5 @@ -import { RESET_SUCCEEDED, stripPrefix } from 'store/lineup/actions' -import { initialLineupState } from 'store/lineup/reducer' +import { RESET_SUCCEEDED, stripPrefix } from '~/store/lineup/actions' +import { initialLineupState } from '~/store/lineup/reducer' import { LineupState, Track } from '../../../../models' diff --git a/packages/common/src/store/pages/trending-underground/lineup/selectors.ts b/packages/common/src/store/pages/trending-underground/lineup/selectors.ts index 72793cb62c0..36e1771f542 100644 --- a/packages/common/src/store/pages/trending-underground/lineup/selectors.ts +++ b/packages/common/src/store/pages/trending-underground/lineup/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getLineup = (state: CommonState) => state.pages.trendingUnderground.trending diff --git a/packages/common/src/store/pages/trending-underground/slice.ts b/packages/common/src/store/pages/trending-underground/slice.ts index 32c758db67a..901a68a1bff 100644 --- a/packages/common/src/store/pages/trending-underground/slice.ts +++ b/packages/common/src/store/pages/trending-underground/slice.ts @@ -1,6 +1,6 @@ import { combineReducers, createSlice } from '@reduxjs/toolkit' -import { asLineup } from 'store/lineup/reducer' +import { asLineup } from '~/store/lineup/reducer' import { PREFIX } from './lineup/actions' import trendingReducer, { diff --git a/packages/common/src/store/pages/trending/actions.ts b/packages/common/src/store/pages/trending/actions.ts index 359e0118757..d91a0c18cee 100644 --- a/packages/common/src/store/pages/trending/actions.ts +++ b/packages/common/src/store/pages/trending/actions.ts @@ -1,4 +1,4 @@ -import { Genre } from 'utils' +import { Genre } from '~/utils' import { TimeRange } from '../../../models' diff --git a/packages/common/src/store/pages/trending/lineup/reducer.ts b/packages/common/src/store/pages/trending/lineup/reducer.ts index 0a93695e48c..acee119a427 100644 --- a/packages/common/src/store/pages/trending/lineup/reducer.ts +++ b/packages/common/src/store/pages/trending/lineup/reducer.ts @@ -1,4 +1,4 @@ -import { initialLineupState } from 'store/lineup/reducer' +import { initialLineupState } from '~/store/lineup/reducer' import { UID, LineupState, Track } from '../../../../models' import { RESET_SUCCEEDED, stripPrefix } from '../../../lineup/actions' diff --git a/packages/common/src/store/pages/trending/lineup/selectors.ts b/packages/common/src/store/pages/trending/lineup/selectors.ts index df4dbad628d..89b388f3bc3 100644 --- a/packages/common/src/store/pages/trending/lineup/selectors.ts +++ b/packages/common/src/store/pages/trending/lineup/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { Collection, LineupEntry, TimeRange, Track } from '../../../../models' diff --git a/packages/common/src/store/pages/trending/reducer.ts b/packages/common/src/store/pages/trending/reducer.ts index 97086b5fa6f..566ea7f2b0c 100644 --- a/packages/common/src/store/pages/trending/reducer.ts +++ b/packages/common/src/store/pages/trending/reducer.ts @@ -1,6 +1,6 @@ import { History } from 'history' -import { LineupActions, asLineup } from 'store/lineup/reducer' +import { LineupActions, asLineup } from '~/store/lineup/reducer' import { SET_TRENDING_GENRE, SET_TRENDING_TIME_RANGE, @@ -9,13 +9,13 @@ import { SetTrendingTimeRangeAction, SetLastFetchedTrendingGenreAction, TrendingPageAction -} from 'store/pages/trending/actions' +} from '~/store/pages/trending/actions' import { TRENDING_WEEK_PREFIX, TRENDING_MONTH_PREFIX, TRENDING_ALL_TIME_PREFIX -} from 'store/pages/trending/lineup/actions' -import { GENRES, Genre } from 'utils/genres' +} from '~/store/pages/trending/lineup/actions' +import { GENRES, Genre } from '~/utils/genres' import { TimeRange, Track } from '../../../models' diff --git a/packages/common/src/store/pages/trending/selectors.ts b/packages/common/src/store/pages/trending/selectors.ts index 99c6c6df25f..aca88d81827 100644 --- a/packages/common/src/store/pages/trending/selectors.ts +++ b/packages/common/src/store/pages/trending/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { TimeRange } from '../../../models' diff --git a/packages/common/src/store/playback-position/sagas.ts b/packages/common/src/store/playback-position/sagas.ts index 9b3818ebfa6..193a8769edd 100644 --- a/packages/common/src/store/playback-position/sagas.ts +++ b/packages/common/src/store/playback-position/sagas.ts @@ -1,12 +1,12 @@ import { call, delay, put, select, takeEvery } from 'typed-redux-saga' -import { AudioPlayer } from 'services/audio-player' -import { FeatureFlags } from 'services/remote-config' -import { getUserId } from 'store/account/selectors' -import { getTrack } from 'store/cache/tracks/selectors' -import { getContext } from 'store/effects' -import { getPlaying, getTrackId } from 'store/player/selectors' -import { Genre } from 'utils/genres' +import { AudioPlayer } from '~/services/audio-player' +import { FeatureFlags } from '~/services/remote-config' +import { getUserId } from '~/store/account/selectors' +import { getTrack } from '~/store/cache/tracks/selectors' +import { getContext } from '~/store/effects' +import { getPlaying, getTrackId } from '~/store/player/selectors' +import { Genre } from '~/utils/genres' import { getPlaybackPositions } from './selectors' import { diff --git a/packages/common/src/store/playback-position/selectors.ts b/packages/common/src/store/playback-position/selectors.ts index 7c0acdb6a71..2e6a8a377c3 100644 --- a/packages/common/src/store/playback-position/selectors.ts +++ b/packages/common/src/store/playback-position/selectors.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { CommonState } from '../commonStore' diff --git a/packages/common/src/store/playback-position/slice.ts b/packages/common/src/store/playback-position/slice.ts index 460c31c26ca..8512656ddca 100644 --- a/packages/common/src/store/playback-position/slice.ts +++ b/packages/common/src/store/playback-position/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { PlaybackPositionInfo, PlaybackPositionState } from './types' diff --git a/packages/common/src/store/playback-position/types.ts b/packages/common/src/store/playback-position/types.ts index ce595a59fb9..59a45665a09 100644 --- a/packages/common/src/store/playback-position/types.ts +++ b/packages/common/src/store/playback-position/types.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' export const LEGACY_PLAYBACK_POSITION_LS_KEY = 'playbackPosition' export const PLAYBACK_POSITION_LS_KEY = 'userPlaybackPositions' diff --git a/packages/common/src/store/player/sagas.ts b/packages/common/src/store/player/sagas.ts index 191a6238cbc..9b90f5c3b63 100644 --- a/packages/common/src/store/player/sagas.ts +++ b/packages/common/src/store/player/sagas.ts @@ -1,7 +1,7 @@ import { call, put, takeEvery } from 'typed-redux-saga' -import { FeatureFlags } from 'services/remote-config' -import { getContext } from 'store/effects' +import { FeatureFlags } from '~/services/remote-config' +import { getContext } from '~/store/effects' import { setPlaybackRate } from './slice' import { PlaybackRate, PLAYBACK_RATE_LS_KEY } from './types' diff --git a/packages/common/src/store/playlist-library/helpers.test.ts b/packages/common/src/store/playlist-library/helpers.test.ts index 27c08056df1..1aea69b781b 100644 --- a/packages/common/src/store/playlist-library/helpers.test.ts +++ b/packages/common/src/store/playlist-library/helpers.test.ts @@ -1,5 +1,8 @@ -import { PlaylistLibrary, PlaylistLibraryFolder } from 'models/PlaylistLibrary' -import { SmartCollectionVariant } from 'models/SmartCollectionVariant' +import { + PlaylistLibrary, + PlaylistLibraryFolder +} from '~/models/PlaylistLibrary' +import { SmartCollectionVariant } from '~/models/SmartCollectionVariant' import { addFolderToLibrary, diff --git a/packages/common/src/store/playlist-library/helpers.ts b/packages/common/src/store/playlist-library/helpers.ts index 543daa3db55..8773665b4a9 100644 --- a/packages/common/src/store/playlist-library/helpers.ts +++ b/packages/common/src/store/playlist-library/helpers.ts @@ -1,5 +1,5 @@ -import { Nullable } from 'utils/typeUtils' -import { uuid } from 'utils/uid' +import { Nullable } from '~/utils/typeUtils' +import { uuid } from '~/utils/uid' import { ID } from '../../models/Identifiers' import { diff --git a/packages/common/src/store/playlist-library/selectors.ts b/packages/common/src/store/playlist-library/selectors.ts index 6a1296e7734..6176711ffab 100644 --- a/packages/common/src/store/playlist-library/selectors.ts +++ b/packages/common/src/store/playlist-library/selectors.ts @@ -1,5 +1,5 @@ -import { getUserId } from 'store/account/selectors' -import { getUser } from 'store/cache/users/selectors' +import { getUserId } from '~/store/account/selectors' +import { getUser } from '~/store/cache/users/selectors' import { CommonState } from '../reducers' diff --git a/packages/common/src/store/playlist-updates/playlistUpdatesSagas.ts b/packages/common/src/store/playlist-updates/playlistUpdatesSagas.ts index b237aa11657..caece367c2d 100644 --- a/packages/common/src/store/playlist-updates/playlistUpdatesSagas.ts +++ b/packages/common/src/store/playlist-updates/playlistUpdatesSagas.ts @@ -1,7 +1,7 @@ import { call, takeEvery, select, put } from 'typed-redux-saga' -import { Name } from 'models/Analytics' -import { getContext } from 'store/effects' +import { Name } from '~/models/Analytics' +import { getContext } from '~/store/effects' import { getUserId } from '../account/selectors' diff --git a/packages/common/src/store/playlist-updates/types.ts b/packages/common/src/store/playlist-updates/types.ts index 239e1a44171..338edec6ce1 100644 --- a/packages/common/src/store/playlist-updates/types.ts +++ b/packages/common/src/store/playlist-updates/types.ts @@ -1,6 +1,6 @@ import { EntityState, PayloadAction } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' export type PlaylistUpdate = { playlist_id: number diff --git a/packages/common/src/store/purchase-content/sagas.ts b/packages/common/src/store/purchase-content/sagas.ts index a601b4c6ed0..6337a50ced4 100644 --- a/packages/common/src/store/purchase-content/sagas.ts +++ b/packages/common/src/store/purchase-content/sagas.ts @@ -2,55 +2,55 @@ import BN from 'bn.js' import { takeLatest } from 'redux-saga/effects' import { call, put, race, select, take } from 'typed-redux-saga' -import { FavoriteSource, Name } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' -import { ID } from 'models/Identifiers' -import { PurchaseMethod, PurchaseVendor } from 'models/PurchaseContent' -import { Track, isContentUSDCPurchaseGated } from 'models/Track' -import { User } from 'models/User' -import { BNUSDC } from 'models/Wallet' +import { FavoriteSource, Name } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' +import { ID } from '~/models/Identifiers' +import { PurchaseMethod, PurchaseVendor } from '~/models/PurchaseContent' +import { Track, isContentUSDCPurchaseGated } from '~/models/Track' +import { User } from '~/models/User' +import { BNUSDC } from '~/models/Wallet' import { getRecentBlockhash, getRootSolanaAccount, getTokenAccountInfo, purchaseContent, purchaseContentWithPaymentRouter -} from 'services/audius-backend/solana' -import { FeatureFlags } from 'services/remote-config/feature-flags' -import { accountSelectors } from 'store/account' +} from '~/services/audius-backend/solana' +import { FeatureFlags } from '~/services/remote-config/feature-flags' +import { accountSelectors } from '~/store/account' import { buyCryptoCanceled, buyCryptoFailed, buyCryptoSucceeded, buyCryptoViaSol -} from 'store/buy-crypto/slice' -import { BuyCryptoError } from 'store/buy-crypto/types' +} from '~/store/buy-crypto/slice' +import { BuyCryptoError } from '~/store/buy-crypto/types' import { buyUSDCFlowFailed, buyUSDCFlowSucceeded, onrampOpened, onrampCanceled -} from 'store/buy-usdc/slice' -import { BuyUSDCError } from 'store/buy-usdc/types' -import { getBuyUSDCRemoteConfig, getUSDCUserBank } from 'store/buy-usdc/utils' -import { getTrack } from 'store/cache/tracks/selectors' -import { getUser } from 'store/cache/users/selectors' -import { getContext } from 'store/effects' -import { getPreviewing, getTrackId } from 'store/player/selectors' -import { stop } from 'store/player/slice' -import { saveTrack } from 'store/social/tracks/actions' -import { getFeePayer } from 'store/solana/selectors' -import { OnRampProvider } from 'store/ui/buy-audio/types' +} from '~/store/buy-usdc/slice' +import { BuyUSDCError } from '~/store/buy-usdc/types' +import { getBuyUSDCRemoteConfig, getUSDCUserBank } from '~/store/buy-usdc/utils' +import { getTrack } from '~/store/cache/tracks/selectors' +import { getUser } from '~/store/cache/users/selectors' +import { getContext } from '~/store/effects' +import { getPreviewing, getTrackId } from '~/store/player/selectors' +import { stop } from '~/store/player/slice' +import { saveTrack } from '~/store/social/tracks/actions' +import { getFeePayer } from '~/store/solana/selectors' +import { OnRampProvider } from '~/store/ui/buy-audio/types' import { transactionCanceled, transactionFailed, transactionSucceeded -} from 'store/ui/coinflow-modal/slice' +} from '~/store/ui/coinflow-modal/slice' import { CoinflowPurchaseMetadata, coinflowOnrampModalActions -} from 'store/ui/modals/coinflow-onramp-modal' -import { BN_USDC_CENT_WEI } from 'utils/wallet' +} from '~/store/ui/modals/coinflow-onramp-modal' +import { BN_USDC_CENT_WEI } from '~/utils/wallet' import { pollGatedTrack } from '../gated-content/sagas' import { updateGatedTrackStatus } from '../gated-content/slice' diff --git a/packages/common/src/store/purchase-content/selectors.ts b/packages/common/src/store/purchase-content/selectors.ts index db690dff85d..db8bfb602cb 100644 --- a/packages/common/src/store/purchase-content/selectors.ts +++ b/packages/common/src/store/purchase-content/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getPurchaseContentId = (state: CommonState) => state.purchaseContent.contentId diff --git a/packages/common/src/store/purchase-content/slice.ts b/packages/common/src/store/purchase-content/slice.ts index f2dffc4de80..c217c820102 100644 --- a/packages/common/src/store/purchase-content/slice.ts +++ b/packages/common/src/store/purchase-content/slice.ts @@ -1,7 +1,7 @@ import { Action, createSlice, PayloadAction } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' -import { PurchaseMethod, PurchaseVendor } from 'models/PurchaseContent' +import { ID } from '~/models/Identifiers' +import { PurchaseMethod, PurchaseVendor } from '~/models/PurchaseContent' import { ContentType, diff --git a/packages/common/src/store/purchase-content/types.ts b/packages/common/src/store/purchase-content/types.ts index a980ca954d0..5acf76766c0 100644 --- a/packages/common/src/store/purchase-content/types.ts +++ b/packages/common/src/store/purchase-content/types.ts @@ -1,4 +1,4 @@ -import { BuyCryptoErrorCode } from 'store/buy-crypto/types' +import { BuyCryptoErrorCode } from '~/store/buy-crypto/types' import { BuyUSDCErrorCode } from '../buy-usdc' diff --git a/packages/common/src/store/purchase-content/utils.test.ts b/packages/common/src/store/purchase-content/utils.test.ts index 1d36db05c33..1028dbeb3dc 100644 --- a/packages/common/src/store/purchase-content/utils.test.ts +++ b/packages/common/src/store/purchase-content/utils.test.ts @@ -1,7 +1,7 @@ import BN from 'bn.js' -import { BNUSDC } from 'models/Wallet' -import { BN_USDC_CENT_WEI } from 'utils/wallet' +import { BNUSDC } from '~/models/Wallet' +import { BN_USDC_CENT_WEI } from '~/utils/wallet' import { getBalanceNeeded, getPurchaseSummaryValues } from './utils' diff --git a/packages/common/src/store/purchase-content/utils.ts b/packages/common/src/store/purchase-content/utils.ts index 91ae54d98fe..440b54bc747 100644 --- a/packages/common/src/store/purchase-content/utils.ts +++ b/packages/common/src/store/purchase-content/utils.ts @@ -1,8 +1,8 @@ import BN from 'bn.js' -import { BNUSDC } from 'models/Wallet' -import { Nullable } from 'utils/typeUtils' -import { BN_USDC_CENT_WEI, ceilingBNUSDCToNearestCent } from 'utils/wallet' +import { BNUSDC } from '~/models/Wallet' +import { Nullable } from '~/utils/typeUtils' +import { BN_USDC_CENT_WEI, ceilingBNUSDCToNearestCent } from '~/utils/wallet' import { PurchaseContentStage } from './types' diff --git a/packages/common/src/store/reachability/sagas.ts b/packages/common/src/store/reachability/sagas.ts index f9337719a03..cacc4e1ceed 100644 --- a/packages/common/src/store/reachability/sagas.ts +++ b/packages/common/src/store/reachability/sagas.ts @@ -1,6 +1,6 @@ import { takeEvery, select, all, take } from 'typed-redux-saga' -import { getContext } from 'store/effects' +import { getContext } from '~/store/effects' import * as reachabilityActions from './actions' import * as reachabilitySelectors from './selectors' diff --git a/packages/common/src/store/reachability/selectors.ts b/packages/common/src/store/reachability/selectors.ts index 2038685e1e5..b1f383ef0ce 100644 --- a/packages/common/src/store/reachability/selectors.ts +++ b/packages/common/src/store/reachability/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getIsReachable = (state: CommonState) => state.reachability.networkReachable diff --git a/packages/common/src/store/recovery-email/index.ts b/packages/common/src/store/recovery-email/index.ts index 41703a84af4..ee30058aab5 100644 --- a/packages/common/src/store/recovery-email/index.ts +++ b/packages/common/src/store/recovery-email/index.ts @@ -1,7 +1,7 @@ export { default as recoveryEmailReducer, - actions as recoveryEmailActions, - RecoveryEmailState + actions as recoveryEmailActions } from './slice' +export type { RecoveryEmailState } from './slice' export * as recoveryEmailSelectors from './selectors' diff --git a/packages/common/src/store/reducers.ts b/packages/common/src/store/reducers.ts index 6f853e781e9..b4890e6e133 100644 --- a/packages/common/src/store/reducers.ts +++ b/packages/common/src/store/reducers.ts @@ -2,7 +2,7 @@ import { History } from 'history' import { combineReducers } from 'redux' import type { Storage } from 'redux-persist' -import { SsrPageProps } from 'models/SsrPageProps' +import { SsrPageProps } from '~/models/SsrPageProps' import apiReducer from '../api/reducer' import { Kind } from '../models' diff --git a/packages/common/src/store/sagas.ts b/packages/common/src/store/sagas.ts index eff0ccd0e18..4be9f86ad11 100644 --- a/packages/common/src/store/sagas.ts +++ b/packages/common/src/store/sagas.ts @@ -6,15 +6,15 @@ // import recoveryEmailSagas from 'common/store/recovery-email/sagas' // import signOutSagas from 'common/store/sign-out/sagas' -import { accountSagas } from 'store/account' -import { buyUSDCSagas } from 'store/buy-usdc' -import { sagas as castSagas } from 'store/cast/sagas' -import { gatedContentSagas } from 'store/gated-content' -import { chatSagas } from 'store/pages/chat' -import { playbackPositionSagas } from 'store/playback-position' -import { playerSagas } from 'store/player' -import { purchaseContentSagas } from 'store/purchase-content' -import remoteConfigSagas from 'store/remote-config/sagas' +import { accountSagas } from '~/store/account' +import { buyUSDCSagas } from '~/store/buy-usdc' +import { sagas as castSagas } from '~/store/cast/sagas' +import { gatedContentSagas } from '~/store/gated-content' +import { chatSagas } from '~/store/pages/chat' +import { playbackPositionSagas } from '~/store/playback-position' +import { playerSagas } from '~/store/player' +import { purchaseContentSagas } from '~/store/purchase-content' +import remoteConfigSagas from '~/store/remote-config/sagas' import { searchUsersModalSagas, toastSagas, @@ -27,7 +27,7 @@ import { uploadConfirmationModalUISagas, publishTrackConfirmationModalUISagas, modalsSagas -} from 'store/ui' +} from '~/store/ui' import { buyCryptoSagas } from './buy-crypto' import { playlistUpdatesSagas } from './playlist-updates' diff --git a/packages/common/src/store/saved-collections/selectors.ts b/packages/common/src/store/saved-collections/selectors.ts index a037de04808..14ee92fba7c 100644 --- a/packages/common/src/store/saved-collections/selectors.ts +++ b/packages/common/src/store/saved-collections/selectors.ts @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' -import { getUsers } from 'store/cache/users/selectors' +import { ID } from '~/models/Identifiers' +import { getUsers } from '~/store/cache/users/selectors' import { getAccountStatus } from '../account/selectors' import { getCollections } from '../cache/collections/selectors' diff --git a/packages/common/src/store/solana/selectors.ts b/packages/common/src/store/solana/selectors.ts index 6060b4b18ab..d3d8069774e 100644 --- a/packages/common/src/store/solana/selectors.ts +++ b/packages/common/src/store/solana/selectors.ts @@ -1,3 +1,3 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getFeePayer = (state: CommonState) => state.solana.feePayer diff --git a/packages/common/src/store/stems-upload/selectors.ts b/packages/common/src/store/stems-upload/selectors.ts index f3c99550231..417648dda7c 100644 --- a/packages/common/src/store/stems-upload/selectors.ts +++ b/packages/common/src/store/stems-upload/selectors.ts @@ -1,6 +1,6 @@ import { createSelector } from 'reselect' -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../models/Identifiers' diff --git a/packages/common/src/store/ui/add-to-collection/selectors.ts b/packages/common/src/store/ui/add-to-collection/selectors.ts index 3b11be093fb..823c663cf44 100644 --- a/packages/common/src/store/ui/add-to-collection/selectors.ts +++ b/packages/common/src/store/ui/add-to-collection/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' const getBaseState = (state: CommonState) => state.ui.addToCollection diff --git a/packages/common/src/store/ui/buy-audio/constants.ts b/packages/common/src/store/ui/buy-audio/constants.ts index eccffe5d8ed..7a97fb4804d 100644 --- a/packages/common/src/store/ui/buy-audio/constants.ts +++ b/packages/common/src/store/ui/buy-audio/constants.ts @@ -32,3 +32,5 @@ export const TOKEN_LISTING_MAP: Record = { 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png' } } + +export type JupiterTokenSymbol = keyof typeof TOKEN_LISTING_MAP diff --git a/packages/common/src/store/ui/buy-audio/selectors.ts b/packages/common/src/store/ui/buy-audio/selectors.ts index bdf59327bba..f2028a88e43 100644 --- a/packages/common/src/store/ui/buy-audio/selectors.ts +++ b/packages/common/src/store/ui/buy-audio/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getBuyAudioProvider = (state: CommonState) => state.ui.buyAudio.provider diff --git a/packages/common/src/store/ui/buy-audio/types.ts b/packages/common/src/store/ui/buy-audio/types.ts index d6993cdbffc..286599d1010 100644 --- a/packages/common/src/store/ui/buy-audio/types.ts +++ b/packages/common/src/store/ui/buy-audio/types.ts @@ -1,5 +1,3 @@ -import { TOKEN_LISTING_MAP } from './constants' - /** * From Jupiter API documentation: * https://docs.jup.ag/jupiter-core/jupiter-sdk/v2/full-guide @@ -20,8 +18,6 @@ export enum OnRampProvider { UNKNOWN = 'unknown' } -export type JupiterTokenSymbol = keyof typeof TOKEN_LISTING_MAP - export enum PurchaseInfoErrorType { MAX_AUDIO_EXCEEDED = 'max_audio_exceeded', MIN_AUDIO_EXCEEDED = 'min_audio_exceeded', diff --git a/packages/common/src/store/ui/collectible-details/selectors.ts b/packages/common/src/store/ui/collectible-details/selectors.ts index 7ceaf517f7d..477c024068b 100644 --- a/packages/common/src/store/ui/collectible-details/selectors.ts +++ b/packages/common/src/store/ui/collectible-details/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getCollectibleDetails = (state: CommonState) => { return state.ui.collectibleDetails diff --git a/packages/common/src/store/ui/delete-playlist-confirmation-modal/selectors.ts b/packages/common/src/store/ui/delete-playlist-confirmation-modal/selectors.ts index 85936180eee..72a969a802c 100644 --- a/packages/common/src/store/ui/delete-playlist-confirmation-modal/selectors.ts +++ b/packages/common/src/store/ui/delete-playlist-confirmation-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getPlaylistId = (state: CommonState) => state.ui.deletePlaylistConfirmationModal.playlistId diff --git a/packages/common/src/store/ui/delete-playlist-confirmation-modal/slice.ts b/packages/common/src/store/ui/delete-playlist-confirmation-modal/slice.ts index 2acd9f0eabe..874e1b5f8f9 100644 --- a/packages/common/src/store/ui/delete-playlist-confirmation-modal/slice.ts +++ b/packages/common/src/store/ui/delete-playlist-confirmation-modal/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/ui/duplicate-add-confirmation-modal/selectors.ts b/packages/common/src/store/ui/duplicate-add-confirmation-modal/selectors.ts index 0ffa395a360..9595f40ecbf 100644 --- a/packages/common/src/store/ui/duplicate-add-confirmation-modal/selectors.ts +++ b/packages/common/src/store/ui/duplicate-add-confirmation-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getPlaylistId = (state: CommonState) => state.ui.duplicateAddConfirmationModal.playlistId diff --git a/packages/common/src/store/ui/duplicate-add-confirmation-modal/slice.ts b/packages/common/src/store/ui/duplicate-add-confirmation-modal/slice.ts index 49711ae1e8e..e5f233dae05 100644 --- a/packages/common/src/store/ui/duplicate-add-confirmation-modal/slice.ts +++ b/packages/common/src/store/ui/duplicate-add-confirmation-modal/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/ui/index.ts b/packages/common/src/store/ui/index.ts index a4da5747cd5..d49661beec0 100644 --- a/packages/common/src/store/ui/index.ts +++ b/packages/common/src/store/ui/index.ts @@ -57,9 +57,9 @@ export * from './publish-playlist-confirmation-modal/types' export { default as reactionsUIReducer, - actions as reactionsUIActions, - selectors as reactionsUISelectors + actions as reactionsUIActions } from './reactions/slice' +export { selectors as reactionsUISelectors } from './reactions/selectors' export * from './reactions/types' export * from './reactions/utils' @@ -99,12 +99,8 @@ export { export * from './share-sound-to-tiktok-modal/types' export * as shareSoundToTiktokModalSelectors from './share-sound-to-tiktok-modal/selectors' -export { - default as themeReducer, - actions as themeActions, - SetThemeAction, - SetSystemAppearanceAction -} from './theme/slice' +export { default as themeReducer, actions as themeActions } from './theme/slice' +export type { SetThemeAction, SetSystemAppearanceAction } from './theme/slice' export * as themeSelectors from './theme/selectors' export { default as toastReducer, actions as toastActions } from './toast/slice' @@ -151,8 +147,8 @@ export * from './transaction-details/types' export { default as searchUsersModalReducer, - actions as searchUsersModalActions, - SearchUsersModalState + actions as searchUsersModalActions } from './search-users-modal/slice' +export type { SearchUsersModalState } from './search-users-modal/slice' export * as searchUsersModalSelectors from './search-users-modal/selectors' export { default as searchUsersModalSagas } from './search-users-modal/sagas' diff --git a/packages/common/src/store/ui/mobile-overflow-menu/sagas.ts b/packages/common/src/store/ui/mobile-overflow-menu/sagas.ts index df5091ac17c..354664efa0a 100644 --- a/packages/common/src/store/ui/mobile-overflow-menu/sagas.ts +++ b/packages/common/src/store/ui/mobile-overflow-menu/sagas.ts @@ -1,6 +1,6 @@ import { put, takeEvery } from 'typed-redux-saga' -import { setVisibility } from 'store/ui/modals/parentSlice' +import { setVisibility } from '~/store/ui/modals/parentSlice' import { open } from './slice' diff --git a/packages/common/src/store/ui/mobile-overflow-menu/selectors.ts b/packages/common/src/store/ui/mobile-overflow-menu/selectors.ts index 1444d027dd8..db7f687161c 100644 --- a/packages/common/src/store/ui/mobile-overflow-menu/selectors.ts +++ b/packages/common/src/store/ui/mobile-overflow-menu/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getMobileOverflowModal = (state: CommonState) => state.ui.mobileOverflowModal diff --git a/packages/common/src/store/ui/modals/coinflow-onramp-modal/index.ts b/packages/common/src/store/ui/modals/coinflow-onramp-modal/index.ts index dd89a139524..5b1a049c8c0 100644 --- a/packages/common/src/store/ui/modals/coinflow-onramp-modal/index.ts +++ b/packages/common/src/store/ui/modals/coinflow-onramp-modal/index.ts @@ -1,6 +1,6 @@ import { Action } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/create-chat-modal/index.ts b/packages/common/src/store/ui/modals/create-chat-modal/index.ts index 305692cbf12..19e2179a420 100644 --- a/packages/common/src/store/ui/modals/create-chat-modal/index.ts +++ b/packages/common/src/store/ui/modals/create-chat-modal/index.ts @@ -1,12 +1,5 @@ -import { Action } from '@reduxjs/toolkit' - import { createModal } from '../createModal' - -export type CreateChatModalState = { - defaultUserList?: 'followers' | 'chats' - presetMessage?: string - onCancelAction?: Action -} +import { CreateChatModalState } from '../types' const createChatModal = createModal({ reducerPath: 'CreateChatModal', diff --git a/packages/common/src/store/ui/modals/createModal.ts b/packages/common/src/store/ui/modals/createModal.ts index 7069ccdc37f..3a832386b9b 100644 --- a/packages/common/src/store/ui/modals/createModal.ts +++ b/packages/common/src/store/ui/modals/createModal.ts @@ -3,14 +3,11 @@ import { useCallback } from 'react' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { useDispatch, useSelector } from 'react-redux' -import { ModalSource } from 'models/Analytics' -import { CommonState } from 'store/index' +import { ModalSource } from '~/models/Analytics' +import { CommonState } from '~/store' import { actions } from './parentSlice' - -export type BaseModalState = { - isOpen: boolean | 'closing' -} +import { BaseModalState } from './types' type BaseCreateModalConfig = { reducerPath: string diff --git a/packages/common/src/store/ui/modals/edit-playlist-modal/index.ts b/packages/common/src/store/ui/modals/edit-playlist-modal/index.ts index 89ea9473e2b..30703a0d0eb 100644 --- a/packages/common/src/store/ui/modals/edit-playlist-modal/index.ts +++ b/packages/common/src/store/ui/modals/edit-playlist-modal/index.ts @@ -1,5 +1,5 @@ -import { ID } from 'models/Identifiers' -import { Nullable } from 'utils/typeUtils' +import { ID } from '~/models/Identifiers' +import { Nullable } from '~/utils/typeUtils' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/edit-track-modal/index.ts b/packages/common/src/store/ui/modals/edit-track-modal/index.ts index 11b6996b7b9..b11c9de2b10 100644 --- a/packages/common/src/store/ui/modals/edit-track-modal/index.ts +++ b/packages/common/src/store/ui/modals/edit-track-modal/index.ts @@ -1,5 +1,5 @@ -import { ID } from 'models/Identifiers' -import { Nullable } from 'utils/typeUtils' +import { ID } from '~/models/Identifiers' +import { Nullable } from '~/utils/typeUtils' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/edit-track-modal/selectors.ts b/packages/common/src/store/ui/modals/edit-track-modal/selectors.ts index b7352020d65..b9a1b1e435d 100644 --- a/packages/common/src/store/ui/modals/edit-track-modal/selectors.ts +++ b/packages/common/src/store/ui/modals/edit-track-modal/selectors.ts @@ -1,6 +1,6 @@ -import { StemTrack } from 'models/Track' -import { cacheTracksSelectors } from 'store/cache' -import { CommonState } from 'store/commonStore' +import { StemTrack } from '~/models/Track' +import { cacheTracksSelectors } from '~/store/cache' +import { CommonState } from '~/store/commonStore' const { getTrack, getTracks } = cacheTracksSelectors diff --git a/packages/common/src/store/ui/modals/inbox-unavailable-modal/index.ts b/packages/common/src/store/ui/modals/inbox-unavailable-modal/index.ts index 1b14bf7b25c..e82d209bdc0 100644 --- a/packages/common/src/store/ui/modals/inbox-unavailable-modal/index.ts +++ b/packages/common/src/store/ui/modals/inbox-unavailable-modal/index.ts @@ -1,6 +1,6 @@ import { Action } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/premium-content-purchase-modal/index.ts b/packages/common/src/store/ui/modals/premium-content-purchase-modal/index.ts index ef916039af9..fec9b153c83 100644 --- a/packages/common/src/store/ui/modals/premium-content-purchase-modal/index.ts +++ b/packages/common/src/store/ui/modals/premium-content-purchase-modal/index.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/reducers.ts b/packages/common/src/store/ui/modals/reducers.ts index 10d80981f20..064557b3d90 100644 --- a/packages/common/src/store/ui/modals/reducers.ts +++ b/packages/common/src/store/ui/modals/reducers.ts @@ -4,14 +4,13 @@ import { addFundsModalReducer } from './add-funds-modal' import { coinflowOnrampModalReducer } from './coinflow-onramp-modal' import { coinflowWithdrawModalReducer } from './coinflow-withdraw-modal' import { createChatModalReducer } from './create-chat-modal' -import { BaseModalState } from './createModal' import { editPlaylistModalReducer } from './edit-playlist-modal' import { editTrackModalReducer } from './edit-track-modal' import { inboxUnavailableModalReducer } from './inbox-unavailable-modal' import { leavingAudiusModalReducer } from './leaving-audius-modal' import parentReducer, { initialState } from './parentSlice' import { premiumContentPurchaseModalReducer } from './premium-content-purchase-modal' -import { Modals, ModalsState } from './types' +import { BaseModalState, Modals, ModalsState } from './types' import { usdcManualTransferModalReducer } from './usdc-manual-transfer-modal' import { usdcPurchaseDetailsModalReducer } from './usdc-purchase-details-modal' import { usdcTransactionDetailsModalReducer } from './usdc-transaction-details-modal' diff --git a/packages/common/src/store/ui/modals/sagas.ts b/packages/common/src/store/ui/modals/sagas.ts index 4d96d11aecd..a5cb36a959f 100644 --- a/packages/common/src/store/ui/modals/sagas.ts +++ b/packages/common/src/store/ui/modals/sagas.ts @@ -1,7 +1,7 @@ import { takeEvery, call } from 'typed-redux-saga' -import { Name } from 'models/Analytics' -import { getContext } from 'store/effects' +import { Name } from '~/models/Analytics' +import { getContext } from '~/store/effects' import { actions } from './parentSlice' const { trackModalOpened, trackModalClosed } = actions diff --git a/packages/common/src/store/ui/modals/selectors.ts b/packages/common/src/store/ui/modals/selectors.ts index 83dc82b12d2..112eaf32310 100644 --- a/packages/common/src/store/ui/modals/selectors.ts +++ b/packages/common/src/store/ui/modals/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { Modals } from './types' diff --git a/packages/common/src/store/ui/modals/types.ts b/packages/common/src/store/ui/modals/types.ts index 38d1192577f..9b40a619b5f 100644 --- a/packages/common/src/store/ui/modals/types.ts +++ b/packages/common/src/store/ui/modals/types.ts @@ -1,10 +1,10 @@ -import { ModalSource } from 'models/Analytics' +import { Action } from '@reduxjs/toolkit' + +import { ModalSource } from '~/models/Analytics' import { AddFundsModalState } from './add-funds-modal' import { CoinflowOnrampModalState } from './coinflow-onramp-modal' import { CoinflowWithdrawModalState } from './coinflow-withdraw-modal' -import { CreateChatModalState } from './create-chat-modal' -import { BaseModalState } from './createModal' import { EditPlaylistModalState } from './edit-playlist-modal' import { EditTrackModalState } from './edit-track-modal' import { InboxUnavailableModalState } from './inbox-unavailable-modal' @@ -16,6 +16,16 @@ import { USDCTransactionDetailsModalState } from './usdc-transaction-details-mod import { WaitForDownloadModalState } from './wait-for-download-modal' import { WithdrawUSDCModalState } from './withdraw-usdc-modal' +export type BaseModalState = { + isOpen: boolean | 'closing' +} + +export type CreateChatModalState = { + defaultUserList?: 'followers' | 'chats' + presetMessage?: string + onCancelAction?: Action +} + export type Modals = | 'TiersExplainer' | 'TrendingRewardsExplainer' diff --git a/packages/common/src/store/ui/modals/usdc-purchase-details-modal/index.ts b/packages/common/src/store/ui/modals/usdc-purchase-details-modal/index.ts index 1e41ee2f524..6d1bd48e8ba 100644 --- a/packages/common/src/store/ui/modals/usdc-purchase-details-modal/index.ts +++ b/packages/common/src/store/ui/modals/usdc-purchase-details-modal/index.ts @@ -1,4 +1,4 @@ -import { USDCPurchaseDetails } from 'models/USDCTransactions' +import { USDCPurchaseDetails } from '~/models/USDCTransactions' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/usdc-transaction-details-modal/index.ts b/packages/common/src/store/ui/modals/usdc-transaction-details-modal/index.ts index 0b6d571fafa..ccef453b8ee 100644 --- a/packages/common/src/store/ui/modals/usdc-transaction-details-modal/index.ts +++ b/packages/common/src/store/ui/modals/usdc-transaction-details-modal/index.ts @@ -1,4 +1,4 @@ -import { USDCTransactionDetails } from 'models/USDCTransactions' +import { USDCTransactionDetails } from '~/models/USDCTransactions' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/modals/wait-for-download-modal/index.ts b/packages/common/src/store/ui/modals/wait-for-download-modal/index.ts index aa24bf0a0d9..fae78fd45ed 100644 --- a/packages/common/src/store/ui/modals/wait-for-download-modal/index.ts +++ b/packages/common/src/store/ui/modals/wait-for-download-modal/index.ts @@ -1,4 +1,4 @@ -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' import { createModal } from '../createModal' diff --git a/packages/common/src/store/ui/now-playing/selectors.ts b/packages/common/src/store/ui/now-playing/selectors.ts index e02907bff50..8d23bca58b3 100644 --- a/packages/common/src/store/ui/now-playing/selectors.ts +++ b/packages/common/src/store/ui/now-playing/selectors.ts @@ -1,3 +1,3 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getIsOpen = (state: CommonState) => state.ui.nowPlaying.isOpen diff --git a/packages/common/src/store/ui/publish-playlist-confirmation-modal/selectors.ts b/packages/common/src/store/ui/publish-playlist-confirmation-modal/selectors.ts index ab16d0ecf68..396f329ca19 100644 --- a/packages/common/src/store/ui/publish-playlist-confirmation-modal/selectors.ts +++ b/packages/common/src/store/ui/publish-playlist-confirmation-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getPlaylistId = (state: CommonState) => state.ui.publishPlaylistConfirmationModal.playlistId diff --git a/packages/common/src/store/ui/publish-playlist-confirmation-modal/slice.ts b/packages/common/src/store/ui/publish-playlist-confirmation-modal/slice.ts index 1e122d659e3..83ea5ad7c2a 100644 --- a/packages/common/src/store/ui/publish-playlist-confirmation-modal/slice.ts +++ b/packages/common/src/store/ui/publish-playlist-confirmation-modal/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/ui/publish-track-confirmation-modal/selectors.ts b/packages/common/src/store/ui/publish-track-confirmation-modal/selectors.ts index 6fa4dc2f481..f3b9d088ee1 100644 --- a/packages/common/src/store/ui/publish-track-confirmation-modal/selectors.ts +++ b/packages/common/src/store/ui/publish-track-confirmation-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getConfirmCallback = (state: CommonState) => state.ui.publishTrackConfirmationModal.confirmCallback diff --git a/packages/common/src/store/ui/reactions/selectors.ts b/packages/common/src/store/ui/reactions/selectors.ts new file mode 100644 index 00000000000..095863aef86 --- /dev/null +++ b/packages/common/src/store/ui/reactions/selectors.ts @@ -0,0 +1,7 @@ +import { CommonState } from '~/store/reducers' + +export const makeGetReactionForSignature = + (signature: string) => (state: CommonState) => + state.ui.reactions.reactionsForEntityMap[signature] + +export const selectors = { makeGetReactionForSignature } diff --git a/packages/common/src/store/ui/reactions/slice.ts b/packages/common/src/store/ui/reactions/slice.ts index ac60234441f..c70f544c345 100644 --- a/packages/common/src/store/ui/reactions/slice.ts +++ b/packages/common/src/store/ui/reactions/slice.ts @@ -1,7 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { Nullable } from '../../../utils/typeUtils' -import { CommonState } from '../../commonStore' import { ReactionTypes } from './types' @@ -48,10 +47,6 @@ const slice = createSlice({ } }) -export const makeGetReactionForSignature = - (signature: string) => (state: CommonState) => - state.ui.reactions.reactionsForEntityMap[signature] - export const { setLocalReactionValues, writeReactionValue, @@ -60,4 +55,3 @@ export const { export const actions = slice.actions export default slice.reducer -export const selectors = { makeGetReactionForSignature } diff --git a/packages/common/src/store/ui/related-artists/sagas.ts b/packages/common/src/store/ui/related-artists/sagas.ts index 20f055d4f62..152c06478b1 100644 --- a/packages/common/src/store/ui/related-artists/sagas.ts +++ b/packages/common/src/store/ui/related-artists/sagas.ts @@ -2,13 +2,13 @@ import { PayloadAction } from '@reduxjs/toolkit' import { shuffle } from 'lodash' import { call, put, select, takeEvery } from 'typed-redux-saga' -import { ID, UserMetadata } from 'models' -import { DoubleKeys } from 'services/remote-config' -import { accountSelectors } from 'store/account' -import { processAndCacheUsers } from 'store/cache' -import { getContext } from 'store/effects' -import { waitForRead } from 'utils/sagaHelpers' -import { removeNullable } from 'utils/typeUtils' +import { ID, UserMetadata } from '~/models' +import { DoubleKeys } from '~/services/remote-config' +import { accountSelectors } from '~/store/account' +import { processAndCacheUsers } from '~/store/cache' +import { getContext } from '~/store/effects' +import { waitForRead } from '~/utils/sagaHelpers' +import { removeNullable } from '~/utils/typeUtils' import { actions as relatedArtistsActions } from './slice' diff --git a/packages/common/src/store/ui/related-artists/selectors.ts b/packages/common/src/store/ui/related-artists/selectors.ts index 4c121b28040..506e976cb11 100644 --- a/packages/common/src/store/ui/related-artists/selectors.ts +++ b/packages/common/src/store/ui/related-artists/selectors.ts @@ -1,7 +1,7 @@ -import { ID, User } from 'models' -import { getUsers } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { removeNullable, createDeepEqualSelector } from 'utils' +import { ID, User } from '~/models' +import { getUsers } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { removeNullable, createDeepEqualSelector } from '~/utils' import { relatedArtistsAdapater } from './slice' diff --git a/packages/common/src/store/ui/related-artists/slice.ts b/packages/common/src/store/ui/related-artists/slice.ts index 1d38d163f03..6f4d02b8710 100644 --- a/packages/common/src/store/ui/related-artists/slice.ts +++ b/packages/common/src/store/ui/related-artists/slice.ts @@ -4,7 +4,7 @@ import { PayloadAction } from '@reduxjs/toolkit' -import { ID, Status } from 'models' +import { ID, Status } from '~/models' import { RelatedArtists } from './types' diff --git a/packages/common/src/store/ui/related-artists/types.ts b/packages/common/src/store/ui/related-artists/types.ts index 0061a1ba740..6c10361d88e 100644 --- a/packages/common/src/store/ui/related-artists/types.ts +++ b/packages/common/src/store/ui/related-artists/types.ts @@ -1,6 +1,6 @@ import { EntityState } from '@reduxjs/toolkit' -import { ID, Status } from 'models' +import { ID, Status } from '~/models' export type RelatedArtists = { artistId: ID diff --git a/packages/common/src/store/ui/search-users-modal/sagas.ts b/packages/common/src/store/ui/search-users-modal/sagas.ts index 5d098861198..23570d84492 100644 --- a/packages/common/src/store/ui/search-users-modal/sagas.ts +++ b/packages/common/src/store/ui/search-users-modal/sagas.ts @@ -1,12 +1,12 @@ import { call, put, select, takeLatest } from 'typed-redux-saga' -import { User } from 'models/User' -import { accountSelectors } from 'store/account' -import { processAndCacheUsers } from 'store/cache/users/utils' -import { getContext } from 'store/effects' -import { SearchKind } from 'store/pages/search-results/types' -import * as searchUsersModalSelectors from 'store/ui/search-users-modal/selectors' -import { actions as searchUsersModalActions } from 'store/ui/search-users-modal/slice' +import { User } from '~/models/User' +import { accountSelectors } from '~/store/account' +import { processAndCacheUsers } from '~/store/cache/users/utils' +import { getContext } from '~/store/effects' +import { SearchKind } from '~/store/pages/search-results/types' +import * as searchUsersModalSelectors from '~/store/ui/search-users-modal/selectors' +import { actions as searchUsersModalActions } from '~/store/ui/search-users-modal/slice' const { getUserId } = accountSelectors const { searchUsers, searchUsersSucceeded } = searchUsersModalActions diff --git a/packages/common/src/store/ui/search-users-modal/selectors.ts b/packages/common/src/store/ui/search-users-modal/selectors.ts index 59f4d2546d3..44691cc74c3 100644 --- a/packages/common/src/store/ui/search-users-modal/selectors.ts +++ b/packages/common/src/store/ui/search-users-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getUserList = (state: CommonState) => state.ui.searchUsersModal.userList diff --git a/packages/common/src/store/ui/search-users-modal/slice.ts b/packages/common/src/store/ui/search-users-modal/slice.ts index a847dba4d2a..122b592c337 100644 --- a/packages/common/src/store/ui/search-users-modal/slice.ts +++ b/packages/common/src/store/ui/search-users-modal/slice.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { ID } from 'models/Identifiers' -import { Status } from 'models/Status' +import { ID } from '~/models/Identifiers' +import { Status } from '~/models/Status' export type SearchUsersModalState = { userList: { diff --git a/packages/common/src/store/ui/share-modal/sagas.ts b/packages/common/src/store/ui/share-modal/sagas.ts index 2164b8e1ce6..de03686c23e 100644 --- a/packages/common/src/store/ui/share-modal/sagas.ts +++ b/packages/common/src/store/ui/share-modal/sagas.ts @@ -1,9 +1,9 @@ import { takeEvery, put, select } from 'typed-redux-saga' -import { getCollection as getCollectionBase } from 'store/cache/collections/selectors' -import { getTrack as getTrackBase } from 'store/cache/tracks/selectors' -import { getUser as getUserBase } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' +import { getCollection as getCollectionBase } from '~/store/cache/collections/selectors' +import { getTrack as getTrackBase } from '~/store/cache/tracks/selectors' +import { getUser as getUserBase } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models' import { setVisibility } from '../modals/parentSlice' diff --git a/packages/common/src/store/ui/share-modal/selectors.ts b/packages/common/src/store/ui/share-modal/selectors.ts index 370f65f0b9c..17b9adb5c99 100644 --- a/packages/common/src/store/ui/share-modal/selectors.ts +++ b/packages/common/src/store/ui/share-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const shareModalState = (state: CommonState) => state.ui.shareModal diff --git a/packages/common/src/store/ui/share-modal/types.ts b/packages/common/src/store/ui/share-modal/types.ts index c125f8c688b..46694b00f54 100644 --- a/packages/common/src/store/ui/share-modal/types.ts +++ b/packages/common/src/store/ui/share-modal/types.ts @@ -1,6 +1,6 @@ import { PayloadAction } from '@reduxjs/toolkit' -import { Nullable } from 'utils/typeUtils' +import { Nullable } from '~/utils/typeUtils' import { ID, ShareSource, Collection, Track, User } from '../../../models' diff --git a/packages/common/src/store/ui/share-sound-to-tiktok-modal/selectors.ts b/packages/common/src/store/ui/share-sound-to-tiktok-modal/selectors.ts index cf7b72d068d..0e2493eae51 100644 --- a/packages/common/src/store/ui/share-sound-to-tiktok-modal/selectors.ts +++ b/packages/common/src/store/ui/share-sound-to-tiktok-modal/selectors.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit' -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' const shareSoundToTikTokModalState = (state: CommonState) => state.ui.shareSoundToTikTokModal diff --git a/packages/common/src/store/ui/stripe-modal/sagaHelpers.ts b/packages/common/src/store/ui/stripe-modal/sagaHelpers.ts index df8cf94e9e7..1b1070187e1 100644 --- a/packages/common/src/store/ui/stripe-modal/sagaHelpers.ts +++ b/packages/common/src/store/ui/stripe-modal/sagaHelpers.ts @@ -1,8 +1,8 @@ import { call } from 'typed-redux-saga' -import { Name, StripeEventFields } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' -import { getContext } from 'store/effects' +import { Name, StripeEventFields } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' +import { getContext } from '~/store/effects' import { StripeSessionData } from './types' diff --git a/packages/common/src/store/ui/stripe-modal/sagas.ts b/packages/common/src/store/ui/stripe-modal/sagas.ts index b559c438070..f8010ae3313 100644 --- a/packages/common/src/store/ui/stripe-modal/sagas.ts +++ b/packages/common/src/store/ui/stripe-modal/sagas.ts @@ -10,10 +10,10 @@ import { FixedTask } from 'typed-redux-saga' -import { Name } from 'models/Analytics' -import { ErrorLevel } from 'models/ErrorReporting' -import { createStripeSession } from 'services/audius-backend/stripe' -import { getContext } from 'store/effects' +import { Name } from '~/models/Analytics' +import { ErrorLevel } from '~/models/ErrorReporting' +import { createStripeSession } from '~/services/audius-backend/stripe' +import { getContext } from '~/store/effects' import { setVisibility } from '../modals/parentSlice' import { toast } from '../toast/slice' diff --git a/packages/common/src/store/ui/stripe-modal/selectors.ts b/packages/common/src/store/ui/stripe-modal/selectors.ts index abb79b5d9db..5467b7f04d8 100644 --- a/packages/common/src/store/ui/stripe-modal/selectors.ts +++ b/packages/common/src/store/ui/stripe-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getStripeModalState = (state: CommonState) => state.ui.stripeModal diff --git a/packages/common/src/store/ui/stripe-modal/types.ts b/packages/common/src/store/ui/stripe-modal/types.ts index 1b2af7c9f9f..07aa729a2bf 100644 --- a/packages/common/src/store/ui/stripe-modal/types.ts +++ b/packages/common/src/store/ui/stripe-modal/types.ts @@ -5,7 +5,7 @@ import type { OnrampSessionStatus } from '@stripe/crypto' -import { DeepNullable, Nullable } from 'utils/typeUtils' +import { DeepNullable, Nullable } from '~/utils/typeUtils' export type StripeSessionStatus = OnrampSessionStatus diff --git a/packages/common/src/store/ui/theme/selectors.ts b/packages/common/src/store/ui/theme/selectors.ts index c781dfddc0c..d8724f84cee 100644 --- a/packages/common/src/store/ui/theme/selectors.ts +++ b/packages/common/src/store/ui/theme/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' const getBaseState = (state: CommonState) => state.ui.theme diff --git a/packages/common/src/store/ui/toast/sagas.ts b/packages/common/src/store/ui/toast/sagas.ts index d7b7737418e..a975aaa5ee2 100644 --- a/packages/common/src/store/ui/toast/sagas.ts +++ b/packages/common/src/store/ui/toast/sagas.ts @@ -1,6 +1,6 @@ import { put, takeEvery, delay } from 'typed-redux-saga' -import { uuid } from 'utils/uid' +import { uuid } from '~/utils/uid' import { registerToast, dismissToast, toast } from './slice' import { ToastAction } from './types' diff --git a/packages/common/src/store/ui/toast/selectors.ts b/packages/common/src/store/ui/toast/selectors.ts index 7cd5dfade68..244f4479a0c 100644 --- a/packages/common/src/store/ui/toast/selectors.ts +++ b/packages/common/src/store/ui/toast/selectors.ts @@ -1,3 +1,3 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getToasts = (state: CommonState) => state.ui.toast.toasts diff --git a/packages/common/src/store/ui/transaction-details/selectors.ts b/packages/common/src/store/ui/transaction-details/selectors.ts index c4ba12aac59..417d3d0ec28 100644 --- a/packages/common/src/store/ui/transaction-details/selectors.ts +++ b/packages/common/src/store/ui/transaction-details/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/reducers' +import { CommonState } from '~/store/reducers' export const getTransactionDetails = (state: CommonState) => state.ui.transactionDetails diff --git a/packages/common/src/store/ui/upload-confirmation-modal/selectors.ts b/packages/common/src/store/ui/upload-confirmation-modal/selectors.ts index fff90a38603..e67cebfcdb5 100644 --- a/packages/common/src/store/ui/upload-confirmation-modal/selectors.ts +++ b/packages/common/src/store/ui/upload-confirmation-modal/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getHasPublicTracks = (state: CommonState) => state.ui.uploadConfirmationModal.hasPublicTracks diff --git a/packages/common/src/store/ui/withdraw-usdc/selectors.ts b/packages/common/src/store/ui/withdraw-usdc/selectors.ts index ecf8587485e..0d4ff7d21a5 100644 --- a/packages/common/src/store/ui/withdraw-usdc/selectors.ts +++ b/packages/common/src/store/ui/withdraw-usdc/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getWithdrawDestinationAddress = (state: CommonState) => { return state.withdrawUSDC.destinationAddress diff --git a/packages/common/src/store/ui/withdraw-usdc/slice.ts b/packages/common/src/store/ui/withdraw-usdc/slice.ts index d805d14e60c..366bc77ad11 100644 --- a/packages/common/src/store/ui/withdraw-usdc/slice.ts +++ b/packages/common/src/store/ui/withdraw-usdc/slice.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { Status } from 'models/Status' +import { Status } from '~/models/Status' import { CoinflowWithdrawState, WithdrawMethod } from './types' diff --git a/packages/common/src/store/user-list/favorites/selectors.ts b/packages/common/src/store/user-list/favorites/selectors.ts index cde3ff58242..44619d9e4f5 100644 --- a/packages/common/src/store/user-list/favorites/selectors.ts +++ b/packages/common/src/store/user-list/favorites/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { FavoriteType } from '../../../models/Favorite' import { ID } from '../../../models/Identifiers' diff --git a/packages/common/src/store/user-list/favorites/types.ts b/packages/common/src/store/user-list/favorites/types.ts index 072879e6b98..c5b94898a60 100644 --- a/packages/common/src/store/user-list/favorites/types.ts +++ b/packages/common/src/store/user-list/favorites/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID, FavoriteType } from '../../../models' diff --git a/packages/common/src/store/user-list/followers/selectors.ts b/packages/common/src/store/user-list/followers/selectors.ts index 6c01b3690f9..b70a8f10b5b 100644 --- a/packages/common/src/store/user-list/followers/selectors.ts +++ b/packages/common/src/store/user-list/followers/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/followers/types.ts b/packages/common/src/store/user-list/followers/types.ts index f3200842e90..47fa8ca438f 100644 --- a/packages/common/src/store/user-list/followers/types.ts +++ b/packages/common/src/store/user-list/followers/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/following/selectors.ts b/packages/common/src/store/user-list/following/selectors.ts index d89191f112e..1791f5f6327 100644 --- a/packages/common/src/store/user-list/following/selectors.ts +++ b/packages/common/src/store/user-list/following/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/following/types.ts b/packages/common/src/store/user-list/following/types.ts index ad90cf77b8e..54643ccf421 100644 --- a/packages/common/src/store/user-list/following/types.ts +++ b/packages/common/src/store/user-list/following/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/mutuals/reducers.ts b/packages/common/src/store/user-list/mutuals/reducers.ts index 54999ee47d0..408ac073107 100644 --- a/packages/common/src/store/user-list/mutuals/reducers.ts +++ b/packages/common/src/store/user-list/mutuals/reducers.ts @@ -1,7 +1,7 @@ import { combineReducers } from 'redux' import { createReducer, ActionType } from 'typesafe-actions' -import { UserListReducerFactory } from 'store/user-list/reducer' +import { UserListReducerFactory } from '~/store/user-list/reducer' import * as actions from './actions' import { MUTUALS_USER_LIST_TAG, MutualsOwnState } from './types' diff --git a/packages/common/src/store/user-list/mutuals/selectors.ts b/packages/common/src/store/user-list/mutuals/selectors.ts index 87ca7f3de4e..e6615b9bacc 100644 --- a/packages/common/src/store/user-list/mutuals/selectors.ts +++ b/packages/common/src/store/user-list/mutuals/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' export const getId = (state: CommonState) => state.ui.userList.mutuals.mutualsPage.id diff --git a/packages/common/src/store/user-list/mutuals/types.ts b/packages/common/src/store/user-list/mutuals/types.ts index 91c43ba6296..670947b2aa6 100644 --- a/packages/common/src/store/user-list/mutuals/types.ts +++ b/packages/common/src/store/user-list/mutuals/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/notifications/reducers.ts b/packages/common/src/store/user-list/notifications/reducers.ts index 2efde9b63ed..17a8d483be1 100644 --- a/packages/common/src/store/user-list/notifications/reducers.ts +++ b/packages/common/src/store/user-list/notifications/reducers.ts @@ -1,7 +1,7 @@ import { combineReducers } from 'redux' import { createReducer, ActionType } from 'typesafe-actions' -import { UserListReducerFactory } from 'store/user-list/reducer' +import { UserListReducerFactory } from '~/store/user-list/reducer' import * as actions from './actions' import { diff --git a/packages/common/src/store/user-list/notifications/selectors.ts b/packages/common/src/store/user-list/notifications/selectors.ts index e087bcb45f0..e407022f3fb 100644 --- a/packages/common/src/store/user-list/notifications/selectors.ts +++ b/packages/common/src/store/user-list/notifications/selectors.ts @@ -1,7 +1,7 @@ -import { CommonState } from 'store/commonStore' -import { getNotificationById } from 'store/notifications/selectors' -import { NotificationType } from 'store/notifications/types' -import { formatCount } from 'utils/formatUtil' +import { CommonState } from '~/store/commonStore' +import { getNotificationById } from '~/store/notifications/selectors' +import { NotificationType } from '~/store/notifications/types' +import { formatCount } from '~/utils/formatUtil' const getBaseState = (state: CommonState) => state.ui.userList.notifications diff --git a/packages/common/src/store/user-list/notifications/types.ts b/packages/common/src/store/user-list/notifications/types.ts index 215434acf8e..db5f61ea56f 100644 --- a/packages/common/src/store/user-list/notifications/types.ts +++ b/packages/common/src/store/user-list/notifications/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' export const NOTIFICATIONS_USER_LIST_TAG = 'NOTIFICATION' diff --git a/packages/common/src/store/user-list/related-artists/selectors.ts b/packages/common/src/store/user-list/related-artists/selectors.ts index f7a6c9ff500..4e8f9e30c78 100644 --- a/packages/common/src/store/user-list/related-artists/selectors.ts +++ b/packages/common/src/store/user-list/related-artists/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/related-artists/types.ts b/packages/common/src/store/user-list/related-artists/types.ts index 23088439eb7..523811e3a4b 100644 --- a/packages/common/src/store/user-list/related-artists/types.ts +++ b/packages/common/src/store/user-list/related-artists/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/reposts/selectors.ts b/packages/common/src/store/user-list/reposts/selectors.ts index 13b3e1b6ecf..e9a09ecd346 100644 --- a/packages/common/src/store/user-list/reposts/selectors.ts +++ b/packages/common/src/store/user-list/reposts/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/reposts/types.ts b/packages/common/src/store/user-list/reposts/types.ts index a0299315be5..f66c5a3d222 100644 --- a/packages/common/src/store/user-list/reposts/types.ts +++ b/packages/common/src/store/user-list/reposts/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/sagas.ts b/packages/common/src/store/user-list/sagas.ts index af28cc38ac7..45bc8352773 100644 --- a/packages/common/src/store/user-list/sagas.ts +++ b/packages/common/src/store/user-list/sagas.ts @@ -1,7 +1,7 @@ import { call, put, takeLatest, select, all } from 'redux-saga/effects' -import { CommonState } from 'store/commonStore' -import { toErrorWithMessage } from 'utils/error' +import { CommonState } from '~/store/commonStore' +import { toErrorWithMessage } from '~/utils/error' import * as userListActions from './actions' import { FetchUserIdsSaga, UserListStoreState } from './types' diff --git a/packages/common/src/store/user-list/selectors.ts b/packages/common/src/store/user-list/selectors.ts index 9edd8b53c68..5eab872b79f 100644 --- a/packages/common/src/store/user-list/selectors.ts +++ b/packages/common/src/store/user-list/selectors.ts @@ -5,10 +5,10 @@ import { getOptimisticSupporting, getSupportersOverrides, getSupportingOverrides -} from 'store/tipping/selectors' -import { getId as getSupportingId } from 'store/user-list/supporting/selectors' -import { getId as getSupportersId } from 'store/user-list/top-supporters/selectors' -import { stringWeiToBN } from 'utils/wallet' +} from '~/store/tipping/selectors' +import { getId as getSupportingId } from '~/store/user-list/supporting/selectors' +import { getId as getSupportersId } from '~/store/user-list/top-supporters/selectors' +import { stringWeiToBN } from '~/utils/wallet' import { ID } from '../../models' diff --git a/packages/common/src/store/user-list/supporting/selectors.ts b/packages/common/src/store/user-list/supporting/selectors.ts index d6f81d74d26..42b408148c5 100644 --- a/packages/common/src/store/user-list/supporting/selectors.ts +++ b/packages/common/src/store/user-list/supporting/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/supporting/types.ts b/packages/common/src/store/user-list/supporting/types.ts index 7852cb4613d..47bb0560caf 100644 --- a/packages/common/src/store/user-list/supporting/types.ts +++ b/packages/common/src/store/user-list/supporting/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/user-list/top-supporters/selectors.ts b/packages/common/src/store/user-list/top-supporters/selectors.ts index 03e79ba6c83..62d99190fa4 100644 --- a/packages/common/src/store/user-list/top-supporters/selectors.ts +++ b/packages/common/src/store/user-list/top-supporters/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from 'store/commonStore' +import { CommonState } from '~/store/commonStore' import { ID } from '../../../models/Identifiers' import { UserListStoreState } from '../types' diff --git a/packages/common/src/store/user-list/top-supporters/types.ts b/packages/common/src/store/user-list/top-supporters/types.ts index f4ea29210b7..548b11d547f 100644 --- a/packages/common/src/store/user-list/top-supporters/types.ts +++ b/packages/common/src/store/user-list/top-supporters/types.ts @@ -1,4 +1,4 @@ -import { UserListStoreState } from 'store/user-list/types' +import { UserListStoreState } from '~/store/user-list/types' import { ID } from '../../../models' diff --git a/packages/common/src/store/wallet/selectors.ts b/packages/common/src/store/wallet/selectors.ts index fa4a3674df8..f7859679a9d 100644 --- a/packages/common/src/store/wallet/selectors.ts +++ b/packages/common/src/store/wallet/selectors.ts @@ -1,10 +1,10 @@ import { createSelector } from '@reduxjs/toolkit' import BN from 'bn.js' -import { BNUSDC } from 'models/Wallet' -import { CommonState } from 'store/commonStore' -import { Nullable, isNullOrUndefined } from 'utils/typeUtils' -import { stringWeiToBN } from 'utils/wallet' +import { BNUSDC } from '~/models/Wallet' +import { CommonState } from '~/store/commonStore' +import { Nullable, isNullOrUndefined } from '~/utils/typeUtils' +import { stringWeiToBN } from '~/utils/wallet' // Previously, the getAccountBalance selector would return different // values (although numerically the same) because of the return of a diff --git a/packages/common/src/store/wallet/slice.ts b/packages/common/src/store/wallet/slice.ts index 67773bc192f..e1f51b9fe2d 100644 --- a/packages/common/src/store/wallet/slice.ts +++ b/packages/common/src/store/wallet/slice.ts @@ -1,7 +1,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' import BN from 'bn.js' -import { isNullOrUndefined, Nullable } from 'utils/typeUtils' +import { isNullOrUndefined, Nullable } from '~/utils/typeUtils' import { Chain } from '../../models/Chain' import { StringUSDC, StringWei } from '../../models/Wallet' diff --git a/packages/common/src/store/wallet/utils.ts b/packages/common/src/store/wallet/utils.ts index ebd701c940d..67c217225b8 100644 --- a/packages/common/src/store/wallet/utils.ts +++ b/packages/common/src/store/wallet/utils.ts @@ -1,9 +1,9 @@ import { createSelector } from 'reselect' -import { getAccountUser } from 'store/account/selectors' -import { getUser } from 'store/cache/users/selectors' -import { CommonState } from 'store/commonStore' -import { stringAudioToBN, stringWeiToAudioBN } from 'utils/wallet' +import { getAccountUser } from '~/store/account/selectors' +import { getUser } from '~/store/cache/users/selectors' +import { CommonState } from '~/store/commonStore' +import { stringAudioToBN, stringWeiToAudioBN } from '~/utils/wallet' import { BadgeTier } from '../../models/BadgeTier' import { ID } from '../../models/Identifiers' diff --git a/packages/common/src/utils/allSettled.ts b/packages/common/src/utils/allSettled.ts index 14b5af333b3..880cd08dabe 100644 --- a/packages/common/src/utils/allSettled.ts +++ b/packages/common/src/utils/allSettled.ts @@ -1,17 +1,17 @@ -export const allSettled = - // eslint-disable-next-line no-restricted-properties - Promise.allSettled.bind(Promise) || - ((promises: any[]) => - Promise.all( - promises.map((p: Promise) => - p - .then((value: any) => ({ - status: 'fulfilled', - value - })) - .catch((reason: any) => ({ - status: 'rejected', - reason - })) +/* eslint-disable no-restricted-properties */ +export const allSettled = Promise.allSettled + ? Promise.allSettled.bind(Promise) + : (promises: any[]) => + Promise.all( + promises.map((p: Promise) => + p + .then((value: any) => ({ + status: 'fulfilled', + value + })) + .catch((reason: any) => ({ + status: 'rejected', + reason + })) + ) ) - )) diff --git a/packages/common/src/utils/challenges.ts b/packages/common/src/utils/challenges.ts index 61c5ac60a0b..b70f7053f4f 100644 --- a/packages/common/src/utils/challenges.ts +++ b/packages/common/src/utils/challenges.ts @@ -1,4 +1,4 @@ -import { UndisbursedUserChallenge } from 'store/pages' +import { UndisbursedUserChallenge } from '~/store/pages' import { ChallengeRewardID, diff --git a/packages/common/src/utils/chatUtils.ts b/packages/common/src/utils/chatUtils.ts index 2f564813470..5e207fa9a82 100644 --- a/packages/common/src/utils/chatUtils.ts +++ b/packages/common/src/utils/chatUtils.ts @@ -1,6 +1,6 @@ import type { ChatMessage } from '@audius/sdk' -import { Status } from 'models/Status' +import { Status } from '~/models/Status' import { MESSAGE_GROUP_THRESHOLD_MINUTES } from './constants' import dayjs from './dayjs' diff --git a/packages/common/src/utils/collectionUtils.ts b/packages/common/src/utils/collectionUtils.ts index 207acb897e4..3bb2b2f9000 100644 --- a/packages/common/src/utils/collectionUtils.ts +++ b/packages/common/src/utils/collectionUtils.ts @@ -1,5 +1,5 @@ -import { AccountCollection } from 'store/account' -import { EnhancedCollection } from 'store/cache/collections/selectors' +import { AccountCollection } from '~/store/account' +import { EnhancedCollection } from '~/store/cache/collections/selectors' type FilterCollectionsOptions = { filterText?: string diff --git a/packages/common/src/utils/dogEarUtils.ts b/packages/common/src/utils/dogEarUtils.ts index 17a3e32aa7f..dfd0e9006c7 100644 --- a/packages/common/src/utils/dogEarUtils.ts +++ b/packages/common/src/utils/dogEarUtils.ts @@ -1,7 +1,7 @@ import { isEmpty } from 'lodash' -import { DogEarType } from 'models/DogEar' -import { AccessConditions } from 'models/Track' +import { DogEarType } from '~/models/DogEar' +import { AccessConditions } from '~/models/Track' import { Nullable } from './typeUtils' diff --git a/packages/common/src/utils/formatUtil.test.ts b/packages/common/src/utils/formatUtil.test.ts index b2e87d692c4..edb925130b9 100644 --- a/packages/common/src/utils/formatUtil.test.ts +++ b/packages/common/src/utils/formatUtil.test.ts @@ -1,7 +1,7 @@ import { AUDIO, FixedDecimal, USDC, wAUDIO } from '@audius/fixed-decimal' import BN from 'bn.js' -import { BNWei } from 'models/Wallet' +import { BNWei } from '~/models/Wallet' import { formatCurrencyBalance, diff --git a/packages/common/src/utils/formatUtil.ts b/packages/common/src/utils/formatUtil.ts index 350daa4a635..b68531ad32e 100644 --- a/packages/common/src/utils/formatUtil.ts +++ b/packages/common/src/utils/formatUtil.ts @@ -1,7 +1,7 @@ import BN from 'bn.js' import numeral from 'numeral' -import { BNWei } from 'models/Wallet' +import { BNWei } from '~/models/Wallet' import dayjs from './dayjs' diff --git a/packages/common/src/utils/index.ts b/packages/common/src/utils/index.ts index 751a5e07ba3..9b9d9225ab7 100644 --- a/packages/common/src/utils/index.ts +++ b/packages/common/src/utils/index.ts @@ -23,7 +23,7 @@ export * from './constants' export * from './stringUtils' export * from './challenges' export * as creativeCommons from './creativeCommons' -export { License } from './creativeCommons' +export type { License } from './creativeCommons' export * from './array' export * from './chatUtils' export * from './twitter' diff --git a/packages/common/src/utils/passwordListLazyLoader.ts b/packages/common/src/utils/passwordListLazyLoader.ts index 003a694bd83..379f8eae1cf 100644 --- a/packages/common/src/utils/passwordListLazyLoader.ts +++ b/packages/common/src/utils/passwordListLazyLoader.ts @@ -1,3 +1,4 @@ +import '../types/fxa-common-password-list/index.d.ts' import commonPasswordList from 'fxa-common-password-list' export { commonPasswordList } diff --git a/packages/common/src/utils/sagaHelpers.ts b/packages/common/src/utils/sagaHelpers.ts index 20b0562e65f..94fd814fd3f 100644 --- a/packages/common/src/utils/sagaHelpers.ts +++ b/packages/common/src/utils/sagaHelpers.ts @@ -14,7 +14,7 @@ import { } from 'typed-redux-saga' import { Action } from 'typesafe-actions' -import { waitForReachability } from 'store/reachability/sagas' +import { waitForReachability } from '~/store/reachability/sagas' import { Status } from '../models/Status' diff --git a/packages/common/src/utils/streaming.ts b/packages/common/src/utils/streaming.ts index d08cd88c1ea..4ab0baf0923 100644 --- a/packages/common/src/utils/streaming.ts +++ b/packages/common/src/utils/streaming.ts @@ -1,5 +1,5 @@ -import { AccessSignature, Track } from 'models' -import { AudiusBackend, QueryParams } from 'services/index' +import { AccessSignature, Track } from '~/models' +import { AudiusBackend, QueryParams } from '~/services/index' import { Nullable } from './typeUtils' diff --git a/packages/common/src/utils/uid.ts b/packages/common/src/utils/uid.ts index b87965a86c9..8bba1b332fb 100644 --- a/packages/common/src/utils/uid.ts +++ b/packages/common/src/utils/uid.ts @@ -1,6 +1,6 @@ // Auto-increment the uid so that items with the -import { ID } from 'models/Identifiers' +import { ID } from '~/models/Identifiers' // same kind, id, and source have unique IDs let count = 0 diff --git a/packages/common/src/utils/updatePlaylistArtwork.ts b/packages/common/src/utils/updatePlaylistArtwork.ts index 6fa5d54e04d..f9bbd1d431b 100644 --- a/packages/common/src/utils/updatePlaylistArtwork.ts +++ b/packages/common/src/utils/updatePlaylistArtwork.ts @@ -1,9 +1,9 @@ import { isEqual } from 'lodash' -import { Collection } from 'models/Collection' -import { SquareSizes } from 'models/ImageSizes' -import { Track } from 'models/Track' -import { AudiusBackend } from 'services/audius-backend' +import { Collection } from '~/models/Collection' +import { SquareSizes } from '~/models/ImageSizes' +import { Track } from '~/models/Track' +import { AudiusBackend } from '~/services/audius-backend' import { Nullable } from './typeUtils' diff --git a/packages/common/src/utils/wallet.test.ts b/packages/common/src/utils/wallet.test.ts index 90ff6d34b10..2c1123d4a66 100644 --- a/packages/common/src/utils/wallet.test.ts +++ b/packages/common/src/utils/wallet.test.ts @@ -1,7 +1,7 @@ import { AUDIO, wAUDIO, USDC, FixedDecimal } from '@audius/fixed-decimal' import BN from 'bn.js' -import { BNWei, BNUSDC } from 'models/Wallet' +import { BNWei, BNUSDC } from '~/models/Wallet' import { parseAudioInputToWei, diff --git a/packages/common/src/utils/wallet.ts b/packages/common/src/utils/wallet.ts index 33e7baa1196..e97c7e009ce 100644 --- a/packages/common/src/utils/wallet.ts +++ b/packages/common/src/utils/wallet.ts @@ -7,8 +7,8 @@ import { StringAudio, StringUSDC, StringWei -} from 'models/Wallet' -import { AmountObject } from 'store/ui' +} from '~/models/Wallet' +import { AmountObject } from '~/store/ui' import { WEI_DIVISOR, trimRightZeros, @@ -16,8 +16,8 @@ import { formatWeiToAudioString, parseWeiNumber, convertFloatToWei -} from 'utils/formatUtil' -import { Nullable } from 'utils/typeUtils' +} from '~/utils/formatUtil' +import { Nullable } from '~/utils/typeUtils' /** AUDIO utils */ const WEI_DECIMALS = 18 // 18 decimals on ETH AUDIO diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index d931a4b57c7..d107299800d 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -3,16 +3,7 @@ "outDir": "dist", "baseUrl": ".", "paths": { - "audius-query": ["src/audius-query/index.ts"], - "assets/*": ["src/assets/*"], - "hooks/*": ["src/hooks/*"], - "models/*": ["src/models/*"], - "models": ["src/models"], - "schemas/*": ["src/schemas/*"], - "services/*": ["src/services/*"], - "store/*": ["src/store/*"], - "utils/*": ["src/utils/*"], - "utils": ["src/utils"] + "~/*": ["src/*"] }, "plugins": [ { "transform": "typescript-transform-paths" }, diff --git a/packages/harmony/package.json b/packages/harmony/package.json index 7d961100027..2c18543757d 100644 --- a/packages/harmony/package.json +++ b/packages/harmony/package.json @@ -37,6 +37,7 @@ "@emotion/styled": "11.11.0", "@radix-ui/react-slot": "1.0.2", "@react-spring/web": "9.7.2", + "@rollup/plugin-alias": "5.0.1", "@storybook/addon-a11y": "7.4.0", "@storybook/addon-actions": "7.4.2", "@storybook/addon-essentials": "7.4.2", diff --git a/packages/harmony/rollup.config.mjs b/packages/harmony/rollup.config.mjs index 01e56667f5e..c5d40ac492c 100644 --- a/packages/harmony/rollup.config.mjs +++ b/packages/harmony/rollup.config.mjs @@ -4,6 +4,7 @@ import svgr from '@svgr/rollup' import json from 'rollup-plugin-json' import postcss from 'rollup-plugin-postcss' import rollupTypescript from 'rollup-plugin-typescript2' +import alias from '@rollup/plugin-alias' import pkg from './package.json' assert { type: 'json' } @@ -32,6 +33,10 @@ export default { ], plugins: [ json(), + alias({ + // Properly resolve json files from assets folder + entries: [{ find: /^assets\/(.*)/, replacement: 'src/assets/$1' }] + }), postcss({ minimize: true, extract: 'harmony.css', diff --git a/packages/libs/package.json b/packages/libs/package.json index 961e2f33a9a..b125f455765 100644 --- a/packages/libs/package.json +++ b/packages/libs/package.json @@ -31,13 +31,13 @@ "test:unit:watch": "ts-mocha 'src/[!sdk]**/*.test.{js,ts}' --ignore 'src/sdk/**/*.test.{js,ts}' --watch", "test:integration": "ts-mocha tests/index.js", "setup": "./scripts/migrate_contracts.sh", - "build": "rollup -c --configPlugin typescript", - "build:sdk": "rollup -c rollup.sdk.config.ts --configPlugin typescript", - "build:sdk:browser": "rollup -c rollup.sdk.browser.config.ts --configPlugin typescript", - "build:sdk:browser:dist": "rollup -c rollup.sdk.browser.dist.config.ts --configPlugin typescript", - "build:sdk:native": "rollup -c rollup.sdk.native.config.ts --configPlugin typescript", - "build:legacy:browser": "rollup -c rollup.legacy.browser.config.ts --configPlugin typescript", - "build:legacy:native": "rollup -c rollup.legacy.native.config.ts --configPlugin typescript", + "build": "rm -rf ./dist && rollup -c --configPlugin typescript", + "build:sdk": "rm -rf ./dist && rollup -c rollup.sdk.config.ts --configPlugin typescript", + "build:sdk:browser": "rm -rf ./dist && rollup -c rollup.sdk.browser.config.ts --configPlugin typescript", + "build:sdk:browser:dist": "rm -rf ./dist && rollup -c rollup.sdk.browser.dist.config.ts --configPlugin typescript", + "build:sdk:native": "rm -rf ./dist && rollup -c rollup.sdk.native.config.ts --configPlugin typescript", + "build:legacy:browser": "rm -rf ./dist && rollup -c rollup.legacy.browser.config.ts --configPlugin typescript", + "build:legacy:native": "rm -rf ./dist && rollup -c rollup.legacy.native.config.ts --configPlugin typescript", "start": "rollup -c -w --configPlugin typescript", "start:sdk": "rollup -c rollup.sdk.config.ts -w --configPlugin typescript", "start:sdk:browser": "rollup -c rollup.sdk.browser.config.ts -w --configPlugin typescript", diff --git a/packages/mobile/babel.config.js b/packages/mobile/babel.config.js index d160bf0637e..9b68ff5d6f2 100644 --- a/packages/mobile/babel.config.js +++ b/packages/mobile/babel.config.js @@ -1,7 +1,27 @@ module.exports = (api) => { const babelEnv = api.env() const plugins = [ - ['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }] + ['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }], + '@babel/plugin-transform-export-namespace-from', + [ + 'module-resolver', + { + extensions: ['.js', '.jsx', '.ts', '.tsx'], + root: ['.'], + alias: { + '@audius/common/messages': '../common/src/messages', + '@audius/common/hooks': '../common/src/hooks', + '@audius/common/context': '../common/src/context', + '@audius/common/api': '../common/src/api', + '@audius/common/models': '../common/src/models', + '@audius/common/utils': '../common/src/utils', + '@audius/common/schemas': '../common/src/schemas', + '@audius/common/services': '../common/src/services', + '@audius/common/audius-query': '../common/src/audius-query', + '@audius/common/store': '../common/src/store' + } + } + ] ] if (babelEnv !== 'development') { diff --git a/packages/mobile/e2e/signUp.test.ts b/packages/mobile/e2e/signUp.test.ts index 505d14c1768..3867cc727f3 100644 --- a/packages/mobile/e2e/signUp.test.ts +++ b/packages/mobile/e2e/signUp.test.ts @@ -1,4 +1,4 @@ -import { dayjs } from '@audius/common' +import { dayjs } from '@audius/common/utils' import { device, expect } from 'detox' import { random } from 'lodash' diff --git a/packages/mobile/metro.config.js b/packages/mobile/metro.config.js index c3a2bbe7e23..c01d109d3e2 100644 --- a/packages/mobile/metro.config.js +++ b/packages/mobile/metro.config.js @@ -74,6 +74,7 @@ const config = { // Alias for 'src' to allow for absolute paths app: path.resolve(__dirname, 'src'), '@audius/harmony-native': path.resolve(__dirname, 'src/harmony-native'), + '~': path.resolve(__dirname, '../common/src'), // The following imports are needed for @audius/common // and audius-client to compile correctly diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 2fc5fe8fe4c..9cc588a92b1 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -187,6 +187,7 @@ }, "devDependencies": { "@babel/core": "7.21.0", + "@babel/plugin-transform-export-namespace-from": "7.23.4", "@babel/plugin-transform-react-jsx": "7.21.0", "@babel/preset-env": "7.20.2", "@babel/runtime": "7.21.0", @@ -214,6 +215,7 @@ "babel-jest": "29.6.3", "babel-loader": "8.3.0", "babel-plugin-macros": "3.1.0", + "babel-plugin-module-resolver": "5.0.0", "babel-plugin-transform-remove-console": "6.9.4", "detox": "20.12.1", "eslint": "8.56.0", diff --git a/packages/mobile/src/app/AppContextProvider.tsx b/packages/mobile/src/app/AppContextProvider.tsx index 88e33a72bdf..eb887291bd7 100644 --- a/packages/mobile/src/app/AppContextProvider.tsx +++ b/packages/mobile/src/app/AppContextProvider.tsx @@ -1,6 +1,6 @@ import { useMemo, type ReactNode } from 'react' -import { AppContext } from '@audius/common' +import { AppContext } from '@audius/common/context' import { useAsync } from 'react-use' import * as analytics from 'app/services/analytics' diff --git a/packages/mobile/src/app/AudiusQueryProvider.tsx b/packages/mobile/src/app/AudiusQueryProvider.tsx index 4de7fe5bb64..1e017278c71 100644 --- a/packages/mobile/src/app/AudiusQueryProvider.tsx +++ b/packages/mobile/src/app/AudiusQueryProvider.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' -import { AudiusQueryContext } from '@audius/common' +import { AudiusQueryContext } from '@audius/common/audius-query' import { env } from 'app/env' import { apiClient } from 'app/services/audius-api-client' diff --git a/packages/mobile/src/app/Drawers.tsx b/packages/mobile/src/app/Drawers.tsx index 3ed4032d86a..feea46a44e1 100644 --- a/packages/mobile/src/app/Drawers.tsx +++ b/packages/mobile/src/app/Drawers.tsx @@ -1,6 +1,6 @@ import type { ComponentType } from 'react' -import type { Modals } from '@audius/common' +import type { Modals } from '@audius/common/store' import { AddFundsDrawer } from 'app/components/add-funds-drawer/AddFundsDrawer' import { AddToCollectionDrawer } from 'app/components/add-to-collection-drawer' diff --git a/packages/mobile/src/app/ErrorBoundary.tsx b/packages/mobile/src/app/ErrorBoundary.tsx index 0b521ce3477..d6194a332b4 100644 --- a/packages/mobile/src/app/ErrorBoundary.tsx +++ b/packages/mobile/src/app/ErrorBoundary.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { PureComponent, useEffect } from 'react' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import * as Sentry from '@sentry/react-native' import { useToast } from 'app/hooks/useToast' diff --git a/packages/mobile/src/app/ThemeProvider.tsx b/packages/mobile/src/app/ThemeProvider.tsx index 4bb87b4d17b..8bc5b85ff48 100644 --- a/packages/mobile/src/app/ThemeProvider.tsx +++ b/packages/mobile/src/app/ThemeProvider.tsx @@ -1,13 +1,9 @@ import type { ReactNode } from 'react' import { useEffect } from 'react' -import type { Nullable } from '@audius/common' -import { - SystemAppearance, - Theme, - themeActions, - themeSelectors -} from '@audius/common' +import { Theme, SystemAppearance } from '@audius/common/models' +import { themeActions, themeSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import AsyncStorage from '@react-native-async-storage/async-storage' import { useAppState } from '@react-native-community/hooks' import { useDarkMode } from 'react-native-dynamic' diff --git a/packages/mobile/src/app/TrpcProvider.tsx b/packages/mobile/src/app/TrpcProvider.tsx index 06a5f0ff25d..386c963cf50 100644 --- a/packages/mobile/src/app/TrpcProvider.tsx +++ b/packages/mobile/src/app/TrpcProvider.tsx @@ -1,6 +1,6 @@ import React, { useMemo, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/action-drawer/ActionDrawer.tsx b/packages/mobile/src/components/action-drawer/ActionDrawer.tsx index 7302a593408..736bf07a984 100644 --- a/packages/mobile/src/components/action-drawer/ActionDrawer.tsx +++ b/packages/mobile/src/components/action-drawer/ActionDrawer.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { useCallback } from 'react' -import type { Modals } from '@audius/common' +import type { Modals } from '@audius/common/store' import type { TextStyle, ViewStyle } from 'react-native' import { TouchableHighlight, View } from 'react-native' import type { SetOptional } from 'type-fest' diff --git a/packages/mobile/src/components/add-funds-drawer/AddFundsDrawer.tsx b/packages/mobile/src/components/add-funds-drawer/AddFundsDrawer.tsx index c0ebb100b6a..cb02f1152ad 100644 --- a/packages/mobile/src/components/add-funds-drawer/AddFundsDrawer.tsx +++ b/packages/mobile/src/components/add-funds-drawer/AddFundsDrawer.tsx @@ -1,13 +1,12 @@ import { useCallback, useState } from 'react' +import { DEFAULT_PURCHASE_AMOUNT_CENTS } from '@audius/common/hooks' +import { PurchaseMethod, PurchaseVendor } from '@audius/common/models' import { - PurchaseVendor, - useAddFundsModal, - useUSDCManualTransferModal, buyUSDCActions, - PurchaseMethod, - DEFAULT_PURCHASE_AMOUNT_CENTS -} from '@audius/common' + useUSDCManualTransferModal, + useAddFundsModal +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/add-to-collection-drawer/AddToCollectionDrawer.tsx b/packages/mobile/src/components/add-to-collection-drawer/AddToCollectionDrawer.tsx index aa89a6518c7..0954fb26748 100644 --- a/packages/mobile/src/components/add-to-collection-drawer/AddToCollectionDrawer.tsx +++ b/packages/mobile/src/components/add-to-collection-drawer/AddToCollectionDrawer.tsx @@ -1,15 +1,14 @@ import { useCallback, useMemo } from 'react' -import type { Collection } from '@audius/common' +import type { Collection } from '@audius/common/models' +import { CreatePlaylistSource, SquareSizes } from '@audius/common/models' import { - duplicateAddConfirmationModalUIActions, - SquareSizes, - CreatePlaylistSource, accountSelectors, cacheCollectionsActions, + collectionPageSelectors, addToCollectionUISelectors, - collectionPageSelectors -} from '@audius/common' + duplicateAddConfirmationModalUIActions +} from '@audius/common/store' import { fetchAccountCollections } from 'common/store/saved-collections/actions' import { capitalize } from 'lodash' import { View } from 'react-native' diff --git a/packages/mobile/src/components/audio-balance-pill/AUDIOBalancePill.tsx b/packages/mobile/src/components/audio-balance-pill/AUDIOBalancePill.tsx index 7df29308c30..ac6bd8bc447 100644 --- a/packages/mobile/src/components/audio-balance-pill/AUDIOBalancePill.tsx +++ b/packages/mobile/src/components/audio-balance-pill/AUDIOBalancePill.tsx @@ -1,11 +1,10 @@ -import type { User } from '@audius/common' import { - accountSelectors, - formatWei, - isNullOrUndefined, useSelectTierInfo, useTotalBalanceWithFallback -} from '@audius/common' +} from '@audius/common/hooks' +import type { User } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx b/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx index 0859be1ee49..45589446cd9 100644 --- a/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx +++ b/packages/mobile/src/components/audio-breakdown-drawer/AudioBreakdownDrawer.tsx @@ -1,10 +1,11 @@ -import type { BNWei, AssociatedWallet } from '@audius/common' +import type { BNWei } from '@audius/common/models' +import { Chain } from '@audius/common/models' +import type { AssociatedWallet } from '@audius/common/store' import { - Chain, - formatWei, tokenDashboardPageSelectors, walletSelectors -} from '@audius/common' +} from '@audius/common/store' +import { formatWei } from '@audius/common/utils' import BN from 'bn.js' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx b/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx index 617c5b6d360..4bb36d89ff0 100644 --- a/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx +++ b/packages/mobile/src/components/audio-breakdown-drawer/Wallet.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' -import type { BNWei } from '@audius/common' +import type { BNWei } from '@audius/common/models' +import { Chain } from '@audius/common/models' import { formatWei, - shortenEthAddress, shortenSPLAddress, - Chain -} from '@audius/common' + shortenEthAddress +} from '@audius/common/utils' import Clipboard from '@react-native-clipboard/clipboard' import { Animated, TouchableWithoutFeedback, View } from 'react-native' diff --git a/packages/mobile/src/components/audio-rewards/RewardsBanner.tsx b/packages/mobile/src/components/audio-rewards/RewardsBanner.tsx index fd14261f5b2..caf79fcadf6 100644 --- a/packages/mobile/src/components/audio-rewards/RewardsBanner.tsx +++ b/packages/mobile/src/components/audio-rewards/RewardsBanner.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { audioRewardsPageActions, modalsActions } from '@audius/common' +import { audioRewardsPageActions, modalsActions } from '@audius/common/store' import { Text, View } from 'react-native' import LinearGradient from 'react-native-linear-gradient' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/audio-rewards/TierText.tsx b/packages/mobile/src/components/audio-rewards/TierText.tsx index 774ca9bfa60..987c48de360 100644 --- a/packages/mobile/src/components/audio-rewards/TierText.tsx +++ b/packages/mobile/src/components/audio-rewards/TierText.tsx @@ -1,4 +1,4 @@ -import type { BadgeTier } from '@audius/common' +import type { BadgeTier } from '@audius/common/models' import type { GradientTextProps } from 'app/components/core' import { GradientText } from 'app/components/core' diff --git a/packages/mobile/src/components/audio-rewards/TiersExplainerDrawer.tsx b/packages/mobile/src/components/audio-rewards/TiersExplainerDrawer.tsx index 45103366d33..57e75c0f94e 100644 --- a/packages/mobile/src/components/audio-rewards/TiersExplainerDrawer.tsx +++ b/packages/mobile/src/components/audio-rewards/TiersExplainerDrawer.tsx @@ -1,9 +1,6 @@ -import { - profilePageSelectors, - badgeTiers, - useSelectTierInfo -} from '@audius/common' -import type { BadgeTierInfo } from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import type { BadgeTierInfo } from '@audius/common/store' +import { profilePageSelectors, badgeTiers } from '@audius/common/store' import { Text, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/audio/Airplay.tsx b/packages/mobile/src/components/audio/Airplay.tsx index 49b3f339bac..b7db6c873ad 100644 --- a/packages/mobile/src/components/audio/Airplay.tsx +++ b/packages/mobile/src/components/audio/Airplay.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef } from 'react' -import { castActions } from '@audius/common' +import { castActions } from '@audius/common/store' import { requireNativeComponent, NativeEventEmitter, diff --git a/packages/mobile/src/components/audio/AudioPlayer.tsx b/packages/mobile/src/components/audio/AudioPlayer.tsx index e9f3ccb8228..bf6943ff385 100644 --- a/packages/mobile/src/components/audio/AudioPlayer.tsx +++ b/packages/mobile/src/components/audio/AudioPlayer.tsx @@ -1,39 +1,37 @@ import { useRef, useEffect, useCallback, useState } from 'react' -import type { - CommonState, - ID, - Nullable, - QueryParams, - Queueable, - Track -} from '@audius/common' +import { useAppContext } from '@audius/common/context' +import { SquareSizes } from '@audius/common/models' +import type { ID, Track } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import type { QueryParams } from '@audius/common/services' import { - getQueryParams, - removeNullable, - playbackRateValueMap, accountSelectors, - cacheUsersSelectors, cacheTracksSelectors, - playerSelectors, - playerActions, - playbackPositionActions, - playbackPositionSelectors, + cacheUsersSelectors, + savedPageTracksLineupActions, queueActions, queueSelectors, - reachabilitySelectors, - gatedContentSelectors, RepeatMode, - FeatureFlags, - encodeHashId, - Genre, + reachabilitySelectors, tracksSocialActions, - SquareSizes, + playerActions, + playerSelectors, + playbackRateValueMap, + playbackPositionActions, + playbackPositionSelectors, + gatedContentSelectors +} from '@audius/common/store' +import type { Queueable, CommonState } from '@audius/common/store' +import { + Genre, + encodeHashId, shallowCompare, - savedPageTracksLineupActions, - useAppContext, + removeNullable, + getQueryParams, getTrackPreviewDuration -} from '@audius/common' +} from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { isEqual } from 'lodash' import TrackPlayer, { AppKilledPlaybackBehavior, diff --git a/packages/mobile/src/components/audio/GoogleCast.tsx b/packages/mobile/src/components/audio/GoogleCast.tsx index 15daad4aa0a..11d565f1e0b 100644 --- a/packages/mobile/src/components/audio/GoogleCast.tsx +++ b/packages/mobile/src/components/audio/GoogleCast.tsx @@ -1,12 +1,12 @@ import { useCallback, useEffect, useMemo, useState } from 'react' +import { SquareSizes } from '@audius/common/models' import { - castActions, - encodeHashId, - playerSelectors, cacheUsersSelectors, - SquareSizes -} from '@audius/common' + castActions, + playerSelectors +} from '@audius/common/store' +import { encodeHashId } from '@audius/common/utils' import { CastState, useCastState, diff --git a/packages/mobile/src/components/audio/RepeatListener.tsx b/packages/mobile/src/components/audio/RepeatListener.tsx index 3413f0004ca..a2c54d07115 100644 --- a/packages/mobile/src/components/audio/RepeatListener.tsx +++ b/packages/mobile/src/components/audio/RepeatListener.tsx @@ -1,4 +1,4 @@ -import { playerActions } from '@audius/common' +import { playerActions } from '@audius/common/store' import TrackPlayer, { RepeatMode, useProgress } from 'react-native-track-player' import { useDispatch } from 'react-redux' import { useAsync, usePrevious } from 'react-use' diff --git a/packages/mobile/src/components/audio/useSavePodcastProgress.ts b/packages/mobile/src/components/audio/useSavePodcastProgress.ts index 5f38a8d62e7..70cd18201be 100644 --- a/packages/mobile/src/components/audio/useSavePodcastProgress.ts +++ b/packages/mobile/src/components/audio/useSavePodcastProgress.ts @@ -1,12 +1,12 @@ import { useEffect } from 'react' import { - Genre, accountSelectors, cacheTracksSelectors, - playbackPositionActions, - playerSelectors -} from '@audius/common' + playerSelectors, + playbackPositionActions +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { useProgress } from 'react-native-track-player' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/block-messages-drawer/BlockMessagesDrawer.tsx b/packages/mobile/src/components/block-messages-drawer/BlockMessagesDrawer.tsx index b6a0dd64001..fdc1df191c9 100644 --- a/packages/mobile/src/components/block-messages-drawer/BlockMessagesDrawer.tsx +++ b/packages/mobile/src/components/block-messages-drawer/BlockMessagesDrawer.tsx @@ -1,6 +1,10 @@ import { useCallback } from 'react' -import { cacheUsersSelectors, chatActions, chatSelectors } from '@audius/common' +import { + cacheUsersSelectors, + chatActions, + chatSelectors +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/BottomTabBarButton.tsx b/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/BottomTabBarButton.tsx index 5b49e41df0a..bb91208a464 100644 --- a/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/BottomTabBarButton.tsx +++ b/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/BottomTabBarButton.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { useEffect, useRef, useCallback } from 'react' -import type { Theme } from '@audius/common' +import type { Theme } from '@audius/common/models' import { Pressable, View } from 'react-native' import LinearGradient from 'react-native-linear-gradient' import { usePrevious } from 'react-use' diff --git a/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/NotificationsButton.tsx b/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/NotificationsButton.tsx index f402547be31..fd7bbb738c8 100644 --- a/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/NotificationsButton.tsx +++ b/packages/mobile/src/components/bottom-tab-bar/bottom-tab-bar-buttons/NotificationsButton.tsx @@ -1,4 +1,4 @@ -import { notificationsSelectors } from '@audius/common' +import { notificationsSelectors } from '@audius/common/store' import { View, Text } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/card/Card.tsx b/packages/mobile/src/components/card/Card.tsx index ab1e278ab9c..8ee5d8ed6fa 100644 --- a/packages/mobile/src/components/card/Card.tsx +++ b/packages/mobile/src/components/card/Card.tsx @@ -1,6 +1,6 @@ import type { ComponentType, ReactNode } from 'react' -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import type { StyleProp, TextStyle, ViewStyle } from 'react-native' import { Text, View } from 'react-native' import type { LinearGradientProps } from 'react-native-linear-gradient' diff --git a/packages/mobile/src/components/card/CollectionDogEar.tsx b/packages/mobile/src/components/card/CollectionDogEar.tsx index 13604af9f2d..ec8b02aab11 100644 --- a/packages/mobile/src/components/card/CollectionDogEar.tsx +++ b/packages/mobile/src/components/card/CollectionDogEar.tsx @@ -1,5 +1,6 @@ -import type { ID } from '@audius/common' -import { cacheCollectionsSelectors, DogEarType } from '@audius/common' +import type { ID } from '@audius/common/models' +import { DogEarType } from '@audius/common/models' +import { cacheCollectionsSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { DogEar } from '../core' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/AudioMatchingChallengeDrawerContent.tsx b/packages/mobile/src/components/challenge-rewards-drawer/AudioMatchingChallengeDrawerContent.tsx index 0047a22967d..5b6a3cd322e 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/AudioMatchingChallengeDrawerContent.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/AudioMatchingChallengeDrawerContent.tsx @@ -1,7 +1,9 @@ import React from 'react' -import type { OptimisticUserChallenge } from '@audius/common' -import { ChallengeName, ClaimStatus, formatNumberCommas } from '@audius/common' +import type { OptimisticUserChallenge } from '@audius/common/models' +import { ChallengeName } from '@audius/common/models' +import { ClaimStatus } from '@audius/common/store' +import { formatNumberCommas } from '@audius/common/utils' import { ScrollView, View } from 'react-native' import { IconArrowRight, IconCloudUpload } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeReward.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeReward.tsx index a58373c2589..a4223f8fe45 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeReward.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeReward.tsx @@ -1,4 +1,4 @@ -import { formatNumberCommas } from '@audius/common' +import { formatNumberCommas } from '@audius/common/utils' import { View } from 'react-native' import { GradientText, Text } from '../core' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerContent.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerContent.tsx index 2f0a8cccee5..b61759100e3 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerContent.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerContent.tsx @@ -1,7 +1,8 @@ import React from 'react' -import type { UserChallengeState } from '@audius/common' -import { fillString, formatNumberCommas, ClaimStatus } from '@audius/common' +import type { UserChallengeState } from '@audius/common/models' +import { ClaimStatus } from '@audius/common/store' +import { fillString, formatNumberCommas } from '@audius/common/utils' import { View } from 'react-native' import { IconCheck, IconVerified } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx index 61122e8a7cd..222d7777864 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx @@ -1,16 +1,18 @@ import { useCallback, useEffect } from 'react' -import type { Maybe, CommonState } from '@audius/common' +import { IntKeys, StringKeys } from '@audius/common/services' +import type { CommonState } from '@audius/common/store' import { - IntKeys, - StringKeys, challengesSelectors, - audioRewardsPageActions, - ClaimStatus, audioRewardsPageSelectors, + audioRewardsPageActions, + ClaimStatus +} from '@audius/common/store' +import { isAudioMatchingChallenge, getClaimableChallengeSpecifiers -} from '@audius/common' +} from '@audius/common/utils' +import type { Maybe } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { useNavigation } from 'app/hooks/useNavigation' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ClaimError.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ClaimError.tsx index 0e6aee1e5e6..2a5611da203 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ClaimError.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ClaimError.tsx @@ -1,4 +1,4 @@ -import { getAAOErrorEmojis } from '@audius/common' +import { getAAOErrorEmojis } from '@audius/common/utils' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/CooldownSummaryTable.tsx b/packages/mobile/src/components/challenge-rewards-drawer/CooldownSummaryTable.tsx index 11449f7a0e6..a54d81479b1 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/CooldownSummaryTable.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/CooldownSummaryTable.tsx @@ -1,7 +1,7 @@ import React from 'react' -import type { ChallengeRewardID } from '@audius/common' -import { useAudioMatchingChallengeCooldownSchedule } from '@audius/common' +import { useAudioMatchingChallengeCooldownSchedule } from '@audius/common/hooks' +import type { ChallengeRewardID } from '@audius/common/models' import { SummaryTable } from '../summary-table' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ProfileCompletionChecks.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ProfileCompletionChecks.tsx index 5af1544b35a..a85e6a5a7dd 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ProfileCompletionChecks.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ProfileCompletionChecks.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { accountSelectors, challengesSelectors } from '@audius/common' +import { accountSelectors, challengesSelectors } from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ReferralRewardContents.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ReferralRewardContents.tsx index 19d7c388449..e679ad61beb 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ReferralRewardContents.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ReferralRewardContents.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { ReferralLinkCopyButton } from './ReferralLinkCopyButton' diff --git a/packages/mobile/src/components/challenge-rewards-drawer/TwitterShareButton.tsx b/packages/mobile/src/components/challenge-rewards-drawer/TwitterShareButton.tsx index 145068e57fe..ea11c81ac03 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/TwitterShareButton.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/TwitterShareButton.tsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react' -import { makeTwitterShareUrl } from '@audius/common' +import { makeTwitterShareUrl } from '@audius/common/utils' import { Linking } from 'react-native' import { IconTwitter } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/chat-actions-drawer/ChatActionsDrawer.tsx b/packages/mobile/src/components/chat-actions-drawer/ChatActionsDrawer.tsx index b2fa9668986..58977ce673f 100644 --- a/packages/mobile/src/components/chat-actions-drawer/ChatActionsDrawer.tsx +++ b/packages/mobile/src/components/chat-actions-drawer/ChatActionsDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatSelectors } from '@audius/common' +import { chatSelectors } from '@audius/common/store' import { View, TouchableOpacity } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/coinflow-onramp-drawer/CoinflowOnrampDrawer.tsx b/packages/mobile/src/components/coinflow-onramp-drawer/CoinflowOnrampDrawer.tsx index 95e8ed774ed..693f308b70d 100644 --- a/packages/mobile/src/components/coinflow-onramp-drawer/CoinflowOnrampDrawer.tsx +++ b/packages/mobile/src/components/coinflow-onramp-drawer/CoinflowOnrampDrawer.tsx @@ -1,10 +1,10 @@ import { useCallback, useEffect, useState } from 'react' +import { useCoinflowAdapter } from '@audius/common/hooks' import { - useCoinflowAdapter, - useCoinflowOnrampModal, - coinflowModalUIActions -} from '@audius/common' + coinflowModalUIActions, + useCoinflowOnrampModal +} from '@audius/common/store' import { CoinflowPurchase } from '@coinflowlabs/react-native' import { Transaction } from '@solana/web3.js' import { TouchableOpacity, View } from 'react-native' diff --git a/packages/mobile/src/components/collectible-details-drawer/CollectibleDate.tsx b/packages/mobile/src/components/collectible-details-drawer/CollectibleDate.tsx index 68af9b1e6ea..b4ee5ff19a9 100644 --- a/packages/mobile/src/components/collectible-details-drawer/CollectibleDate.tsx +++ b/packages/mobile/src/components/collectible-details-drawer/CollectibleDate.tsx @@ -1,4 +1,4 @@ -import { formatDateWithTimezoneOffset } from '@audius/common' +import { formatDateWithTimezoneOffset } from '@audius/common/utils' import { View } from 'react-native' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/components/collectible-details-drawer/CollectibleDetailsDrawer.tsx b/packages/mobile/src/components/collectible-details-drawer/CollectibleDetailsDrawer.tsx index dbcf48a77c0..cb8279f24fd 100644 --- a/packages/mobile/src/components/collectible-details-drawer/CollectibleDetailsDrawer.tsx +++ b/packages/mobile/src/components/collectible-details-drawer/CollectibleDetailsDrawer.tsx @@ -3,7 +3,7 @@ import { useCallback, useMemo } from 'react' import { cacheUsersSelectors, collectibleDetailsUISelectors -} from '@audius/common' +} from '@audius/common/store' import { ScrollView, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/collectible-details-drawer/CollectibleMedia.tsx b/packages/mobile/src/components/collectible-details-drawer/CollectibleMedia.tsx index 43bbabfbc0e..7777ce655ff 100644 --- a/packages/mobile/src/components/collectible-details-drawer/CollectibleMedia.tsx +++ b/packages/mobile/src/components/collectible-details-drawer/CollectibleMedia.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' -import type { Collectible } from '@audius/common' -import { CollectibleMediaType } from '@audius/common' +import type { Collectible } from '@audius/common/models' +import { CollectibleMediaType } from '@audius/common/models' import type { ImageStyle } from 'react-native' import { TouchableWithoutFeedback, View } from 'react-native' diff --git a/packages/mobile/src/components/collection-list/AddCollectionCard.tsx b/packages/mobile/src/components/collection-list/AddCollectionCard.tsx index f8eefbd82b5..309e08da414 100644 --- a/packages/mobile/src/components/collection-list/AddCollectionCard.tsx +++ b/packages/mobile/src/components/collection-list/AddCollectionCard.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { ID } from '@audius/common' -import { cacheCollectionsActions, CreatePlaylistSource } from '@audius/common' +import type { ID } from '@audius/common/models' +import { CreatePlaylistSource } from '@audius/common/models' +import { cacheCollectionsActions } from '@audius/common/store' import { capitalize } from 'lodash' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/collection-list/CollectionCard.tsx b/packages/mobile/src/components/collection-list/CollectionCard.tsx index a8151d87dd0..f5797f0d04c 100644 --- a/packages/mobile/src/components/collection-list/CollectionCard.tsx +++ b/packages/mobile/src/components/collection-list/CollectionCard.tsx @@ -1,11 +1,12 @@ import { createElement, useCallback, useMemo } from 'react' -import type { Collection, CommonState, ID } from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import type { Collection, ID } from '@audius/common/models' import { - SquareSizes, cacheCollectionsSelectors, reachabilitySelectors -} from '@audius/common' +} from '@audius/common/store' +import type { CommonState } from '@audius/common/store' import type { StyleProp, ViewStyle } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/collection-list/CollectionList.tsx b/packages/mobile/src/components/collection-list/CollectionList.tsx index 6174ba11983..79af4c5bf20 100644 --- a/packages/mobile/src/components/collection-list/CollectionList.tsx +++ b/packages/mobile/src/components/collection-list/CollectionList.tsx @@ -1,7 +1,7 @@ import { createElement, useCallback, useMemo } from 'react' -import type { Collection, ID, UserCollection } from '@audius/common' -import { CreatePlaylistSource } from '@audius/common' +import type { Collection, UserCollection, ID } from '@audius/common/models' +import { CreatePlaylistSource } from '@audius/common/models' import type { ListRenderItem } from 'react-native' import type { CardListProps } from 'app/components/core' diff --git a/packages/mobile/src/components/core/ChainLogo.tsx b/packages/mobile/src/components/core/ChainLogo.tsx index 7de79215e86..6464a271e9c 100644 --- a/packages/mobile/src/components/core/ChainLogo.tsx +++ b/packages/mobile/src/components/core/ChainLogo.tsx @@ -1,4 +1,4 @@ -import type { Chain } from '@audius/common' +import type { Chain } from '@audius/common/models' import type { StyleProp, ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/components/core/DogEar.tsx b/packages/mobile/src/components/core/DogEar.tsx index 444d739fbc0..98eb93667b1 100644 --- a/packages/mobile/src/components/core/DogEar.tsx +++ b/packages/mobile/src/components/core/DogEar.tsx @@ -1,4 +1,4 @@ -import { DogEarType } from '@audius/common' +import { DogEarType } from '@audius/common/models' import type { ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/components/core/DynamicImage.tsx b/packages/mobile/src/components/core/DynamicImage.tsx index a7b2245bcc4..44d80943b21 100644 --- a/packages/mobile/src/components/core/DynamicImage.tsx +++ b/packages/mobile/src/components/core/DynamicImage.tsx @@ -1,8 +1,8 @@ import type { ReactNode } from 'react' import { useEffect, memo, useCallback, useRef, useState } from 'react' -import { useInstanceVar } from '@audius/common' -import type { Maybe } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' +import type { Maybe } from '@audius/common/utils' import type { ImageProps, ImageSourcePropType, diff --git a/packages/mobile/src/components/core/Hyperlink.tsx b/packages/mobile/src/components/core/Hyperlink.tsx index 6c2f00b341a..d685cbafa48 100644 --- a/packages/mobile/src/components/core/Hyperlink.tsx +++ b/packages/mobile/src/components/core/Hyperlink.tsx @@ -1,12 +1,12 @@ import type { ComponentProps } from 'react' import { useCallback, useEffect, useRef, useState } from 'react' +import { useLeavingAudiusModal } from '@audius/common/store' import { - getPathFromAudiusUrl, - isAllowedExternalLink, isInteralAudiusUrl, - useLeavingAudiusModal -} from '@audius/common' + getPathFromAudiusUrl, + isAllowedExternalLink +} from '@audius/common/utils' import { useLinkTo } from '@react-navigation/native' import type { Match } from 'autolinker/dist/es2015' import type { LayoutRectangle, TextStyle } from 'react-native' diff --git a/packages/mobile/src/components/core/IconAudioBadge.tsx b/packages/mobile/src/components/core/IconAudioBadge.tsx index 47af6c14033..011116abbb6 100644 --- a/packages/mobile/src/components/core/IconAudioBadge.tsx +++ b/packages/mobile/src/components/core/IconAudioBadge.tsx @@ -1,4 +1,4 @@ -import type { BadgeTier } from '@audius/common' +import type { BadgeTier } from '@audius/common/models' import type { ImageStyle } from 'react-native' import type { IconProps } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/core/PlayBarChin.tsx b/packages/mobile/src/components/core/PlayBarChin.tsx index 0f73d8b3924..775f483c32e 100644 --- a/packages/mobile/src/components/core/PlayBarChin.tsx +++ b/packages/mobile/src/components/core/PlayBarChin.tsx @@ -1,4 +1,4 @@ -import { playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/core/ProfilePicture.tsx b/packages/mobile/src/components/core/ProfilePicture.tsx index bdfcb0f705b..efaee08772a 100644 --- a/packages/mobile/src/components/core/ProfilePicture.tsx +++ b/packages/mobile/src/components/core/ProfilePicture.tsx @@ -1,4 +1,6 @@ -import { SquareSizes, type ID, cacheUsersSelectors } from '@audius/common' +import type { ID } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import type { AvatarProps } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/core/Screen/Screen.tsx b/packages/mobile/src/components/core/Screen/Screen.tsx index 2f90dc117a8..7f69dba275f 100644 --- a/packages/mobile/src/components/core/Screen/Screen.tsx +++ b/packages/mobile/src/components/core/Screen/Screen.tsx @@ -1,7 +1,7 @@ import type { ComponentType, ReactElement, ReactNode } from 'react' import { useEffect, useLayoutEffect } from 'react' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import { useNavigation } from '@react-navigation/native' import { pickBy, negate, isUndefined } from 'lodash' import type { Animated, StyleProp, ViewProps, ViewStyle } from 'react-native' diff --git a/packages/mobile/src/components/core/Screen/ScreenContent.tsx b/packages/mobile/src/components/core/Screen/ScreenContent.tsx index 13db0a2e202..fd7bf57b023 100644 --- a/packages/mobile/src/components/core/Screen/ScreenContent.tsx +++ b/packages/mobile/src/components/core/Screen/ScreenContent.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' -import { reachabilitySelectors } from '@audius/common' +import { reachabilitySelectors } from '@audius/common/store' import Animated, { FadeIn } from 'react-native-reanimated' import { useSelector } from 'react-redux' import { usePrevious } from 'react-use' diff --git a/packages/mobile/src/components/core/TagInput.tsx b/packages/mobile/src/components/core/TagInput.tsx index bdf7b8cfbe2..498f6c131d6 100644 --- a/packages/mobile/src/components/core/TagInput.tsx +++ b/packages/mobile/src/components/core/TagInput.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' -import { trimToAlphaNumeric } from '@audius/common' +import { trimToAlphaNumeric } from '@audius/common/utils' import { uniq } from 'lodash' import type { NativeSyntheticEvent, diff --git a/packages/mobile/src/components/core/UserCoverPhoto.tsx b/packages/mobile/src/components/core/UserCoverPhoto.tsx index 426b8a95ba7..8b9ee032bac 100644 --- a/packages/mobile/src/components/core/UserCoverPhoto.tsx +++ b/packages/mobile/src/components/core/UserCoverPhoto.tsx @@ -1,4 +1,4 @@ -import type { ID } from '@audius/common' +import type { ID } from '@audius/common/models' import type { CoverPhotoProps } from '@audius/harmony-native' import { CoverPhoto } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/core/UserDisplayName.tsx b/packages/mobile/src/components/core/UserDisplayName.tsx index e74f965dfd5..c43abeb6199 100644 --- a/packages/mobile/src/components/core/UserDisplayName.tsx +++ b/packages/mobile/src/components/core/UserDisplayName.tsx @@ -1,4 +1,6 @@ -import { useSelectTierInfo, type ID, cacheUsersSelectors } from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import type { ID } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import type { TextProps } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/create-chat-actions-drawer/CreateChatActionsDrawer.tsx b/packages/mobile/src/components/create-chat-actions-drawer/CreateChatActionsDrawer.tsx index 6ca6020a1c4..8efa177c09c 100644 --- a/packages/mobile/src/components/create-chat-actions-drawer/CreateChatActionsDrawer.tsx +++ b/packages/mobile/src/components/create-chat-actions-drawer/CreateChatActionsDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatSelectors } from '@audius/common' +import { chatSelectors } from '@audius/common/store' import { View, TouchableOpacity } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/deactivate-account-confirmation-drawer/DeactivateAccountConfirmationDrawer.tsx b/packages/mobile/src/components/deactivate-account-confirmation-drawer/DeactivateAccountConfirmationDrawer.tsx index 62fc271c9a1..6de398ee4a0 100644 --- a/packages/mobile/src/components/deactivate-account-confirmation-drawer/DeactivateAccountConfirmationDrawer.tsx +++ b/packages/mobile/src/components/deactivate-account-confirmation-drawer/DeactivateAccountConfirmationDrawer.tsx @@ -1,10 +1,10 @@ import { useCallback, useEffect } from 'react' +import { Status } from '@audius/common/models' import { deactivateAccountActions, - deactivateAccountSelectors, - Status -} from '@audius/common' + deactivateAccountSelectors +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/delete-chat-drawer/DeleteChatDrawer.tsx b/packages/mobile/src/components/delete-chat-drawer/DeleteChatDrawer.tsx index 6416e4c931e..3f4dabadee4 100644 --- a/packages/mobile/src/components/delete-chat-drawer/DeleteChatDrawer.tsx +++ b/packages/mobile/src/components/delete-chat-drawer/DeleteChatDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatActions } from '@audius/common' +import { chatActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/delete-playlist-confirmation-drawer/DeletePlaylistConfirmationDrawer.tsx b/packages/mobile/src/components/delete-playlist-confirmation-drawer/DeletePlaylistConfirmationDrawer.tsx index 30362060e40..721f6561ddd 100644 --- a/packages/mobile/src/components/delete-playlist-confirmation-drawer/DeletePlaylistConfirmationDrawer.tsx +++ b/packages/mobile/src/components/delete-playlist-confirmation-drawer/DeletePlaylistConfirmationDrawer.tsx @@ -3,9 +3,9 @@ import { useCallback } from 'react' import { cacheCollectionsActions, cacheCollectionsSelectors, - deletePlaylistConfirmationModalUISelectors, - fillString -} from '@audius/common' + deletePlaylistConfirmationModalUISelectors +} from '@audius/common/store' +import { fillString } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { useNavigation } from 'app/hooks/useNavigation' diff --git a/packages/mobile/src/components/details-tile/DetailsProgressInfo.tsx b/packages/mobile/src/components/details-tile/DetailsProgressInfo.tsx index 5d2c6f44aea..19bfc9c52e1 100644 --- a/packages/mobile/src/components/details-tile/DetailsProgressInfo.tsx +++ b/packages/mobile/src/components/details-tile/DetailsProgressInfo.tsx @@ -1,9 +1,9 @@ -import type { SearchTrack, Track } from '@audius/common' +import type { SearchTrack, Track } from '@audius/common/models' import { accountSelectors, - formatLineupTileDuration, playbackPositionSelectors -} from '@audius/common' +} from '@audius/common/store' +import { formatLineupTileDuration } from '@audius/common/utils' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/details-tile/DetailsTile.tsx b/packages/mobile/src/components/details-tile/DetailsTile.tsx index de69f1fb07d..d97c933d5b7 100644 --- a/packages/mobile/src/components/details-tile/DetailsTile.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTile.tsx @@ -1,18 +1,21 @@ import { useCallback } from 'react' -import type { CommonState, Track } from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import { isContentUSDCPurchaseGated } from '@audius/common/models' +import type { Track } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - FeatureFlags, - Genre, - useGatedContentAccess, - squashNewLines, accountSelectors, playerSelectors, - playbackPositionSelectors, - getDogEarType, - isContentUSDCPurchaseGated, - dayjs -} from '@audius/common' + playbackPositionSelectors +} from '@audius/common/store' +import type { CommonState } from '@audius/common/store' +import { + dayjs, + squashNewLines, + Genre, + getDogEarType +} from '@audius/common/utils' import moment from 'moment' import { TouchableOpacity, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/details-tile/DetailsTileActionButtons.tsx b/packages/mobile/src/components/details-tile/DetailsTileActionButtons.tsx index b93526a89e0..27f54efbf69 100644 --- a/packages/mobile/src/components/details-tile/DetailsTileActionButtons.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTileActionButtons.tsx @@ -1,11 +1,9 @@ -import type { CommonState, ID } from '@audius/common' -import { - FeatureFlags, - cacheCollectionsSelectors, - useFeatureFlag, - useGetCurrentUserId, - useGetPlaylistById -} from '@audius/common' +import { useGetPlaylistById, useGetCurrentUserId } from '@audius/common/api' +import { useFeatureFlag } from '@audius/common/hooks' +import type { ID } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { cacheCollectionsSelectors } from '@audius/common/store' +import type { CommonState } from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/details-tile/DetailsTileAiAttribution.tsx b/packages/mobile/src/components/details-tile/DetailsTileAiAttribution.tsx index b243c65ee6b..429ae4a5032 100644 --- a/packages/mobile/src/components/details-tile/DetailsTileAiAttribution.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTileAiAttribution.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react' -import type { ID } from '@audius/common' -import { aiPageActions, aiPageSelectors } from '@audius/common' +import type { ID } from '@audius/common/models' +import { aiPageActions, aiPageSelectors } from '@audius/common/store' import { View } from 'react-native' import { TouchableWithoutFeedback } from 'react-native-gesture-handler' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/details-tile/DetailsTileHasAccess.tsx b/packages/mobile/src/components/details-tile/DetailsTileHasAccess.tsx index 5e9eb6f3598..214d906fe71 100644 --- a/packages/mobile/src/components/details-tile/DetailsTileHasAccess.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTileHasAccess.tsx @@ -1,14 +1,14 @@ import { useCallback } from 'react' -import type { AccessConditions, User } from '@audius/common' +import { useStreamConditionsEntity } from '@audius/common/hooks' import { - formatPrice, isContentCollectibleGated, isContentFollowGated, isContentTipGated, - isContentUSDCPurchaseGated, - useStreamConditionsEntity -} from '@audius/common' + isContentUSDCPurchaseGated +} from '@audius/common/models' +import type { AccessConditions, User } from '@audius/common/models' +import { formatPrice } from '@audius/common/utils' import type { ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/components/details-tile/DetailsTileNoAccess.tsx b/packages/mobile/src/components/details-tile/DetailsTileNoAccess.tsx index 0e6b221a05d..4557453583e 100644 --- a/packages/mobile/src/components/details-tile/DetailsTileNoAccess.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTileNoAccess.tsx @@ -1,22 +1,24 @@ import type { ReactNode } from 'react' import { useCallback } from 'react' -import type { ID, AccessConditions, User } from '@audius/common' +import { useStreamConditionsEntity } from '@audius/common/hooks' import { - Chain, FollowSource, - formatPrice, + ModalSource, + Chain, isContentCollectibleGated, isContentFollowGated, isContentTipGated, - isContentUSDCPurchaseGated, - gatedContentSelectors, + isContentUSDCPurchaseGated +} from '@audius/common/models' +import type { ID, AccessConditions, User } from '@audius/common/models' +import { + usersSocialActions, tippingActions, - useStreamConditionsEntity, usePremiumContentPurchaseModal, - usersSocialActions, - ModalSource -} from '@audius/common' + gatedContentSelectors +} from '@audius/common/store' +import { formatPrice } from '@audius/common/utils' import type { ViewStyle } from 'react-native' import { Image, Text, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/details-tile/DetailsTilePremiumAccess.tsx b/packages/mobile/src/components/details-tile/DetailsTilePremiumAccess.tsx index 5810d8b2374..542174201fb 100644 --- a/packages/mobile/src/components/details-tile/DetailsTilePremiumAccess.tsx +++ b/packages/mobile/src/components/details-tile/DetailsTilePremiumAccess.tsx @@ -1,9 +1,9 @@ -import type { ID, AccessConditions } from '@audius/common' +import type { ID, AccessConditions } from '@audius/common/models' import { isContentCollectibleGated, isContentFollowGated, isContentTipGated -} from '@audius/common' +} from '@audius/common/models' import type { ViewStyle } from 'react-native' import { DetailsTileHasAccess } from './DetailsTileHasAccess' diff --git a/packages/mobile/src/components/details-tile/types.ts b/packages/mobile/src/components/details-tile/types.ts index 08bf86ef274..c3d4ad61632 100644 --- a/packages/mobile/src/components/details-tile/types.ts +++ b/packages/mobile/src/components/details-tile/types.ts @@ -1,6 +1,12 @@ import type { ReactNode } from 'react' -import type { Track, User, SearchTrack, SearchUser, ID } from '@audius/common' +import type { + ID, + SearchUser, + SearchTrack, + Track, + User +} from '@audius/common/models' import type { TextStyle } from 'react-native' import type { GestureResponderHandler } from 'app/types/gesture' diff --git a/packages/mobile/src/components/drawer/AppDrawer.tsx b/packages/mobile/src/components/drawer/AppDrawer.tsx index 4c6fd302a86..88af9dd6d1a 100644 --- a/packages/mobile/src/components/drawer/AppDrawer.tsx +++ b/packages/mobile/src/components/drawer/AppDrawer.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import { modalsActions, modalsSelectors } from '@audius/common' -import type { Modals } from '@audius/common' +import type { Modals } from '@audius/common/store' +import { modalsSelectors, modalsActions } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import type { SetOptional } from 'type-fest' diff --git a/packages/mobile/src/components/drawers/ConfirmationDrawer.tsx b/packages/mobile/src/components/drawers/ConfirmationDrawer.tsx index 25d384631ea..10092b3731c 100644 --- a/packages/mobile/src/components/drawers/ConfirmationDrawer.tsx +++ b/packages/mobile/src/components/drawers/ConfirmationDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { Modals } from '@audius/common' +import type { Modals } from '@audius/common/store' import { View } from 'react-native' import { IconInfo } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/drawers/DeleteTrackConfirmationDrawer.tsx b/packages/mobile/src/components/drawers/DeleteTrackConfirmationDrawer.tsx index dfb770c8986..9eadbee93be 100644 --- a/packages/mobile/src/components/drawers/DeleteTrackConfirmationDrawer.tsx +++ b/packages/mobile/src/components/drawers/DeleteTrackConfirmationDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { cacheTracksActions } from '@audius/common' +import { cacheTracksActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useDrawer } from 'app/hooks/useDrawer' diff --git a/packages/mobile/src/components/drawers/ReleaseNowConfirmationDrawer.tsx b/packages/mobile/src/components/drawers/ReleaseNowConfirmationDrawer.tsx index 15f9657b606..fec3d3bf2db 100644 --- a/packages/mobile/src/components/drawers/ReleaseNowConfirmationDrawer.tsx +++ b/packages/mobile/src/components/drawers/ReleaseNowConfirmationDrawer.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { cacheTracksActions, useGetTrackById } from '@audius/common' +import { useGetTrackById } from '@audius/common/api' +import { cacheTracksActions } from '@audius/common/store' import moment from 'moment' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/drawers/RemoveDownloadedCollectionDrawer.tsx b/packages/mobile/src/components/drawers/RemoveDownloadedCollectionDrawer.tsx index 0ec4f645f80..5d22c14ba0c 100644 --- a/packages/mobile/src/components/drawers/RemoveDownloadedCollectionDrawer.tsx +++ b/packages/mobile/src/components/drawers/RemoveDownloadedCollectionDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { cacheCollectionsSelectors } from '@audius/common' +import { cacheCollectionsSelectors } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useDrawer } from 'app/hooks/useDrawer' diff --git a/packages/mobile/src/components/drawers/UnfavoriteDownloadedCollectionDrawer.tsx b/packages/mobile/src/components/drawers/UnfavoriteDownloadedCollectionDrawer.tsx index aa529e43da1..4037c8b629e 100644 --- a/packages/mobile/src/components/drawers/UnfavoriteDownloadedCollectionDrawer.tsx +++ b/packages/mobile/src/components/drawers/UnfavoriteDownloadedCollectionDrawer.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { CommonState } from '@audius/common' -import { FavoriteSource, collectionsSocialActions } from '@audius/common' +import { FavoriteSource } from '@audius/common/models' +import type { CommonState } from '@audius/common/store' +import { collectionsSocialActions } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useDrawer } from 'app/hooks/useDrawer' diff --git a/packages/mobile/src/components/duplicate-add-confirmation-drawer/DuplicateAddConfirmationDrawer.tsx b/packages/mobile/src/components/duplicate-add-confirmation-drawer/DuplicateAddConfirmationDrawer.tsx index 9583d0b9cec..bcf9b003050 100644 --- a/packages/mobile/src/components/duplicate-add-confirmation-drawer/DuplicateAddConfirmationDrawer.tsx +++ b/packages/mobile/src/components/duplicate-add-confirmation-drawer/DuplicateAddConfirmationDrawer.tsx @@ -3,9 +3,9 @@ import { useCallback } from 'react' import { cacheCollectionsActions, cacheCollectionsSelectors, - duplicateAddConfirmationModalUISelectors, - fillString -} from '@audius/common' + duplicateAddConfirmationModalUISelectors +} from '@audius/common/store' +import { fillString } from '@audius/common/utils' import { capitalize } from 'lodash' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/enable-push-notifications-drawer/EnablePushNotificationsDrawer.tsx b/packages/mobile/src/components/enable-push-notifications-drawer/EnablePushNotificationsDrawer.tsx index 22c08537051..f725928d2f9 100644 --- a/packages/mobile/src/components/enable-push-notifications-drawer/EnablePushNotificationsDrawer.tsx +++ b/packages/mobile/src/components/enable-push-notifications-drawer/EnablePushNotificationsDrawer.tsx @@ -1,6 +1,9 @@ import { useCallback } from 'react' -import { settingsPageActions, PushNotificationSetting } from '@audius/common' +import { + settingsPageActions, + PushNotificationSetting +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/feed-filter-drawer/FeedFilterDrawer.tsx b/packages/mobile/src/components/feed-filter-drawer/FeedFilterDrawer.tsx index 1485b29bb23..ba49b115e9c 100644 --- a/packages/mobile/src/components/feed-filter-drawer/FeedFilterDrawer.tsx +++ b/packages/mobile/src/components/feed-filter-drawer/FeedFilterDrawer.tsx @@ -1,11 +1,10 @@ import { useCallback, useMemo } from 'react' +import { Name, FeedFilter } from '@audius/common/models' import { - FeedFilter, - Name, feedPageLineupActions as feedActions, feedPageActions -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import ActionDrawer from 'app/components/action-drawer' diff --git a/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx b/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx index 593699aa168..bc5dbb33254 100644 --- a/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx +++ b/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx @@ -1,13 +1,13 @@ import { useCallback, useEffect } from 'react' -import type { User } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import type { User } from '@audius/common/models' import { accountSelectors, cacheUsersSelectors, tippingSelectors, - tippingActions, - useProxySelector -} from '@audius/common' + tippingActions +} from '@audius/common/store' import { storeDismissedTipInfo } from 'common/store/tipping/sagas' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/feed-tip-tile/ReceiverDetails.tsx b/packages/mobile/src/components/feed-tip-tile/ReceiverDetails.tsx index 825c5061ebe..6dfb3d53818 100644 --- a/packages/mobile/src/components/feed-tip-tile/ReceiverDetails.tsx +++ b/packages/mobile/src/components/feed-tip-tile/ReceiverDetails.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import { View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/components/feed-tip-tile/SendTipButton.tsx b/packages/mobile/src/components/feed-tip-tile/SendTipButton.tsx index f0d796d7c4f..4e8fcbd500d 100644 --- a/packages/mobile/src/components/feed-tip-tile/SendTipButton.tsx +++ b/packages/mobile/src/components/feed-tip-tile/SendTipButton.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' -import type { User } from '@audius/common' -import { tippingActions } from '@audius/common' +import type { User } from '@audius/common/models' +import { tippingActions } from '@audius/common/store' import { View, Platform } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/feed-tip-tile/SenderDetails.tsx b/packages/mobile/src/components/feed-tip-tile/SenderDetails.tsx index 6f6825b4f07..8be6a4cc251 100644 --- a/packages/mobile/src/components/feed-tip-tile/SenderDetails.tsx +++ b/packages/mobile/src/components/feed-tip-tile/SenderDetails.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import { Platform, TouchableOpacity, View } from 'react-native' import { IconTipping } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/fields/HarmonyTextField.tsx b/packages/mobile/src/components/fields/HarmonyTextField.tsx index e8d1ffe630e..5f7a6e6d126 100644 --- a/packages/mobile/src/components/fields/HarmonyTextField.tsx +++ b/packages/mobile/src/components/fields/HarmonyTextField.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { useDebouncedCallback } from '@audius/common' +import { useDebouncedCallback } from '@audius/common/hooks' import { useField, useFormikContext } from 'formik' import { TextInput, type TextInputProps } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/fields/ImageField.tsx b/packages/mobile/src/components/fields/ImageField.tsx index ee72ef469f3..197cbc686a4 100644 --- a/packages/mobile/src/components/fields/ImageField.tsx +++ b/packages/mobile/src/components/fields/ImageField.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo, useState } from 'react' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import type { ImageStyle, ViewStyle } from 'react-native' import { Animated, Pressable, View } from 'react-native' diff --git a/packages/mobile/src/components/fields/PriceField.tsx b/packages/mobile/src/components/fields/PriceField.tsx index a41380b5f51..520880edd58 100644 --- a/packages/mobile/src/components/fields/PriceField.tsx +++ b/packages/mobile/src/components/fields/PriceField.tsx @@ -1,11 +1,11 @@ import { useState, useEffect, useCallback } from 'react' import { - decimalIntegerFromHumanReadable, - decimalIntegerToHumanReadable, filterDecimalString, - padDecimalValue -} from '@audius/common' + padDecimalValue, + decimalIntegerToHumanReadable, + decimalIntegerFromHumanReadable +} from '@audius/common/utils' import { useField } from 'formik' import type { NativeSyntheticEvent, diff --git a/packages/mobile/src/components/fields/TextField.tsx b/packages/mobile/src/components/fields/TextField.tsx index dccf129878a..a54ca1566fa 100644 --- a/packages/mobile/src/components/fields/TextField.tsx +++ b/packages/mobile/src/components/fields/TextField.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect } from 'react' -import { useDebouncedCallback } from '@audius/common' +import { useDebouncedCallback } from '@audius/common/hooks' import { useField, useFormikContext } from 'formik' import { Platform, View } from 'react-native' diff --git a/packages/mobile/src/components/hcaptcha/HCaptcha.tsx b/packages/mobile/src/components/hcaptcha/HCaptcha.tsx index 2b01852841c..1fe12db58cb 100644 --- a/packages/mobile/src/components/hcaptcha/HCaptcha.tsx +++ b/packages/mobile/src/components/hcaptcha/HCaptcha.tsx @@ -1,12 +1,12 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { - HCaptchaStatus, audioRewardsPageSelectors, audioRewardsPageActions, - modalsActions, - modalsSelectors -} from '@audius/common' + HCaptchaStatus, + modalsSelectors, + modalsActions +} from '@audius/common/store' import ConfirmHcaptcha from '@hcaptcha/react-native-hcaptcha' import type { NativeSyntheticEvent } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/image/CollectionImage.tsx b/packages/mobile/src/components/image/CollectionImage.tsx index a4fd0a9ba93..3b94e842e5f 100644 --- a/packages/mobile/src/components/image/CollectionImage.tsx +++ b/packages/mobile/src/components/image/CollectionImage.tsx @@ -1,12 +1,11 @@ import type { + SquareSizes, Collection, ID, - Maybe, - Nullable, - SearchPlaylist, - SquareSizes -} from '@audius/common' -import { reachabilitySelectors } from '@audius/common' + SearchPlaylist +} from '@audius/common/models' +import { reachabilitySelectors } from '@audius/common/store' +import type { Nullable, Maybe } from '@audius/common/utils' import { useSelector } from 'react-redux' import imageEmpty from 'app/assets/images/imageBlank2x.png' diff --git a/packages/mobile/src/components/image/CoverPhoto.tsx b/packages/mobile/src/components/image/CoverPhoto.tsx index 8277965330b..8fd4fc56a59 100644 --- a/packages/mobile/src/components/image/CoverPhoto.tsx +++ b/packages/mobile/src/components/image/CoverPhoto.tsx @@ -1,5 +1,7 @@ -import type { ID, Nullable } from '@audius/common' -import { SquareSizes, WidthSizes, cacheUsersSelectors } from '@audius/common' +import type { ID } from '@audius/common/models' +import { SquareSizes, WidthSizes } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { BlurView } from '@react-native-community/blur' import { Animated, StyleSheet } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/image/TrackImage.tsx b/packages/mobile/src/components/image/TrackImage.tsx index a81a35efcd6..29c055f9d60 100644 --- a/packages/mobile/src/components/image/TrackImage.tsx +++ b/packages/mobile/src/components/image/TrackImage.tsx @@ -1,12 +1,6 @@ -import type { - Track, - Nullable, - SquareSizes, - ID, - Maybe, - SearchTrack -} from '@audius/common' -import { reachabilitySelectors } from '@audius/common' +import type { SquareSizes, ID, SearchTrack, Track } from '@audius/common/models' +import { reachabilitySelectors } from '@audius/common/store' +import type { Nullable, Maybe } from '@audius/common/utils' import { useSelector } from 'react-redux' import imageEmpty from 'app/assets/images/imageBlank2x.png' diff --git a/packages/mobile/src/components/image/UserImage.tsx b/packages/mobile/src/components/image/UserImage.tsx index 968cb3e7da3..b0fc08dd854 100644 --- a/packages/mobile/src/components/image/UserImage.tsx +++ b/packages/mobile/src/components/image/UserImage.tsx @@ -1,5 +1,6 @@ -import { cacheUsersSelectors } from '@audius/common' -import type { ID, Nullable, SquareSizes } from '@audius/common' +import type { SquareSizes, ID } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { useSelector } from 'react-redux' import profilePicEmpty from 'app/assets/images/imageProfilePicEmpty2X.png' diff --git a/packages/mobile/src/components/inbox-unavailable-drawer/InboxUnavailableDrawer.tsx b/packages/mobile/src/components/inbox-unavailable-drawer/InboxUnavailableDrawer.tsx index e9bc0389c36..fdcd9ff0986 100644 --- a/packages/mobile/src/components/inbox-unavailable-drawer/InboxUnavailableDrawer.tsx +++ b/packages/mobile/src/components/inbox-unavailable-drawer/InboxUnavailableDrawer.tsx @@ -2,16 +2,16 @@ import type { ReactNode } from 'react' import { useCallback } from 'react' import { - chatSelectors, - chatActions, - tippingActions, - ChatPermissionAction, - CHAT_BLOG_POST_URL, accountSelectors, + cacheUsersSelectors, + chatActions, + chatSelectors, makeChatId, - useInboxUnavailableModal, - cacheUsersSelectors -} from '@audius/common' + ChatPermissionAction, + tippingActions, + useInboxUnavailableModal +} from '@audius/common/store' +import { CHAT_BLOG_POST_URL } from '@audius/common/utils' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/leaving-audius-drawer/LeavingAudiusDrawer.tsx b/packages/mobile/src/components/leaving-audius-drawer/LeavingAudiusDrawer.tsx index fc6e1cd87cc..ea2b4f9fdb4 100644 --- a/packages/mobile/src/components/leaving-audius-drawer/LeavingAudiusDrawer.tsx +++ b/packages/mobile/src/components/leaving-audius-drawer/LeavingAudiusDrawer.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { useLeavingAudiusModal } from '@audius/common' +import { useLeavingAudiusModal } from '@audius/common/store' import { View } from 'react-native' import { IconExternalLink, IconInfo } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/lineup-tile/CollectionTile.tsx b/packages/mobile/src/components/lineup-tile/CollectionTile.tsx index 481b60044fb..16e2d9e3e98 100644 --- a/packages/mobile/src/components/lineup-tile/CollectionTile.tsx +++ b/packages/mobile/src/components/lineup-tile/CollectionTile.tsx @@ -1,33 +1,30 @@ import { useCallback, useMemo } from 'react' -import type { - Collection, - Track, - User, - EnhancedCollectionTrack, - CommonState -} from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' import { - SquareSizes, - removeNullable, - useProxySelector, - playerSelectors, + ShareSource, + RepostSource, FavoriteSource, PlaybackSource, - RepostSource, - ShareSource, FavoriteType, + SquareSizes +} from '@audius/common/models' +import type { Collection, Track, User } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, cacheCollectionsSelectors, cacheUsersSelectors, collectionsSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, + OverflowAction, + OverflowSource, RepostType, - FeatureFlags -} from '@audius/common' + playerSelectors +} from '@audius/common/store' +import type { EnhancedCollectionTrack, CommonState } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { CollectionImage } from 'app/components/image/CollectionImage' diff --git a/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx b/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx index ebb9286c754..8cca9427de6 100644 --- a/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx +++ b/packages/mobile/src/components/lineup-tile/CollectionTileTrackList.tsx @@ -1,5 +1,6 @@ -import type { CommonState, LineupTrack, UID } from '@audius/common' -import { playerSelectors } from '@audius/common' +import type { UID, LineupTrack } from '@audius/common/models' +import type { CommonState } from '@audius/common/store' +import { playerSelectors } from '@audius/common/store' import { range } from 'lodash' import { Pressable, Text, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/LineupTile.tsx b/packages/mobile/src/components/lineup-tile/LineupTile.tsx index 3c479f09bec..fd3e3107039 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTile.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTile.tsx @@ -1,12 +1,8 @@ import { useCallback } from 'react' -import { - accountSelectors, - Genre, - gatedContentActions, - useGatedContentAccess, - getDogEarType -} from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import { accountSelectors, gatedContentActions } from '@audius/common/store' +import { Genre, getDogEarType } from '@audius/common/utils' import moment from 'moment' import { View } from 'react-native' import { useSelector, useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileAccessStatus.tsx b/packages/mobile/src/components/lineup-tile/LineupTileAccessStatus.tsx index 184ced6d035..5a01e858c53 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileAccessStatus.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileAccessStatus.tsx @@ -1,14 +1,13 @@ import { useCallback } from 'react' -import type { ID, AccessConditions } from '@audius/common' +import type { ID, AccessConditions } from '@audius/common/models' +import { ModalSource, isContentUSDCPurchaseGated } from '@audius/common/models' import { - ModalSource, - formatPrice, - isContentUSDCPurchaseGated, + usePremiumContentPurchaseModal, gatedContentActions, - gatedContentSelectors, - usePremiumContentPurchaseModal -} from '@audius/common' + gatedContentSelectors +} from '@audius/common/store' +import { formatPrice } from '@audius/common/utils' import { TouchableOpacity, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileActionButtons.tsx b/packages/mobile/src/components/lineup-tile/LineupTileActionButtons.tsx index 6774f0f0734..6ffbe5b294f 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileActionButtons.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileActionButtons.tsx @@ -1,11 +1,8 @@ import type { ReactElement } from 'react' -import { - isContentUSDCPurchaseGated, - type ID, - type Nullable, - type AccessConditions -} from '@audius/common' +import type { ID, AccessConditions } from '@audius/common/models' +import { isContentUSDCPurchaseGated } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import { View } from 'react-native' import { IconKebabHorizontal, IconShare } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileArt.tsx b/packages/mobile/src/components/lineup-tile/LineupTileArt.tsx index 6e35e69cfbb..b63b8294931 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileArt.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileArt.tsx @@ -1,4 +1,4 @@ -import type { Remix } from '@audius/common' +import type { Remix } from '@audius/common/models' import type { StyleProp, ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileCoSign.tsx b/packages/mobile/src/components/lineup-tile/LineupTileCoSign.tsx index 3cca6d00d37..8ad8390c73d 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileCoSign.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileCoSign.tsx @@ -1,4 +1,4 @@ -import type { Remix } from '@audius/common' +import type { Remix } from '@audius/common/models' import { StyleSheet, View } from 'react-native' import Text from 'app/components/text' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileMetadata.tsx b/packages/mobile/src/components/lineup-tile/LineupTileMetadata.tsx index d63aa662b41..7d8f03ae436 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileMetadata.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileMetadata.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import { playerSelectors } from '@audius/common' -import type { Remix, User } from '@audius/common' +import type { Remix, User } from '@audius/common/models' +import { playerSelectors } from '@audius/common/store' import { TouchableOpacity, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/LineupTilePremiumContentTypeTag.tsx b/packages/mobile/src/components/lineup-tile/LineupTilePremiumContentTypeTag.tsx index 0b517c48909..a1755278f60 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTilePremiumContentTypeTag.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTilePremiumContentTypeTag.tsx @@ -1,11 +1,11 @@ import { useMemo } from 'react' +import type { AccessConditions } from '@audius/common/models' import { + GatedContentType, isContentCollectibleGated, - isContentUSDCPurchaseGated, - type AccessConditions, - GatedContentType -} from '@audius/common' + isContentUSDCPurchaseGated +} from '@audius/common/models' import { View } from 'react-native' import { diff --git a/packages/mobile/src/components/lineup-tile/LineupTileStats.tsx b/packages/mobile/src/components/lineup-tile/LineupTileStats.tsx index 761736d5267..efdd17e97b9 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileStats.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileStats.tsx @@ -1,19 +1,14 @@ import { useCallback } from 'react' -import type { - ID, - FavoriteType, - RepostType, - AccessConditions, - Nullable -} from '@audius/common' +import { isContentUSDCPurchaseGated } from '@audius/common/models' +import type { FavoriteType, ID, AccessConditions } from '@audius/common/models' import { - formatCount, repostsUserListActions, - favoritesUserListActions, - isContentUSDCPurchaseGated, - dayjs -} from '@audius/common' + favoritesUserListActions +} from '@audius/common/store' +import type { RepostType } from '@audius/common/store' +import { dayjs, formatCount } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import moment from 'moment' import { View, TouchableOpacity } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/LineupTileTopRight.tsx b/packages/mobile/src/components/lineup-tile/LineupTileTopRight.tsx index 8e785b73dee..d82e5e624bf 100644 --- a/packages/mobile/src/components/lineup-tile/LineupTileTopRight.tsx +++ b/packages/mobile/src/components/lineup-tile/LineupTileTopRight.tsx @@ -1,9 +1,9 @@ +import { FeatureFlags } from '@audius/common/services' import { - FeatureFlags, accountSelectors, - playbackPositionSelectors, - formatLineupTileDuration -} from '@audius/common' + playbackPositionSelectors +} from '@audius/common/store' +import { formatLineupTileDuration } from '@audius/common/utils' import type { ViewStyle } from 'react-native' import { StyleSheet, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/lineup-tile/TrackTile.tsx b/packages/mobile/src/components/lineup-tile/TrackTile.tsx index b30f13f9e2b..15a2a7aaaa2 100644 --- a/packages/mobile/src/components/lineup-tile/TrackTile.tsx +++ b/packages/mobile/src/components/lineup-tile/TrackTile.tsx @@ -1,29 +1,31 @@ import { useCallback } from 'react' -import type { Track, User, CommonState } from '@audius/common' import { - playbackPositionSelectors, - FeatureFlags, - Genre, - SquareSizes, - accountSelectors, - removeNullable, - PlaybackSource, - FavoriteSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, + PlaybackSource, FavoriteType, + SquareSizes, + isContentUSDCPurchaseGated +} from '@audius/common/models' +import type { Track, User } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { + accountSelectors, cacheTracksSelectors, cacheUsersSelectors, tracksSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, + OverflowAction, + OverflowSource, RepostType, playerSelectors, - isContentUSDCPurchaseGated -} from '@audius/common' + playbackPositionSelectors +} from '@audius/common/store' +import type { CommonState } from '@audius/common/store' +import { Genre, removeNullable } from '@audius/common/utils' import { useNavigationState } from '@react-navigation/native' import { useDispatch, useSelector } from 'react-redux' import { trpc } from 'utils/trpcClientWeb' diff --git a/packages/mobile/src/components/lineup-tile/types.ts b/packages/mobile/src/components/lineup-tile/types.ts index 61b7684f01c..146642669cd 100644 --- a/packages/mobile/src/components/lineup-tile/types.ts +++ b/packages/mobile/src/components/lineup-tile/types.ts @@ -1,16 +1,15 @@ import type { ReactNode } from 'react' import type { - ID, - UID, PlaybackSource, - Collection, FavoriteType, + Collection, + ID, + UID, Track, - User, - RepostType, - EnhancedCollectionTrack -} from '@audius/common' + User +} from '@audius/common/models' +import type { RepostType, EnhancedCollectionTrack } from '@audius/common/store' import type { StyleProp, ViewStyle } from 'react-native' import type { GestureResponderHandler } from 'app/types/gesture' diff --git a/packages/mobile/src/components/lineup/Lineup.tsx b/packages/mobile/src/components/lineup/Lineup.tsx index 093c2763827..1b3f41b8003 100644 --- a/packages/mobile/src/components/lineup/Lineup.tsx +++ b/packages/mobile/src/components/lineup/Lineup.tsx @@ -1,7 +1,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' -import type { ID, UID, PlaybackSource } from '@audius/common' -import { Kind, Status } from '@audius/common' +import type { PlaybackSource, ID, UID } from '@audius/common/models' +import { Kind, Status } from '@audius/common/models' import { useFocusEffect } from '@react-navigation/native' import { range } from 'lodash' import type { SectionList as RNSectionList } from 'react-native' diff --git a/packages/mobile/src/components/lineup/types.ts b/packages/mobile/src/components/lineup/types.ts index 9035b82d552..ca21e2aef43 100644 --- a/packages/mobile/src/components/lineup/types.ts +++ b/packages/mobile/src/components/lineup/types.ts @@ -1,14 +1,8 @@ import type { ComponentType, ReactElement } from 'react' -import type { - ID, - UID, - Kind, - Lineup as LineupData, - Maybe, - LineupBaseActions, - CommonState -} from '@audius/common' +import type { Kind, ID, UID, Lineup as LineupData } from '@audius/common/models' +import type { LineupBaseActions, CommonState } from '@audius/common/store' +import type { Maybe } from '@audius/common/utils' import type { SectionListProps } from 'react-native' import type { PlaybackSource } from 'app/types/analytics' diff --git a/packages/mobile/src/components/locked-content-drawer/LockedContentDrawer.tsx b/packages/mobile/src/components/locked-content-drawer/LockedContentDrawer.tsx index 3fdeac2944f..b6431145868 100644 --- a/packages/mobile/src/components/locked-content-drawer/LockedContentDrawer.tsx +++ b/packages/mobile/src/components/locked-content-drawer/LockedContentDrawer.tsx @@ -1,10 +1,7 @@ import { useCallback } from 'react' -import { - useLockedContent, - gatedContentActions, - useGatedContentAccess -} from '@audius/common' +import { useGatedContentAccess, useLockedContent } from '@audius/common/hooks' +import { gatedContentActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/navigation-container/NavigationContainer.tsx b/packages/mobile/src/components/navigation-container/NavigationContainer.tsx index d693491955f..285f02e9cff 100644 --- a/packages/mobile/src/components/navigation-container/NavigationContainer.tsx +++ b/packages/mobile/src/components/navigation-container/NavigationContainer.tsx @@ -1,7 +1,8 @@ import type { ReactNode } from 'react' import { useRef } from 'react' -import { accountSelectors, decodeHashId } from '@audius/common' +import { accountSelectors } from '@audius/common/store' +import { decodeHashId } from '@audius/common/utils' import type { LinkingOptions, NavigationState, diff --git a/packages/mobile/src/components/now-playing-drawer/ActionsBar.tsx b/packages/mobile/src/components/now-playing-drawer/ActionsBar.tsx index fe486571d06..d38e3b4c3c4 100644 --- a/packages/mobile/src/components/now-playing-drawer/ActionsBar.tsx +++ b/packages/mobile/src/components/now-playing-drawer/ActionsBar.tsx @@ -1,28 +1,29 @@ import { useCallback, useLayoutEffect } from 'react' -import type { Nullable, Track } from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' import { - FeatureFlags, - playbackPositionSelectors, - Genre, - removeNullable, - FavoriteSource, - reachabilitySelectors, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, + ModalSource +} from '@audius/common/models' +import type { Track } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, castSelectors, castActions, + reachabilitySelectors, tracksSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, - useGatedContentAccess, - formatPrice, + OverflowAction, + OverflowSource, usePremiumContentPurchaseModal, - ModalSource -} from '@audius/common' + playbackPositionSelectors +} from '@audius/common/store' +import { formatPrice, Genre, removeNullable } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { View, Platform } from 'react-native' import { CastButton } from 'react-native-google-cast' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/now-playing-drawer/Artwork.tsx b/packages/mobile/src/components/now-playing-drawer/Artwork.tsx index 299411ab610..df624962bcd 100644 --- a/packages/mobile/src/components/now-playing-drawer/Artwork.tsx +++ b/packages/mobile/src/components/now-playing-drawer/Artwork.tsx @@ -1,11 +1,9 @@ -import type { CommonState, Nullable, Track } from '@audius/common' -import { - DogEarType, - SquareSizes, - averageColorSelectors, - useGatedContentAccess, - playerSelectors -} from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import { DogEarType, SquareSizes } from '@audius/common/models' +import type { Track } from '@audius/common/models' +import { averageColorSelectors, playerSelectors } from '@audius/common/store' +import type { CommonState } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { Dimensions } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/now-playing-drawer/AudioControls.tsx b/packages/mobile/src/components/now-playing-drawer/AudioControls.tsx index 4dbd72c903e..0cc01678fa2 100644 --- a/packages/mobile/src/components/now-playing-drawer/AudioControls.tsx +++ b/packages/mobile/src/components/now-playing-drawer/AudioControls.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { FeatureFlags } from '@audius/common/services' import { - FeatureFlags, - modalsActions, queueActions, queueSelectors, - RepeatMode -} from '@audius/common' + RepeatMode, + modalsActions +} from '@audius/common/store' import { Animated, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/now-playing-drawer/NowPlayingDrawer.tsx b/packages/mobile/src/components/now-playing-drawer/NowPlayingDrawer.tsx index b3d2150b7e7..bf64f3f6c81 100644 --- a/packages/mobile/src/components/now-playing-drawer/NowPlayingDrawer.tsx +++ b/packages/mobile/src/components/now-playing-drawer/NowPlayingDrawer.tsx @@ -8,12 +8,12 @@ import { } from 'react' import { - Genre, cacheUsersSelectors, queueActions, - playerSelectors, - playerActions -} from '@audius/common' + playerActions, + playerSelectors +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { useNavigationState } from '@react-navigation/native' import type { Animated, diff --git a/packages/mobile/src/components/now-playing-drawer/PlayBar.tsx b/packages/mobile/src/components/now-playing-drawer/PlayBar.tsx index 21e915ea4f4..37c6f1de16f 100644 --- a/packages/mobile/src/components/now-playing-drawer/PlayBar.tsx +++ b/packages/mobile/src/components/now-playing-drawer/PlayBar.tsx @@ -1,14 +1,14 @@ import { useCallback } from 'react' -import type { Nullable, Track, User } from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import { FavoriteSource, SquareSizes } from '@audius/common/models' +import type { Track, User } from '@audius/common/models' import { - SquareSizes, - FavoriteSource, accountSelectors, tracksSocialActions, - playerSelectors, - useGatedContentAccess -} from '@audius/common' + playerSelectors +} from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { TouchableOpacity, Animated, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/now-playing-drawer/PlayButton.tsx b/packages/mobile/src/components/now-playing-drawer/PlayButton.tsx index d16e1fc0b6f..9ff4b234b34 100644 --- a/packages/mobile/src/components/now-playing-drawer/PlayButton.tsx +++ b/packages/mobile/src/components/now-playing-drawer/PlayButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { playerActions, playerSelectors } from '@audius/common' +import { playerActions, playerSelectors } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import IconPause from 'app/assets/animations/iconPause.json' diff --git a/packages/mobile/src/components/now-playing-drawer/PlaybackRateButton.tsx b/packages/mobile/src/components/now-playing-drawer/PlaybackRateButton.tsx index a99fb66f347..a822ad9658e 100644 --- a/packages/mobile/src/components/now-playing-drawer/PlaybackRateButton.tsx +++ b/packages/mobile/src/components/now-playing-drawer/PlaybackRateButton.tsx @@ -1,5 +1,5 @@ -import type { PlaybackRate } from '@audius/common' -import { playerSelectors } from '@audius/common' +import type { PlaybackRate } from '@audius/common/store' +import { playerSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import Icon0_5x from 'app/assets/images/iconPlaybackRate0_5x.svg' diff --git a/packages/mobile/src/components/now-playing-drawer/TrackInfo.tsx b/packages/mobile/src/components/now-playing-drawer/TrackInfo.tsx index 384f4e27c95..0bed67ff1ad 100644 --- a/packages/mobile/src/components/now-playing-drawer/TrackInfo.tsx +++ b/packages/mobile/src/components/now-playing-drawer/TrackInfo.tsx @@ -1,10 +1,7 @@ -import { - useGatedContentAccess, - type Nullable, - type Track, - type User, - playerSelectors -} from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import type { Track, User } from '@audius/common/models' +import { playerSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { TouchableOpacity, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/now-playing-drawer/TrackingBar.tsx b/packages/mobile/src/components/now-playing-drawer/TrackingBar.tsx index c2a9b657fd9..3e98525cf5c 100644 --- a/packages/mobile/src/components/now-playing-drawer/TrackingBar.tsx +++ b/packages/mobile/src/components/now-playing-drawer/TrackingBar.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef } from 'react' -import { playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' import { Animated, Dimensions, Easing } from 'react-native' import LinearGradient from 'react-native-linear-gradient' import TrackPlayer from 'react-native-track-player' diff --git a/packages/mobile/src/components/now-playing-drawer/useCurrentTrackDuration.ts b/packages/mobile/src/components/now-playing-drawer/useCurrentTrackDuration.ts index 30fcf0b2185..2de76a12880 100644 --- a/packages/mobile/src/components/now-playing-drawer/useCurrentTrackDuration.ts +++ b/packages/mobile/src/components/now-playing-drawer/useCurrentTrackDuration.ts @@ -1,4 +1,5 @@ -import { getTrackPreviewDuration, playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' +import { getTrackPreviewDuration } from '@audius/common/utils' import { useSelector } from 'react-redux' const { getCurrentTrack, getPreviewing } = playerSelectors diff --git a/packages/mobile/src/components/offline-downloads/CollectionDownloadStatusIndicator.tsx b/packages/mobile/src/components/offline-downloads/CollectionDownloadStatusIndicator.tsx index 013d54b8495..61f7b0f8eca 100644 --- a/packages/mobile/src/components/offline-downloads/CollectionDownloadStatusIndicator.tsx +++ b/packages/mobile/src/components/offline-downloads/CollectionDownloadStatusIndicator.tsx @@ -1,5 +1,6 @@ -import type { ID } from '@audius/common' -import { cacheCollectionsSelectors, removeNullable } from '@audius/common' +import type { ID } from '@audius/common/models' +import { cacheCollectionsSelectors } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { useIsOfflineModeEnabled } from 'app/hooks/useIsOfflineModeEnabled' import { useProxySelector } from 'app/hooks/useProxySelector' diff --git a/packages/mobile/src/components/offline-downloads/DownloadStatusIndicator.tsx b/packages/mobile/src/components/offline-downloads/DownloadStatusIndicator.tsx index 2b36f168543..715e408fe0a 100644 --- a/packages/mobile/src/components/offline-downloads/DownloadStatusIndicator.tsx +++ b/packages/mobile/src/components/offline-downloads/DownloadStatusIndicator.tsx @@ -1,5 +1,5 @@ -import type { Nullable } from '@audius/common' -import { reachabilitySelectors } from '@audius/common' +import { reachabilitySelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import type { StyleProp, ViewStyle } from 'react-native' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/offline-placeholder/OfflinePlaceholder.tsx b/packages/mobile/src/components/offline-placeholder/OfflinePlaceholder.tsx index fd059823644..fd52f8cad30 100644 --- a/packages/mobile/src/components/offline-placeholder/OfflinePlaceholder.tsx +++ b/packages/mobile/src/components/offline-placeholder/OfflinePlaceholder.tsx @@ -1,4 +1,4 @@ -import { wait } from '@audius/common' +import { wait } from '@audius/common/utils' import NetInfo from '@react-native-community/netinfo' import { View } from 'react-native' import { useAsyncFn } from 'react-use' diff --git a/packages/mobile/src/components/offline-placeholder/OnlineOnly.tsx b/packages/mobile/src/components/offline-placeholder/OnlineOnly.tsx index f4a9b50ef08..154654365d9 100644 --- a/packages/mobile/src/components/offline-placeholder/OnlineOnly.tsx +++ b/packages/mobile/src/components/offline-placeholder/OnlineOnly.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' -import { reachabilitySelectors } from '@audius/common' +import { reachabilitySelectors } from '@audius/common/store' import { useSelector } from 'react-redux' const { getIsReachable } = reachabilitySelectors diff --git a/packages/mobile/src/components/overflow-menu-drawer/CollectionOverflowMenuDrawer.tsx b/packages/mobile/src/components/overflow-menu-drawer/CollectionOverflowMenuDrawer.tsx index f4c068c6797..01d95b552c0 100644 --- a/packages/mobile/src/components/overflow-menu-drawer/CollectionOverflowMenuDrawer.tsx +++ b/packages/mobile/src/components/overflow-menu-drawer/CollectionOverflowMenuDrawer.tsx @@ -1,18 +1,21 @@ import { useContext } from 'react' -import type { ID, OverflowActionCallbacks } from '@audius/common' import { - publishPlaylistConfirmationModalUIActions, - FavoriteSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource +} from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { cacheCollectionsSelectors, cacheUsersSelectors, collectionsSocialActions, deletePlaylistConfirmationModalUIActions, - OverflowAction, - mobileOverflowMenuUISelectors -} from '@audius/common' + mobileOverflowMenuUISelectors, + publishPlaylistConfirmationModalUIActions, + OverflowAction +} from '@audius/common/store' +import type { OverflowActionCallbacks } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useNavigation } from 'app/hooks/useNavigation' diff --git a/packages/mobile/src/components/overflow-menu-drawer/OverflowMenuDrawer.tsx b/packages/mobile/src/components/overflow-menu-drawer/OverflowMenuDrawer.tsx index 7fd7e8539f9..de73ba6f6b9 100644 --- a/packages/mobile/src/components/overflow-menu-drawer/OverflowMenuDrawer.tsx +++ b/packages/mobile/src/components/overflow-menu-drawer/OverflowMenuDrawer.tsx @@ -1,8 +1,8 @@ import { + mobileOverflowMenuUISelectors, OverflowAction, - OverflowSource, - mobileOverflowMenuUISelectors -} from '@audius/common' + OverflowSource +} from '@audius/common/store' import { useSelector } from 'react-redux' import ActionDrawer from 'app/components/action-drawer' diff --git a/packages/mobile/src/components/overflow-menu-drawer/ProfileOverflowMenuDrawer.tsx b/packages/mobile/src/components/overflow-menu-drawer/ProfileOverflowMenuDrawer.tsx index 29d63dcf02d..0a476ce21d1 100644 --- a/packages/mobile/src/components/overflow-menu-drawer/ProfileOverflowMenuDrawer.tsx +++ b/packages/mobile/src/components/overflow-menu-drawer/ProfileOverflowMenuDrawer.tsx @@ -1,13 +1,13 @@ -import type { ID, OverflowActionCallbacks, CommonState } from '@audius/common' +import type { ID } from '@audius/common/models' +import { ShareSource, FollowSource } from '@audius/common/models' +import type { CommonState, OverflowActionCallbacks } from '@audius/common/store' import { - shareModalUIActions, - FollowSource, - ShareSource, cacheUsersSelectors, usersSocialActions, - OverflowAction, - mobileOverflowMenuUISelectors -} from '@audius/common' + mobileOverflowMenuUISelectors, + shareModalUIActions, + OverflowAction +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' const { getMobileOverflowModal } = mobileOverflowMenuUISelectors diff --git a/packages/mobile/src/components/overflow-menu-drawer/TrackOverflowMenuDrawer.tsx b/packages/mobile/src/components/overflow-menu-drawer/TrackOverflowMenuDrawer.tsx index 8840dcde5fa..3f29f791492 100644 --- a/packages/mobile/src/components/overflow-menu-drawer/TrackOverflowMenuDrawer.tsx +++ b/packages/mobile/src/components/overflow-menu-drawer/TrackOverflowMenuDrawer.tsx @@ -1,25 +1,28 @@ import { useContext } from 'react' -import type { ID, OverflowActionCallbacks, CommonState } from '@audius/common' import { - cacheCollectionsActions, - cacheCollectionsSelectors, - collectionPageLineupActions as tracksActions, - shareModalUIActions, - playbackPositionActions, - FavoriteSource, - FollowSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, + FollowSource +} from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { accountSelectors, + cacheCollectionsActions, + cacheCollectionsSelectors, cacheTracksSelectors, cacheUsersSelectors, + collectionPageLineupActions as tracksActions, tracksSocialActions, usersSocialActions, addToCollectionUIActions, + mobileOverflowMenuUISelectors, + shareModalUIActions, OverflowAction, - mobileOverflowMenuUISelectors -} from '@audius/common' + playbackPositionActions +} from '@audius/common/store' +import type { CommonState, OverflowActionCallbacks } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { trpc } from 'utils/trpcClientWeb' diff --git a/packages/mobile/src/components/payment-method/CardSelectionButton.tsx b/packages/mobile/src/components/payment-method/CardSelectionButton.tsx index 12a1e7920ba..51774661b02 100644 --- a/packages/mobile/src/components/payment-method/CardSelectionButton.tsx +++ b/packages/mobile/src/components/payment-method/CardSelectionButton.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { PurchaseVendor } from '@audius/common' -import { modalsActions } from '@audius/common' +import type { PurchaseVendor } from '@audius/common/models' +import { modalsActions } from '@audius/common/store' import { TouchableOpacity } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/payment-method/PaymentMethod.tsx b/packages/mobile/src/components/payment-method/PaymentMethod.tsx index 781c71b1a84..1ca09767057 100644 --- a/packages/mobile/src/components/payment-method/PaymentMethod.tsx +++ b/packages/mobile/src/components/payment-method/PaymentMethod.tsx @@ -1,13 +1,13 @@ import { useEffect } from 'react' -import type { Nullable, BNUSDC } from '@audius/common' +import { PurchaseMethod, PurchaseVendor } from '@audius/common/models' +import type { BNUSDC } from '@audius/common/models' import { - PurchaseMethod, - formatUSDCWeiToFloorCentsNumber, formatCurrencyBalance, - PurchaseVendor, - removeNullable -} from '@audius/common' + removeNullable, + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import BN from 'bn.js' import { FlatList, View, TouchableOpacity } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/playback-rate-drawer/PlaybackRateDrawer.tsx b/packages/mobile/src/components/playback-rate-drawer/PlaybackRateDrawer.tsx index 1a92a5d8b32..e659240e409 100644 --- a/packages/mobile/src/components/playback-rate-drawer/PlaybackRateDrawer.tsx +++ b/packages/mobile/src/components/playback-rate-drawer/PlaybackRateDrawer.tsx @@ -1,7 +1,7 @@ import { useCallback, useMemo } from 'react' -import type { PlaybackRate } from '@audius/common' -import { playerActions } from '@audius/common' +import type { PlaybackRate } from '@audius/common/store' +import { playerActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import ActionDrawer from '../action-drawer' diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/PayExtraFormSection.tsx b/packages/mobile/src/components/premium-track-purchase-drawer/PayExtraFormSection.tsx index e0637a32ef5..f9936318d1b 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/PayExtraFormSection.tsx +++ b/packages/mobile/src/components/premium-track-purchase-drawer/PayExtraFormSection.tsx @@ -1,5 +1,9 @@ -import type { PayExtraAmountPresetValues } from '@audius/common' -import { AMOUNT_PRESET, CUSTOM_AMOUNT, PayExtraPreset } from '@audius/common' +import { + PayExtraPreset, + CUSTOM_AMOUNT, + AMOUNT_PRESET +} from '@audius/common/hooks' +import type { PayExtraAmountPresetValues } from '@audius/common/hooks' import { useField } from 'formik' import { View } from 'react-native' diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/PremiumTrackPurchaseDrawer.tsx b/packages/mobile/src/components/premium-track-purchase-drawer/PremiumTrackPurchaseDrawer.tsx index 595cf0ce987..23df12db210 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/PremiumTrackPurchaseDrawer.tsx +++ b/packages/mobile/src/components/premium-track-purchase-drawer/PremiumTrackPurchaseDrawer.tsx @@ -1,33 +1,34 @@ import { useCallback, type ReactNode, useEffect } from 'react' -import type { - PurchaseableTrackMetadata, - PurchaseContentError -} from '@audius/common' +import { useGetTrackById } from '@audius/common/api' import { - PurchaseContentPage, - FeatureFlags, - Name, - PURCHASE_METHOD, - PurchaseContentStage, - formatPrice, - isContentPurchaseInProgress, + useRemoteVar, + useUSDCBalance, + usePurchaseContentFormConfiguration, + usePurchaseContentErrorMessage, + usePayExtraPresets, isTrackPurchaseable, + PURCHASE_METHOD, + PURCHASE_VENDOR, + usePurchaseMethod +} from '@audius/common/hooks' +import type { PurchaseableTrackMetadata } from '@audius/common/hooks' +import { + Name, + PurchaseVendor, + statusIsNotFinalized +} from '@audius/common/models' +import { IntKeys, FeatureFlags } from '@audius/common/services' +import { + usePremiumContentPurchaseModal, purchaseContentActions, purchaseContentSelectors, - statusIsNotFinalized, - useGetTrackById, - usePayExtraPresets, - usePremiumContentPurchaseModal, - usePurchaseContentErrorMessage, - usePurchaseContentFormConfiguration, - usePurchaseMethod, - useUSDCBalance, - PURCHASE_VENDOR, - useRemoteVar, - IntKeys, - PurchaseVendor -} from '@audius/common' + PurchaseContentStage, + PurchaseContentPage, + isContentPurchaseInProgress +} from '@audius/common/store' +import type { PurchaseContentError } from '@audius/common/store' +import { formatPrice } from '@audius/common/utils' import { Formik, useField, useFormikContext } from 'formik' import { Linking, diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSuccess.tsx b/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSuccess.tsx index 0e429110c9b..00ea8f29fda 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSuccess.tsx +++ b/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSuccess.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { UserTrackMetadata } from '@audius/common' +import type { UserTrackMetadata } from '@audius/common/models' import { View } from 'react-native' import { IconCaretRight, IconVerified } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSummaryTable.tsx b/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSummaryTable.tsx index 1d2a2ea93b7..4ed65260c65 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSummaryTable.tsx +++ b/packages/mobile/src/components/premium-track-purchase-drawer/PurchaseSummaryTable.tsx @@ -1,4 +1,4 @@ -import { formatPrice } from '@audius/common' +import { formatPrice } from '@audius/common/utils' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseContentFormState.ts b/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseContentFormState.ts index 90f2bc1ed40..ba897bf63a8 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseContentFormState.ts +++ b/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseContentFormState.ts @@ -1,8 +1,8 @@ +import { useUSDCBalance } from '@audius/common/hooks' import { - isContentPurchaseInProgress, purchaseContentSelectors, - useUSDCBalance -} from '@audius/common' + isContentPurchaseInProgress +} from '@audius/common/store' import { useSelector } from 'react-redux' import { usePurchaseSummaryValues } from './usePurchaseSummaryValues' diff --git a/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseSummaryValues.ts b/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseSummaryValues.ts index dd07819131a..79e22b1e85b 100644 --- a/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseSummaryValues.ts +++ b/packages/mobile/src/components/premium-track-purchase-drawer/hooks/usePurchaseSummaryValues.ts @@ -1,13 +1,14 @@ -import type { Nullable, BNUSDC } from '@audius/common' import { - CUSTOM_AMOUNT, - AMOUNT_PRESET, + useUSDCPurchaseConfig, + usePayExtraPresets, getExtraAmount, - getPurchaseSummaryValues, PayExtraPreset, - usePayExtraPresets, - useUSDCPurchaseConfig -} from '@audius/common' + CUSTOM_AMOUNT, + AMOUNT_PRESET +} from '@audius/common/hooks' +import type { BNUSDC } from '@audius/common/models' +import { getPurchaseSummaryValues } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' export const usePurchaseSummaryValues = ({ diff --git a/packages/mobile/src/components/profile-actions-drawer/ProfileActionsDrawer.tsx b/packages/mobile/src/components/profile-actions-drawer/ProfileActionsDrawer.tsx index 476907fa0fa..e12e4ff4697 100644 --- a/packages/mobile/src/components/profile-actions-drawer/ProfileActionsDrawer.tsx +++ b/packages/mobile/src/components/profile-actions-drawer/ProfileActionsDrawer.tsx @@ -1,12 +1,12 @@ import { useCallback, useEffect, useMemo } from 'react' +import { ShareSource } from '@audius/common/models' import { - ShareSource, - shareModalUIActions, profilePageSelectors, + chatActions, chatSelectors, - chatActions -} from '@audius/common' + shareModalUIActions +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import ActionDrawer from 'app/components/action-drawer' diff --git a/packages/mobile/src/components/profile-list/ProfileCard.tsx b/packages/mobile/src/components/profile-list/ProfileCard.tsx index 02d076098d6..838e4274f04 100644 --- a/packages/mobile/src/components/profile-list/ProfileCard.tsx +++ b/packages/mobile/src/components/profile-list/ProfileCard.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { User } from '@audius/common' -import { SquareSizes } from '@audius/common' +import type { User } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' import { Card } from 'app/components/card' import type { ProfileCardProps as BaseProfileCardProps } from 'app/components/card' diff --git a/packages/mobile/src/components/profile-list/ProfileList.tsx b/packages/mobile/src/components/profile-list/ProfileList.tsx index 0026f116d98..066f90311a5 100644 --- a/packages/mobile/src/components/profile-list/ProfileList.tsx +++ b/packages/mobile/src/components/profile-list/ProfileList.tsx @@ -1,4 +1,4 @@ -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import type { CardListProps } from 'app/components/core' import { CardList } from 'app/components/core' diff --git a/packages/mobile/src/components/publish-playlist-drawer/PublishPlaylistDrawer.tsx b/packages/mobile/src/components/publish-playlist-drawer/PublishPlaylistDrawer.tsx index b998b997931..27d56b89967 100644 --- a/packages/mobile/src/components/publish-playlist-drawer/PublishPlaylistDrawer.tsx +++ b/packages/mobile/src/components/publish-playlist-drawer/PublishPlaylistDrawer.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { cacheCollectionsActions, publishPlaylistConfirmationModalUISelectors -} from '@audius/common' +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/purchase-vendor-drawer/PurchaseVendorDrawer.tsx b/packages/mobile/src/components/purchase-vendor-drawer/PurchaseVendorDrawer.tsx index 882e87e682c..6d6c51d986d 100644 --- a/packages/mobile/src/components/purchase-vendor-drawer/PurchaseVendorDrawer.tsx +++ b/packages/mobile/src/components/purchase-vendor-drawer/PurchaseVendorDrawer.tsx @@ -1,6 +1,8 @@ import { useCallback, useMemo } from 'react' -import { FeatureFlags, PurchaseVendor, useFeatureFlag } from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { PurchaseVendor } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { useDispatch } from 'react-redux' import { setPurchaseVendor } from 'app/store/purchase-vendor/slice' diff --git a/packages/mobile/src/components/rate-cta-drawer/RateCtaDrawer.tsx b/packages/mobile/src/components/rate-cta-drawer/RateCtaDrawer.tsx index 4bfc2093f76..27947317a8d 100644 --- a/packages/mobile/src/components/rate-cta-drawer/RateCtaDrawer.tsx +++ b/packages/mobile/src/components/rate-cta-drawer/RateCtaDrawer.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' -import type { Nullable } from '@audius/common' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import AsyncStorage from '@react-native-async-storage/async-storage' import { View } from 'react-native' import InAppReview from 'react-native-in-app-review' diff --git a/packages/mobile/src/components/rate-cta-drawer/RateCtaReminder.tsx b/packages/mobile/src/components/rate-cta-drawer/RateCtaReminder.tsx index 211666636e3..a10d013af02 100644 --- a/packages/mobile/src/components/rate-cta-drawer/RateCtaReminder.tsx +++ b/packages/mobile/src/components/rate-cta-drawer/RateCtaReminder.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import AsyncStorage from '@react-native-async-storage/async-storage' import { getHasCompletedAccount } from 'common/store/pages/signon/selectors' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/scrubber/Scrubber.tsx b/packages/mobile/src/components/scrubber/Scrubber.tsx index bbdc6724c82..aea70a21d0c 100644 --- a/packages/mobile/src/components/scrubber/Scrubber.tsx +++ b/packages/mobile/src/components/scrubber/Scrubber.tsx @@ -1,6 +1,7 @@ import { useCallback, useState } from 'react' -import { formatSeconds, playerActions } from '@audius/common' +import { playerActions } from '@audius/common/store' +import { formatSeconds } from '@audius/common/utils' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/scrubber/Slider.tsx b/packages/mobile/src/components/scrubber/Slider.tsx index 946d1f69b1e..8ce0bf8cdb4 100644 --- a/packages/mobile/src/components/scrubber/Slider.tsx +++ b/packages/mobile/src/components/scrubber/Slider.tsx @@ -1,6 +1,6 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { playbackRateValueMap, playerSelectors } from '@audius/common' +import { playerSelectors, playbackRateValueMap } from '@audius/common/store' import { useAppState } from '@react-native-community/hooks' import type { GestureResponderEvent } from 'react-native' import { Easing, View, Animated, PanResponder } from 'react-native' diff --git a/packages/mobile/src/components/scrubber/usePosition.ts b/packages/mobile/src/components/scrubber/usePosition.ts index f7a6a303870..0021ae700b6 100644 --- a/packages/mobile/src/components/scrubber/usePosition.ts +++ b/packages/mobile/src/components/scrubber/usePosition.ts @@ -1,10 +1,7 @@ import { useCallback, useEffect, useRef } from 'react' -import { - formatSeconds, - playerSelectors, - playbackRateValueMap -} from '@audius/common' +import { playerSelectors, playbackRateValueMap } from '@audius/common/store' +import { formatSeconds } from '@audius/common/utils' import { useAppState } from '@react-native-community/hooks' import type { TextInput } from 'react-native' import TrackPlayer from 'react-native-track-player' diff --git a/packages/mobile/src/components/share-drawer/ShareDrawer.tsx b/packages/mobile/src/components/share-drawer/ShareDrawer.tsx index 25ecc03cfce..4d252922982 100644 --- a/packages/mobile/src/components/share-drawer/ShareDrawer.tsx +++ b/packages/mobile/src/components/share-drawer/ShareDrawer.tsx @@ -1,16 +1,15 @@ import React, { useCallback, useRef } from 'react' +import { Name, ShareSource } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { accountSelectors, collectionsSocialActions, - FeatureFlags, - Name, - shareModalUISelectors, - shareSoundToTiktokModalActions, - ShareSource, tracksSocialActions, - usersSocialActions -} from '@audius/common' + usersSocialActions, + shareModalUISelectors, + shareSoundToTiktokModalActions +} from '@audius/common/store' import Clipboard from '@react-native-clipboard/clipboard' import { Linking } from 'react-native' import ViewShot from 'react-native-view-shot' diff --git a/packages/mobile/src/components/share-drawer/ShareToStorySticker.tsx b/packages/mobile/src/components/share-drawer/ShareToStorySticker.tsx index 77d04853023..9b8670ff867 100644 --- a/packages/mobile/src/components/share-drawer/ShareToStorySticker.tsx +++ b/packages/mobile/src/components/share-drawer/ShareToStorySticker.tsx @@ -1,5 +1,5 @@ -import type { Track, User } from '@audius/common' -import { SquareSizes } from '@audius/common' +import type { Track, User } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' import type { StyleProp, ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/components/share-drawer/messages.ts b/packages/mobile/src/components/share-drawer/messages.ts index c8476085ee8..83c2904ceb2 100644 --- a/packages/mobile/src/components/share-drawer/messages.ts +++ b/packages/mobile/src/components/share-drawer/messages.ts @@ -1,4 +1,4 @@ -import type { ShareType } from '@audius/common' +import type { ShareType } from '@audius/common/store' const shareTypeMap: Record = { track: 'Track', diff --git a/packages/mobile/src/components/share-drawer/useShareToStory.tsx b/packages/mobile/src/components/share-drawer/useShareToStory.tsx index 9ecd357e9d3..7122bfe0333 100644 --- a/packages/mobile/src/components/share-drawer/useShareToStory.tsx +++ b/packages/mobile/src/components/share-drawer/useShareToStory.tsx @@ -3,14 +3,12 @@ import { useCallback, useMemo, useRef, useState } from 'react' import EventEmitter from 'events' import path from 'path' -import type { Color, Nullable, ShareContent } from '@audius/common' -import { - encodeHashId, - ErrorLevel, - modalsActions, - SquareSizes, - uuid -} from '@audius/common' +import { ErrorLevel, SquareSizes } from '@audius/common/models' +import type { Color } from '@audius/common/models' +import { modalsActions } from '@audius/common/store' +import type { ShareContent } from '@audius/common/store' +import { encodeHashId, uuid } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { activateKeepAwake, deactivateKeepAwake diff --git a/packages/mobile/src/components/share-drawer/utils.ts b/packages/mobile/src/components/share-drawer/utils.ts index fd75c7db55b..f44c082e4ce 100644 --- a/packages/mobile/src/components/share-drawer/utils.ts +++ b/packages/mobile/src/components/share-drawer/utils.ts @@ -1,5 +1,5 @@ -import type { ShareContent } from '@audius/common' -import { makeTwitterShareUrl } from '@audius/common' +import type { ShareContent } from '@audius/common/store' +import { makeTwitterShareUrl } from '@audius/common/utils' import { audiusBackendInstance } from 'app/services/audius-backend-instance' import { diff --git a/packages/mobile/src/components/share-to-tiktok-drawer/ShareToTikTokDrawer.tsx b/packages/mobile/src/components/share-to-tiktok-drawer/ShareToTikTokDrawer.tsx index 1716528fd79..c03190e2ad4 100644 --- a/packages/mobile/src/components/share-to-tiktok-drawer/ShareToTikTokDrawer.tsx +++ b/packages/mobile/src/components/share-to-tiktok-drawer/ShareToTikTokDrawer.tsx @@ -1,11 +1,11 @@ import { useMemo } from 'react' -import type { Nullable } from '@audius/common' import { shareSoundToTiktokModalActions, - ShareSoundToTiktokModalStatus, - shareSoundToTiktokModalSelectors -} from '@audius/common' + shareSoundToTiktokModalSelectors, + ShareSoundToTiktokModalStatus +} from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { View } from 'react-native' import { useSelector, useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/sign-out-confirmation-drawer/SignOutConfirmationDrawer.tsx b/packages/mobile/src/components/sign-out-confirmation-drawer/SignOutConfirmationDrawer.tsx index 0b2d637d363..a0e6f0a81ae 100644 --- a/packages/mobile/src/components/sign-out-confirmation-drawer/SignOutConfirmationDrawer.tsx +++ b/packages/mobile/src/components/sign-out-confirmation-drawer/SignOutConfirmationDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { signOutActions } from '@audius/common' +import { signOutActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampDrawer.tsx b/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampDrawer.tsx index ecf344a652b..ed43aa1798d 100644 --- a/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampDrawer.tsx +++ b/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampDrawer.tsx @@ -1,6 +1,9 @@ import { useCallback } from 'react' -import { stripeModalUIActions, stripeModalUISelectors } from '@audius/common' +import { + stripeModalUIActions, + stripeModalUISelectors +} from '@audius/common/store' import { TouchableOpacity, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampEmbed.tsx b/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampEmbed.tsx index e15c8ca08f4..da5ab08b6f3 100644 --- a/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampEmbed.tsx +++ b/packages/mobile/src/components/stripe-onramp-drawer/StripeOnrampEmbed.tsx @@ -1,7 +1,10 @@ import { useCallback } from 'react' -import type { StripeSessionData } from '@audius/common' -import { stripeModalUISelectors, stripeModalUIActions } from '@audius/common' +import type { StripeSessionData } from '@audius/common/store' +import { + stripeModalUIActions, + stripeModalUISelectors +} from '@audius/common/store' import { View } from 'react-native' import { WebView } from 'react-native-webview' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/suggested-follows/PickArtistsForMeButton.tsx b/packages/mobile/src/components/suggested-follows/PickArtistsForMeButton.tsx index 96515f5c3a4..5e936bd6f69 100644 --- a/packages/mobile/src/components/suggested-follows/PickArtistsForMeButton.tsx +++ b/packages/mobile/src/components/suggested-follows/PickArtistsForMeButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { ID } from '@audius/common' +import type { ID } from '@audius/common/models' import { addFollowArtists } from 'common/store/pages/signon/actions' import { getFollowIds, diff --git a/packages/mobile/src/components/suggested-follows/SuggestedArtistsList.tsx b/packages/mobile/src/components/suggested-follows/SuggestedArtistsList.tsx index 943c899c3da..3adeb3b02e8 100644 --- a/packages/mobile/src/components/suggested-follows/SuggestedArtistsList.tsx +++ b/packages/mobile/src/components/suggested-follows/SuggestedArtistsList.tsx @@ -1,7 +1,10 @@ import { useCallback } from 'react' -import type { CommonState, ID, Maybe } from '@audius/common' -import { useProxySelector, removeNullable } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import type { ID } from '@audius/common/models' +import type { CommonState } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' +import type { Maybe } from '@audius/common/utils' import { removeFollowArtists, addFollowArtists diff --git a/packages/mobile/src/components/suggested-tracks/SuggestedCollectionTracks.tsx b/packages/mobile/src/components/suggested-tracks/SuggestedCollectionTracks.tsx index 99c9f88babd..40182b291a6 100644 --- a/packages/mobile/src/components/suggested-tracks/SuggestedCollectionTracks.tsx +++ b/packages/mobile/src/components/suggested-tracks/SuggestedCollectionTracks.tsx @@ -1,10 +1,10 @@ -import type { ID } from '@audius/common' import { - useGetCurrentUserId, useGetPlaylistById, useGetSuggestedAlbumTracks, - useGetSuggestedPlaylistTracks -} from '@audius/common' + useGetSuggestedPlaylistTracks, + useGetCurrentUserId +} from '@audius/common/api' +import type { ID } from '@audius/common/models' import { SuggestedTracks } from './components/SuggestedTracks' diff --git a/packages/mobile/src/components/suggested-tracks/components/SuggestedTracks.tsx b/packages/mobile/src/components/suggested-tracks/components/SuggestedTracks.tsx index 7c1c0591fc9..f3c39039865 100644 --- a/packages/mobile/src/components/suggested-tracks/components/SuggestedTracks.tsx +++ b/packages/mobile/src/components/suggested-tracks/components/SuggestedTracks.tsx @@ -1,7 +1,9 @@ import { Fragment, useCallback, useEffect, useRef } from 'react' -import type { ID, Track, SuggestedTrack } from '@audius/common' -import { SquareSizes, cacheUsersSelectors } from '@audius/common' +import type { SuggestedTrack } from '@audius/common/api' +import { SquareSizes } from '@audius/common/models' +import type { ID, Track } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import { Animated, LayoutAnimation, View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/summary-table/SummaryTable.tsx b/packages/mobile/src/components/summary-table/SummaryTable.tsx index 58ea044caa1..0248ef6d4ef 100644 --- a/packages/mobile/src/components/summary-table/SummaryTable.tsx +++ b/packages/mobile/src/components/summary-table/SummaryTable.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import React, { useCallback, useState } from 'react' -import { removeNullable } from '@audius/common' +import { removeNullable } from '@audius/common/utils' import { LayoutAnimation, View } from 'react-native' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/components/tiktok-auth/TikTokAuthButton.tsx b/packages/mobile/src/components/tiktok-auth/TikTokAuthButton.tsx index 8d3de42cf92..53a4215fcb5 100644 --- a/packages/mobile/src/components/tiktok-auth/TikTokAuthButton.tsx +++ b/packages/mobile/src/components/tiktok-auth/TikTokAuthButton.tsx @@ -1,5 +1,5 @@ -import type { TikTokProfileData } from '@audius/common' -import { formatTikTokProfile } from '@audius/common' +import type { TikTokProfileData } from '@audius/common/services' +import { formatTikTokProfile } from '@audius/common/services' import type { GestureResponderEvent } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/components/toasts/Toast.tsx b/packages/mobile/src/components/toasts/Toast.tsx index 7e1c0c152e7..d20590fe270 100644 --- a/packages/mobile/src/components/toasts/Toast.tsx +++ b/packages/mobile/src/components/toasts/Toast.tsx @@ -1,7 +1,7 @@ import { useRef, useCallback, useEffect } from 'react' -import { toastActions } from '@audius/common' -import type { Toast as ToastType } from '@audius/common' +import type { Toast as ToastType } from '@audius/common/store' +import { toastActions } from '@audius/common/store' import { Link } from '@react-navigation/native' import type { To } from '@react-navigation/native/lib/typescript/src/useLinkTo' import { Animated, View } from 'react-native' diff --git a/packages/mobile/src/components/toasts/Toasts.tsx b/packages/mobile/src/components/toasts/Toasts.tsx index f7b0fc95015..ee786c38dc0 100644 --- a/packages/mobile/src/components/toasts/Toasts.tsx +++ b/packages/mobile/src/components/toasts/Toasts.tsx @@ -1,4 +1,4 @@ -import { toastSelectors } from '@audius/common' +import { toastSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { Toast } from './Toast' diff --git a/packages/mobile/src/components/track-details-tile/TrackDetailsTile.tsx b/packages/mobile/src/components/track-details-tile/TrackDetailsTile.tsx index de253a12cee..5298855b1bc 100644 --- a/packages/mobile/src/components/track-details-tile/TrackDetailsTile.tsx +++ b/packages/mobile/src/components/track-details-tile/TrackDetailsTile.tsx @@ -1,17 +1,16 @@ import type { ComponentType } from 'react' import { useMemo } from 'react' -import type { ID } from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' import { SquareSizes, - getDogEarType, + GatedContentType, isContentCollectibleGated, - useGatedContentAccess, - cacheUsersSelectors, - cacheTracksSelectors, - isContentUSDCPurchaseGated, - GatedContentType -} from '@audius/common' + isContentUSDCPurchaseGated +} from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { cacheTracksSelectors, cacheUsersSelectors } from '@audius/common/store' +import { getDogEarType } from '@audius/common/utils' import type { ColorValue } from 'react-native' import { View } from 'react-native' import type { SvgProps } from 'react-native-svg' diff --git a/packages/mobile/src/components/track-list/TrackArtwork.tsx b/packages/mobile/src/components/track-list/TrackArtwork.tsx index 2bcfd963991..0ecf078f369 100644 --- a/packages/mobile/src/components/track-list/TrackArtwork.tsx +++ b/packages/mobile/src/components/track-list/TrackArtwork.tsx @@ -1,5 +1,5 @@ -import type { Track } from '@audius/common' -import { SquareSizes } from '@audius/common' +import type { Track } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' import { View } from 'react-native' import { diff --git a/packages/mobile/src/components/track-list/TrackList.tsx b/packages/mobile/src/components/track-list/TrackList.tsx index ebfcdbc7ce5..7f96aee3209 100644 --- a/packages/mobile/src/components/track-list/TrackList.tsx +++ b/packages/mobile/src/components/track-list/TrackList.tsx @@ -1,7 +1,7 @@ import type { ReactElement } from 'react' import { Fragment, useCallback, useMemo, useState } from 'react' -import type { ID, UID } from '@audius/common' +import type { ID, UID } from '@audius/common/models' import type { FlatListProps } from 'react-native' import { FlatList, View } from 'react-native' import type { diff --git a/packages/mobile/src/components/track-list/TrackListItem.tsx b/packages/mobile/src/components/track-list/TrackListItem.tsx index f8c47602432..e9b927bd01e 100644 --- a/packages/mobile/src/components/track-list/TrackListItem.tsx +++ b/packages/mobile/src/components/track-list/TrackListItem.tsx @@ -1,22 +1,21 @@ import type { ComponentType } from 'react' import { memo, useCallback, useMemo, useState } from 'react' -import type { Collection, ID, Track, UID, User } from '@audius/common' +import { useGatedContentAccess } from '@audius/common/hooks' +import type { Collection, ID, UID, Track, User } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { + accountSelectors, cacheCollectionsSelectors, - useGatedContentAccess, - FeatureFlags, - playbackPositionSelectors, - Genre, - removeNullable, + cacheTracksSelectors, + cacheUsersSelectors, + mobileOverflowMenuUIActions, OverflowAction, OverflowSource, - mobileOverflowMenuUIActions, - accountSelectors, - cacheUsersSelectors, - cacheTracksSelectors, - playerSelectors -} from '@audius/common' + playerSelectors, + playbackPositionSelectors +} from '@audius/common/store' +import { Genre, removeNullable } from '@audius/common/utils' import type { NativeSyntheticEvent, NativeTouchEvent, diff --git a/packages/mobile/src/components/track-list/types.ts b/packages/mobile/src/components/track-list/types.ts index 04eba4ae409..eae25ffe4f0 100644 --- a/packages/mobile/src/components/track-list/types.ts +++ b/packages/mobile/src/components/track-list/types.ts @@ -1,4 +1,5 @@ -import type { CommonState, lineupSelectors, LineupTrack } from '@audius/common' +import type { LineupTrack } from '@audius/common/models' +import type { lineupSelectors, CommonState } from '@audius/common/store' import type { SetOptional } from 'type-fest' export type TrackMetadata = SetOptional< diff --git a/packages/mobile/src/components/trending-rewards-drawer/TrendingRewardsDrawer.tsx b/packages/mobile/src/components/trending-rewards-drawer/TrendingRewardsDrawer.tsx index 6c3417ba594..bcb408bbaba 100644 --- a/packages/mobile/src/components/trending-rewards-drawer/TrendingRewardsDrawer.tsx +++ b/packages/mobile/src/components/trending-rewards-drawer/TrendingRewardsDrawer.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' -import type { TrendingRewardsModalType } from '@audius/common' +import { Theme } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - Theme, - StringKeys, - audioRewardsPageActions, - audioRewardsPageSelectors -} from '@audius/common' + audioRewardsPageSelectors, + audioRewardsPageActions +} from '@audius/common/store' +import type { TrendingRewardsModalType } from '@audius/common/store' import type { ImageStyle } from 'react-native' import { Image, ScrollView, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/twitter-button/TwitterButton.tsx b/packages/mobile/src/components/twitter-button/TwitterButton.tsx index 3e39415e0e9..449092931c3 100644 --- a/packages/mobile/src/components/twitter-button/TwitterButton.tsx +++ b/packages/mobile/src/components/twitter-button/TwitterButton.tsx @@ -1,12 +1,9 @@ import { useCallback } from 'react' -import type { Nullable } from '@audius/common' -import { - makeTwitterShareUrl, - useTwitterButtonStatus, - cacheUsersActions, - cacheUsersSelectors -} from '@audius/common' +import { useTwitterButtonStatus } from '@audius/common/hooks' +import { cacheUsersActions, cacheUsersSelectors } from '@audius/common/store' +import { makeTwitterShareUrl } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { IconTwitter } from '@audius/harmony-native' diff --git a/packages/mobile/src/components/usdc-balance-pill/USDCBalancePill.tsx b/packages/mobile/src/components/usdc-balance-pill/USDCBalancePill.tsx index c4b42228d60..d9ef3cd1f9f 100644 --- a/packages/mobile/src/components/usdc-balance-pill/USDCBalancePill.tsx +++ b/packages/mobile/src/components/usdc-balance-pill/USDCBalancePill.tsx @@ -1,10 +1,10 @@ -import type { BNUSDC } from '@audius/common' +import { useUSDCBalance } from '@audius/common/hooks' +import type { BNUSDC } from '@audius/common/models' +import { Status } from '@audius/common/models' import { - Status, formatCurrencyBalance, - formatUSDCWeiToFloorCentsNumber, - useUSDCBalance -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import BN from 'bn.js' import { View } from 'react-native' diff --git a/packages/mobile/src/components/usdc-balance-row/USDCBalanceRow.tsx b/packages/mobile/src/components/usdc-balance-row/USDCBalanceRow.tsx index efe7cc408b2..3252b7e5992 100644 --- a/packages/mobile/src/components/usdc-balance-row/USDCBalanceRow.tsx +++ b/packages/mobile/src/components/usdc-balance-row/USDCBalanceRow.tsx @@ -1,9 +1,9 @@ -import type { BNUSDC } from '@audius/common' +import { useUSDCBalance } from '@audius/common/hooks' +import type { BNUSDC } from '@audius/common/models' import { formatCurrencyBalance, - formatUSDCWeiToFloorCentsNumber, - useUSDCBalance -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import BN from 'bn.js' import { View } from 'react-native' diff --git a/packages/mobile/src/components/usdc-manual-transfer-drawer/USDCManualTransferDrawer.tsx b/packages/mobile/src/components/usdc-manual-transfer-drawer/USDCManualTransferDrawer.tsx index fbf63dfef73..c8820abd78a 100644 --- a/packages/mobile/src/components/usdc-manual-transfer-drawer/USDCManualTransferDrawer.tsx +++ b/packages/mobile/src/components/usdc-manual-transfer-drawer/USDCManualTransferDrawer.tsx @@ -1,4 +1,4 @@ -import { useUSDCManualTransferModal } from '@audius/common' +import { useUSDCManualTransferModal } from '@audius/common/store' import { View } from 'react-native' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/components/usdc-manual-transfer/USDCManualTransfer.tsx b/packages/mobile/src/components/usdc-manual-transfer/USDCManualTransfer.tsx index 8e43a835a49..3624f2469f6 100644 --- a/packages/mobile/src/components/usdc-manual-transfer/USDCManualTransfer.tsx +++ b/packages/mobile/src/components/usdc-manual-transfer/USDCManualTransfer.tsx @@ -1,6 +1,7 @@ import { useCallback, useMemo } from 'react' -import { Name, useCreateUserbankIfNeeded, useUSDCBalance } from '@audius/common' +import { useUSDCBalance, useCreateUserbankIfNeeded } from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { USDC } from '@audius/fixed-decimal' import Clipboard from '@react-native-clipboard/clipboard' import BN from 'bn.js' diff --git a/packages/mobile/src/components/user-badges/UserBadges.tsx b/packages/mobile/src/components/user-badges/UserBadges.tsx index 5f145597f63..8753ae4c4a6 100644 --- a/packages/mobile/src/components/user-badges/UserBadges.tsx +++ b/packages/mobile/src/components/user-badges/UserBadges.tsx @@ -1,7 +1,7 @@ import type { ComponentType } from 'react' -import { useSelectTierInfo } from '@audius/common' -import type { User } from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import type { User } from '@audius/common/models' import type { ViewStyle, StyleProp, TextStyle } from 'react-native' import { StyleSheet, View, Text } from 'react-native' diff --git a/packages/mobile/src/components/user/FollowButton.tsx b/packages/mobile/src/components/user/FollowButton.tsx index 11bd03d50c0..0e0fec797de 100644 --- a/packages/mobile/src/components/user/FollowButton.tsx +++ b/packages/mobile/src/components/user/FollowButton.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { FollowSource, ID } from '@audius/common' -import { cacheUsersSelectors, usersSocialActions } from '@audius/common' +import type { FollowSource, ID } from '@audius/common/models' +import { cacheUsersSelectors, usersSocialActions } from '@audius/common/store' import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/user/FollowsYouChip.tsx b/packages/mobile/src/components/user/FollowsYouChip.tsx index 4e06cadf106..1b49760c7a7 100644 --- a/packages/mobile/src/components/user/FollowsYouChip.tsx +++ b/packages/mobile/src/components/user/FollowsYouChip.tsx @@ -1,5 +1,5 @@ -import type { ID } from '@audius/common' -import { accountSelectors } from '@audius/common' +import type { ID } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/user/ProfilePicture.tsx b/packages/mobile/src/components/user/ProfilePicture.tsx index 0c805d50434..594d94c8b6f 100644 --- a/packages/mobile/src/components/user/ProfilePicture.tsx +++ b/packages/mobile/src/components/user/ProfilePicture.tsx @@ -1,5 +1,5 @@ -import type { ID } from '@audius/common' -import { SquareSizes } from '@audius/common' +import type { ID } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' import { UserImage } from 'app/components/image/UserImage' import { makeStyles } from 'app/styles' diff --git a/packages/mobile/src/components/vip-discord-drawer/VipDiscordDrawer.tsx b/packages/mobile/src/components/vip-discord-drawer/VipDiscordDrawer.tsx index ad0a633761c..8297bb2091c 100644 --- a/packages/mobile/src/components/vip-discord-drawer/VipDiscordDrawer.tsx +++ b/packages/mobile/src/components/vip-discord-drawer/VipDiscordDrawer.tsx @@ -1,4 +1,4 @@ -import { vipDiscordModalSelectors } from '@audius/common' +import { vipDiscordModalSelectors } from '@audius/common/store' import { AUDIUS_DISCORD_LINK } from 'audius-client/src/utils/route' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/components/wait-for-download-drawer/WaitForDownloadDrawer.tsx b/packages/mobile/src/components/wait-for-download-drawer/WaitForDownloadDrawer.tsx index 160a7b2af43..bfb0ad3a839 100644 --- a/packages/mobile/src/components/wait-for-download-drawer/WaitForDownloadDrawer.tsx +++ b/packages/mobile/src/components/wait-for-download-drawer/WaitForDownloadDrawer.tsx @@ -1,5 +1,8 @@ -import type { CommonState } from '@audius/common' -import { cacheTracksSelectors, useWaitForDownloadModal } from '@audius/common' +import type { CommonState } from '@audius/common/store' +import { + cacheTracksSelectors, + useWaitForDownloadModal +} from '@audius/common/store' import { css } from '@emotion/native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/env/env.dev.ts b/packages/mobile/src/env/env.dev.ts index 6d630b5a266..8e2769355f4 100644 --- a/packages/mobile/src/env/env.dev.ts +++ b/packages/mobile/src/env/env.dev.ts @@ -1,4 +1,4 @@ -import type { Env } from '@audius/common' +import type { Env } from '@audius/common/services' import Config from 'react-native-config' export const env: Env = { diff --git a/packages/mobile/src/env/env.prod.ts b/packages/mobile/src/env/env.prod.ts index 8ce424675f6..122d8b23acd 100644 --- a/packages/mobile/src/env/env.prod.ts +++ b/packages/mobile/src/env/env.prod.ts @@ -1,4 +1,4 @@ -import type { Env } from '@audius/common' +import type { Env } from '@audius/common/services' import Config from 'react-native-config' export const env: Env = { diff --git a/packages/mobile/src/env/env.stage.ts b/packages/mobile/src/env/env.stage.ts index 7ec0533b7c6..fdd02a07fbb 100644 --- a/packages/mobile/src/env/env.stage.ts +++ b/packages/mobile/src/env/env.stage.ts @@ -1,4 +1,4 @@ -import type { Env } from '@audius/common' +import type { Env } from '@audius/common/services' import Config from 'react-native-config' export const env: Env = { diff --git a/packages/mobile/src/env/index.ts b/packages/mobile/src/env/index.ts index f74cfedf0f7..abaeb1c7eae 100644 --- a/packages/mobile/src/env/index.ts +++ b/packages/mobile/src/env/index.ts @@ -1,4 +1,4 @@ -import type { Env } from '@audius/common' +import type { Env } from '@audius/common/services' import Config from 'react-native-config' import { env as envDev } from './env.dev' diff --git a/packages/mobile/src/harmony-native/components/TextLink/ExternalLink.tsx b/packages/mobile/src/harmony-native/components/TextLink/ExternalLink.tsx index f182b60e150..c2be99a3238 100644 --- a/packages/mobile/src/harmony-native/components/TextLink/ExternalLink.tsx +++ b/packages/mobile/src/harmony-native/components/TextLink/ExternalLink.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { isAllowedExternalLink, useLeavingAudiusModal } from '@audius/common' +import { useLeavingAudiusModal } from '@audius/common/store' +import { isAllowedExternalLink } from '@audius/common/utils' import type { GestureResponderEvent, TouchableWithoutFeedbackProps diff --git a/packages/mobile/src/harmony-native/foundations/color/Color.stories.tsx b/packages/mobile/src/harmony-native/foundations/color/Color.stories.tsx index 8105da25507..a0110746da8 100644 --- a/packages/mobile/src/harmony-native/foundations/color/Color.stories.tsx +++ b/packages/mobile/src/harmony-native/foundations/color/Color.stories.tsx @@ -1,4 +1,5 @@ -import { Theme, themeActions, themeSelectors } from '@audius/common' +import { Theme } from '@audius/common/models' +import { themeActions, themeSelectors } from '@audius/common/store' import { SectionList, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/hooks/useContentNodeImage.ts b/packages/mobile/src/hooks/useContentNodeImage.ts index f05ad854d47..fa7502c04f0 100644 --- a/packages/mobile/src/hooks/useContentNodeImage.ts +++ b/packages/mobile/src/hooks/useContentNodeImage.ts @@ -1,7 +1,9 @@ import { useState, useMemo, useCallback } from 'react' -import type { Nullable, CID, WidthSizes, SquareSizes } from '@audius/common' -import { interleave, useAppContext } from '@audius/common' +import { useAppContext } from '@audius/common/context' +import type { SquareSizes, WidthSizes, CID } from '@audius/common/models' +import { interleave } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import type { ImageSourcePropType, ImageURISource } from 'react-native' export type ContentNodeImageSource = { diff --git a/packages/mobile/src/hooks/useImageSize.ts b/packages/mobile/src/hooks/useImageSize.ts index b73adeaa9bc..86ddae39414 100644 --- a/packages/mobile/src/hooks/useImageSize.ts +++ b/packages/mobile/src/hooks/useImageSize.ts @@ -1,11 +1,10 @@ -import { useImageSize as useImageSizeCommon } from '@audius/common' +import { useImageSize as useImageSizeCommon } from '@audius/common/hooks' import type { - ImageSizesObject, SquareSizes, WidthSizes, - Maybe, - Nullable -} from '@audius/common' + ImageSizesObject +} from '@audius/common/models' +import type { Nullable, Maybe } from '@audius/common/utils' import type { ImageSourcePropType } from 'react-native' import { Image } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/hooks/useIsOfflineModeEnabled.ts b/packages/mobile/src/hooks/useIsOfflineModeEnabled.ts index b5eb9a50b0d..b2853c84db9 100644 --- a/packages/mobile/src/hooks/useIsOfflineModeEnabled.ts +++ b/packages/mobile/src/hooks/useIsOfflineModeEnabled.ts @@ -1,4 +1,4 @@ -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import { useFeatureFlag } from './useRemoteConfig' diff --git a/packages/mobile/src/hooks/useIsUSDCEnabled.ts b/packages/mobile/src/hooks/useIsUSDCEnabled.ts index dbc8c1ad5e8..187e6deab6a 100644 --- a/packages/mobile/src/hooks/useIsUSDCEnabled.ts +++ b/packages/mobile/src/hooks/useIsUSDCEnabled.ts @@ -1,4 +1,5 @@ -import { FeatureFlags, useFeatureFlag } from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' export const useIsUSDCEnabled = () => useFeatureFlag(FeatureFlags.USDC_PURCHASES).isEnabled diff --git a/packages/mobile/src/hooks/useManualToast.ts b/packages/mobile/src/hooks/useManualToast.ts index 73b3ebd0847..bee70b72419 100644 --- a/packages/mobile/src/hooks/useManualToast.ts +++ b/packages/mobile/src/hooks/useManualToast.ts @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { Toast } from '@audius/common' -import { uuid, toastActions } from '@audius/common' +import type { Toast } from '@audius/common/store' +import { toastActions } from '@audius/common/store' +import { uuid } from '@audius/common/utils' import { useDispatch } from 'react-redux' const { registerToast, manualClearToast } = toastActions diff --git a/packages/mobile/src/hooks/useNotificationNavigation.ts b/packages/mobile/src/hooks/useNotificationNavigation.ts index b844f2e4b0a..b084b8f83fb 100644 --- a/packages/mobile/src/hooks/useNotificationNavigation.ts +++ b/packages/mobile/src/hooks/useNotificationNavigation.ts @@ -1,53 +1,53 @@ import { useCallback, useMemo } from 'react' import type { - AddTrackToPlaylistNotification, - AddTrackToPlaylistPushNotification, AnnouncementNotification, - ChallengeRewardNotification, - FavoriteNotification, - FavoriteOfRepostNotification, - FavoritePushNotification, + UserSubscriptionNotification, FollowNotification, FollowPushNotification, - MilestoneFavoritePushNotification, + RepostNotification, + RepostPushNotification, + RepostOfRepostNotification, + RepostOfRepostPushNotification, + FavoriteOfRepostNotification, + FavoriteNotification, + FavoritePushNotification, + MilestoneNotification, MilestoneFollowPushNotification, MilestoneListenPushNotification, - MilestoneNotification, MilestoneRepostPushNotification, - ReactionNotification, - ReactionPushNotification, - RemixCosignNotification, - RemixCosignPushNotification, + MilestoneFavoritePushNotification, RemixCreateNotification, RemixCreatePushNotification, - RepostNotification, - RepostOfRepostNotification, - RepostOfRepostPushNotification, - RepostPushNotification, - SupporterDethronedNotification, - SupporterRankUpNotification, - SupporterRankUpPushNotification, - SupportingRankUpNotification, - SupportingRankUpPushNotification, + RemixCosignNotification, + RemixCosignPushNotification, + TrendingTrackNotification, + ChallengeRewardNotification, TierChangeNotification, + ReactionNotification, + ReactionPushNotification, TipReceiveNotification, TipReceivePushNotification, TipSendNotification, TipSendPushNotification, - TrendingTrackNotification, - UserSubscriptionNotification, + SupporterRankUpNotification, + SupporterRankUpPushNotification, + SupportingRankUpNotification, + SupportingRankUpPushNotification, + SupporterDethronedNotification, + AddTrackToPlaylistNotification, + AddTrackToPlaylistPushNotification, MessagePushNotification, MessageReactionPushNotification -} from '@audius/common' +} from '@audius/common/store' import { - notificationsUserListActions, - tippingActions, - Achievement, - Entity, NotificationType, - PushNotificationType -} from '@audius/common' + PushNotificationType, + Entity, + Achievement, + tippingActions, + notificationsUserListActions +} from '@audius/common/store' import type { AppState } from 'audius-client/src/store/types' import { useDispatch, useStore } from 'react-redux' diff --git a/packages/mobile/src/hooks/useOfflineTrackStatus.ts b/packages/mobile/src/hooks/useOfflineTrackStatus.ts index 5e8822cbb4f..3c59290b6d0 100644 --- a/packages/mobile/src/hooks/useOfflineTrackStatus.ts +++ b/packages/mobile/src/hooks/useOfflineTrackStatus.ts @@ -1,4 +1,5 @@ -import { reachabilitySelectors, useProxySelector } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import { reachabilitySelectors } from '@audius/common/store' import type { AppState } from 'app/store' import { diff --git a/packages/mobile/src/hooks/useProxySelector.ts b/packages/mobile/src/hooks/useProxySelector.ts index 34eb4f2ad44..717b9b74988 100644 --- a/packages/mobile/src/hooks/useProxySelector.ts +++ b/packages/mobile/src/hooks/useProxySelector.ts @@ -1,4 +1,4 @@ -import { createProxySelectorHook } from '@audius/common' +import { createProxySelectorHook } from '@audius/common/hooks' import type { AppState } from 'app/store' export const useProxySelector = createProxySelectorHook() diff --git a/packages/mobile/src/hooks/useReachabilityEffect.ts b/packages/mobile/src/hooks/useReachabilityEffect.ts index c0941e24224..3504496b8eb 100644 --- a/packages/mobile/src/hooks/useReachabilityEffect.ts +++ b/packages/mobile/src/hooks/useReachabilityEffect.ts @@ -1,6 +1,6 @@ import { useEffect, useCallback } from 'react' -import { reachabilitySelectors } from '@audius/common' +import { reachabilitySelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { usePrevious } from 'react-use' diff --git a/packages/mobile/src/hooks/useRemoteConfig.ts b/packages/mobile/src/hooks/useRemoteConfig.ts index 69ef37f2ad6..74c2cd9afae 100644 --- a/packages/mobile/src/hooks/useRemoteConfig.ts +++ b/packages/mobile/src/hooks/useRemoteConfig.ts @@ -1,9 +1,8 @@ import { createUseFeatureFlagHook, - createUseRemoteVarHook, - accountSelectors, - remoteConfigSelectors -} from '@audius/common' + createUseRemoteVarHook +} from '@audius/common/hooks' +import { accountSelectors, remoteConfigSelectors } from '@audius/common/store' import AsyncStorage from '@react-native-async-storage/async-storage' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/hooks/useSetTrackAvailabilityFields.ts b/packages/mobile/src/hooks/useSetTrackAvailabilityFields.ts index 854075d85b2..f19e39bb5cb 100644 --- a/packages/mobile/src/hooks/useSetTrackAvailabilityFields.ts +++ b/packages/mobile/src/hooks/useSetTrackAvailabilityFields.ts @@ -1,6 +1,7 @@ import { useCallback, useMemo } from 'react' -import type { Nullable, AccessConditions } from '@audius/common' +import type { AccessConditions } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' // This hook allows us to set track availability fields during upload. diff --git a/packages/mobile/src/hooks/useTikTokAuth.ts b/packages/mobile/src/hooks/useTikTokAuth.ts index 11315528513..b49c413da21 100644 --- a/packages/mobile/src/hooks/useTikTokAuth.ts +++ b/packages/mobile/src/hooks/useTikTokAuth.ts @@ -1,5 +1,5 @@ -import type { Credentials, UseTikTokAuthArguments } from '@audius/common' -import { createUseTikTokAuthHook } from '@audius/common' +import { createUseTikTokAuthHook } from '@audius/common/hooks' +import type { UseTikTokAuthArguments, Credentials } from '@audius/common/hooks' import AsyncStorage from '@react-native-async-storage/async-storage' import CookieManager from '@react-native-cookies/cookies' import { Linking } from 'react-native' diff --git a/packages/mobile/src/hooks/useToast.ts b/packages/mobile/src/hooks/useToast.ts index e9c3e3aee04..b5a3458d89f 100644 --- a/packages/mobile/src/hooks/useToast.ts +++ b/packages/mobile/src/hooks/useToast.ts @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { Toast } from '@audius/common' -import { uuid, toastActions } from '@audius/common' +import type { Toast } from '@audius/common/store' +import { toastActions } from '@audius/common/store' +import { uuid } from '@audius/common/utils' import { useDispatch } from 'react-redux' const { registerToast } = toastActions diff --git a/packages/mobile/src/hooks/useUpdateRequired.ts b/packages/mobile/src/hooks/useUpdateRequired.ts index d9427564ca8..14bed064683 100644 --- a/packages/mobile/src/hooks/useUpdateRequired.ts +++ b/packages/mobile/src/hooks/useUpdateRequired.ts @@ -1,4 +1,4 @@ -import { StringKeys } from '@audius/common' +import { StringKeys } from '@audius/common/services' import semver from 'semver' import { useRemoteVar } from 'app/hooks/useRemoteConfig' diff --git a/packages/mobile/src/models/Collection.ts b/packages/mobile/src/models/Collection.ts index d87c23a544c..8b43f27f6bf 100644 --- a/packages/mobile/src/models/Collection.ts +++ b/packages/mobile/src/models/Collection.ts @@ -1,4 +1,5 @@ -import type { CID, CoverArtSizes, Nullable } from '@audius/common' +import type { CID, CoverArtSizes } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' export type CollectionImage = { cover_art: Nullable diff --git a/packages/mobile/src/models/Track.ts b/packages/mobile/src/models/Track.ts index af7238e4192..3990ad3a0ac 100644 --- a/packages/mobile/src/models/Track.ts +++ b/packages/mobile/src/models/Track.ts @@ -1,4 +1,4 @@ -import type { Track } from '@audius/common' +import type { Track } from '@audius/common/models' export type TrackImage = Pick< Track, diff --git a/packages/mobile/src/models/User.ts b/packages/mobile/src/models/User.ts index 9462409acbb..0f4706112c7 100644 --- a/packages/mobile/src/models/User.ts +++ b/packages/mobile/src/models/User.ts @@ -1,4 +1,4 @@ -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' export type UserImage = Pick< User, diff --git a/packages/mobile/src/screens/ai-generated-tracks-screen/AiGeneratedTracksScreen.tsx b/packages/mobile/src/screens/ai-generated-tracks-screen/AiGeneratedTracksScreen.tsx index d1bba819d3a..c6be336442c 100644 --- a/packages/mobile/src/screens/ai-generated-tracks-screen/AiGeneratedTracksScreen.tsx +++ b/packages/mobile/src/screens/ai-generated-tracks-screen/AiGeneratedTracksScreen.tsx @@ -5,7 +5,7 @@ import { aiPageLineupActions as tracksActions, aiPageActions, aiPageSelectors -} from '@audius/common' +} from '@audius/common/store' import { TouchableOpacity, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/AccountDetails.tsx b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/AccountDetails.tsx index ee54cb8fa41..29e91dee4e7 100644 --- a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/AccountDetails.tsx +++ b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/AccountDetails.tsx @@ -1,7 +1,7 @@ import { useCallback, useContext } from 'react' -import type { User } from '@audius/common' -import { accountSelectors } from '@audius/common' +import type { User } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { TouchableOpacity, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/LeftNavDrawer.tsx b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/LeftNavDrawer.tsx index 7fb8a8f4756..fc4847a9c30 100644 --- a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/LeftNavDrawer.tsx +++ b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/LeftNavDrawer.tsx @@ -1,12 +1,8 @@ -import type { User } from '@audius/common' -import { - FeatureFlags, - StringKeys, - accountSelectors, - useAccountHasClaimableRewards, - chatSelectors, - Name -} from '@audius/common' +import { useAccountHasClaimableRewards } from '@audius/common/hooks' +import type { User } from '@audius/common/models' +import { Name } from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { accountSelectors, chatSelectors } from '@audius/common/store' import type { DrawerContentComponentProps } from '@react-navigation/drawer' import { DrawerContentScrollView } from '@react-navigation/drawer' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/VanityMetrics.tsx b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/VanityMetrics.tsx index 00f4ce2d136..130dc3b32ea 100644 --- a/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/VanityMetrics.tsx +++ b/packages/mobile/src/screens/app-drawer-screen/left-nav-drawer/VanityMetrics.tsx @@ -1,13 +1,13 @@ import type { ComponentType } from 'react' import { useCallback, useContext } from 'react' -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import { - formatCount, accountSelectors, - followersUserListActions, - followingUserListActions -} from '@audius/common' + followingUserListActions, + followersUserListActions +} from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import { View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' import type { SvgProps } from 'react-native-svg' diff --git a/packages/mobile/src/screens/app-screen/AccountPictureHeader.tsx b/packages/mobile/src/screens/app-screen/AccountPictureHeader.tsx index 69f640c66d2..0522edb7244 100644 --- a/packages/mobile/src/screens/app-screen/AccountPictureHeader.tsx +++ b/packages/mobile/src/screens/app-screen/AccountPictureHeader.tsx @@ -1,10 +1,6 @@ -import { - accountSelectors, - chatSelectors, - useAccountHasClaimableRewards, - StringKeys, - FeatureFlags -} from '@audius/common' +import { useAccountHasClaimableRewards } from '@audius/common/hooks' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { accountSelectors, chatSelectors } from '@audius/common/store' import { useDrawerProgress } from '@react-navigation/drawer' import { View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/app-screen/AppTabScreen.tsx b/packages/mobile/src/screens/app-screen/AppTabScreen.tsx index 9bb2eb2e777..2d1033ea205 100644 --- a/packages/mobile/src/screens/app-screen/AppTabScreen.tsx +++ b/packages/mobile/src/screens/app-screen/AppTabScreen.tsx @@ -1,15 +1,17 @@ import { useCallback, useContext, useEffect } from 'react' import type { - ID, FavoriteType, TipSource, + ID, + SearchTrack, + SearchPlaylist +} from '@audius/common/models' +import type { NotificationType, RepostType, - SearchPlaylist, - SearchTrack, CreateChatModalState -} from '@audius/common' +} from '@audius/common/store' import type { EventArg, NavigationState } from '@react-navigation/native' import type { createNativeStackNavigator } from '@react-navigation/native-stack' diff --git a/packages/mobile/src/screens/app-screen/AppTabsScreen.tsx b/packages/mobile/src/screens/app-screen/AppTabsScreen.tsx index 3de5a7d5e27..a9f34d505dd 100644 --- a/packages/mobile/src/screens/app-screen/AppTabsScreen.tsx +++ b/packages/mobile/src/screens/app-screen/AppTabsScreen.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { walletActions } from '@audius/common' +import { walletActions } from '@audius/common/store' import { useAppState } from '@react-native-community/hooks' import type { BottomTabBarProps } from '@react-navigation/bottom-tabs' import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' diff --git a/packages/mobile/src/screens/app-screen/useAppScreenOptions.tsx b/packages/mobile/src/screens/app-screen/useAppScreenOptions.tsx index 6a55e67c984..e4278cb747d 100644 --- a/packages/mobile/src/screens/app-screen/useAppScreenOptions.tsx +++ b/packages/mobile/src/screens/app-screen/useAppScreenOptions.tsx @@ -1,6 +1,6 @@ import { useCallback, useContext } from 'react' -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import type { ParamListBase, RouteProp } from '@react-navigation/core' import type { NativeStackNavigationOptions, diff --git a/packages/mobile/src/screens/audio-screen/AudioScreen.tsx b/packages/mobile/src/screens/audio-screen/AudioScreen.tsx index 9bf94b72305..2f621a3d176 100644 --- a/packages/mobile/src/screens/audio-screen/AudioScreen.tsx +++ b/packages/mobile/src/screens/audio-screen/AudioScreen.tsx @@ -1,18 +1,18 @@ import { useCallback, useEffect } from 'react' -import type { StringWei, CommonState } from '@audius/common' +import type { StringWei } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - tokenDashboardPageActions, - StringKeys, - vipDiscordModalActions, - formatWei, tokenDashboardPageSelectors, + tokenDashboardPageActions, walletSelectors, walletActions, getTierAndNumberForBalance, - modalsActions, - isNullOrUndefined -} from '@audius/common' + vipDiscordModalActions, + modalsActions +} from '@audius/common/store' +import type { CommonState } from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import { useFocusEffect } from '@react-navigation/native' import { Image, Linking, View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx index 197ab3dc832..ea178e2c8f9 100644 --- a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx +++ b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx @@ -1,22 +1,22 @@ import { useCallback, useEffect, useState } from 'react' +import { Name, ChallengeName } from '@audius/common/models' +import type { ChallengeRewardID } from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { + challengesSelectors, + audioRewardsPageSelectors, + audioRewardsPageActions, + modalsActions +} from '@audius/common/store' import type { - ChallengeRewardID, ChallengeRewardsModalType, CommonState -} from '@audius/common' +} from '@audius/common/store' import { removeNullable, - StringKeys, - challengesSelectors, - audioRewardsPageActions, - audioRewardsPageSelectors, - modalsActions, - makeOptimisticChallengeSortComparator, - FeatureFlags, - ChallengeName, - Name -} from '@audius/common' + makeOptimisticChallengeSortComparator +} from '@audius/common/utils' import { useFocusEffect } from '@react-navigation/native' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/audio-screen/Panel.tsx b/packages/mobile/src/screens/audio-screen/Panel.tsx index fc758f79e39..642e44d8b95 100644 --- a/packages/mobile/src/screens/audio-screen/Panel.tsx +++ b/packages/mobile/src/screens/audio-screen/Panel.tsx @@ -1,12 +1,10 @@ -import type { - ChallengeRewardsInfo, - OptimisticUserChallenge -} from '@audius/common' +import type { OptimisticUserChallenge } from '@audius/common/models' +import type { ChallengeRewardsInfo } from '@audius/common/utils' import { fillString, formatNumberCommas, isAudioMatchingChallenge -} from '@audius/common' +} from '@audius/common/utils' import { View, Image } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' import LinearGradient from 'react-native-linear-gradient' diff --git a/packages/mobile/src/screens/audio-screen/TrendingRewards.tsx b/packages/mobile/src/screens/audio-screen/TrendingRewards.tsx index 107ed85aa59..6d82bbb9790 100644 --- a/packages/mobile/src/screens/audio-screen/TrendingRewards.tsx +++ b/packages/mobile/src/screens/audio-screen/TrendingRewards.tsx @@ -1,13 +1,7 @@ -import { - StringKeys, - audioRewardsPageActions, - modalsActions -} from '@audius/common' -import type { - TrendingRewardsModalType, - Modals, - ChallengeRewardID -} from '@audius/common' +import type { ChallengeRewardID } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' +import type { TrendingRewardsModalType, Modals } from '@audius/common/store' +import { audioRewardsPageActions, modalsActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/change-password-screen/ChangePasswordScreen.tsx b/packages/mobile/src/screens/change-password-screen/ChangePasswordScreen.tsx index 395ec76623e..32b27e7a718 100644 --- a/packages/mobile/src/screens/change-password-screen/ChangePasswordScreen.tsx +++ b/packages/mobile/src/screens/change-password-screen/ChangePasswordScreen.tsx @@ -1,11 +1,11 @@ import { useCallback, useEffect, useState } from 'react' +import { Status } from '@audius/common/models' import { - Status, - ChangePasswordPageStep, changePasswordSelectors, - changePasswordActions -} from '@audius/common' + changePasswordActions, + ChangePasswordPageStep +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/change-password-screen/ConfirmCredentials.tsx b/packages/mobile/src/screens/change-password-screen/ConfirmCredentials.tsx index b3a38886a7b..2ae9bdb8a36 100644 --- a/packages/mobile/src/screens/change-password-screen/ConfirmCredentials.tsx +++ b/packages/mobile/src/screens/change-password-screen/ConfirmCredentials.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from 'react' +import { Status } from '@audius/common/models' import { - Status, changePasswordSelectors, changePasswordActions -} from '@audius/common' +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { diff --git a/packages/mobile/src/screens/chat-screen/ChatListItem.tsx b/packages/mobile/src/screens/chat-screen/ChatListItem.tsx index 33641c9ff95..a5c2d57c898 100644 --- a/packages/mobile/src/screens/chat-screen/ChatListItem.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatListItem.tsx @@ -1,6 +1,7 @@ import { useCallback, useMemo } from 'react' -import { chatSelectors, useProxySelector } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import { chatSelectors } from '@audius/common/store' import { View, TouchableHighlight } from 'react-native' import { Text } from 'app/components/core' diff --git a/packages/mobile/src/screens/chat-screen/ChatListScreen.tsx b/packages/mobile/src/screens/chat-screen/ChatListScreen.tsx index dd8f0b1c125..e8c0a567d31 100644 --- a/packages/mobile/src/screens/chat-screen/ChatListScreen.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatListScreen.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect } from 'react' -import { chatActions, chatSelectors, Status } from '@audius/common' +import { Status } from '@audius/common/models' +import { chatActions, chatSelectors } from '@audius/common/store' import { View, TouchableOpacity } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/ChatMessageListItem.tsx b/packages/mobile/src/screens/chat-screen/ChatMessageListItem.tsx index dad4e9c1d39..b44e60c03e4 100644 --- a/packages/mobile/src/screens/chat-screen/ChatMessageListItem.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatMessageListItem.tsx @@ -1,15 +1,14 @@ import { memo, useCallback, useState } from 'react' -import type { ReactionTypes } from '@audius/common' +import { Status } from '@audius/common/models' +import type { ReactionTypes } from '@audius/common/store' +import { accountSelectors, chatSelectors } from '@audius/common/store' import { - Status, - accountSelectors, - chatSelectors, - decodeHashId, formatMessageDate, + decodeHashId, isCollectionUrl, isTrackUrl -} from '@audius/common' +} from '@audius/common/utils' import type { ChatMessageReaction } from '@audius/sdk' import { find } from 'linkifyjs' import type { ViewStyle, StyleProp } from 'react-native' diff --git a/packages/mobile/src/screens/chat-screen/ChatMessagePlaylist.tsx b/packages/mobile/src/screens/chat-screen/ChatMessagePlaylist.tsx index 44f7735fa86..18ddcd98fa2 100644 --- a/packages/mobile/src/screens/chat-screen/ChatMessagePlaylist.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatMessagePlaylist.tsx @@ -1,20 +1,20 @@ import { useCallback, useMemo, useEffect } from 'react' -import type { ChatMessageTileProps, ID, TrackPlayback } from '@audius/common' import { - Name, - Kind, - PlaybackSource, - QueueSource, - accountSelectors, - getPathFromPlaylistUrl, - makeUid, - playerSelectors, useGetTracksByIds, - usePlayTrack, - usePauseTrack, useGetPlaylistByPermalink -} from '@audius/common' +} from '@audius/common/api' +import { usePlayTrack, usePauseTrack } from '@audius/common/hooks' +import type { TrackPlayback } from '@audius/common/hooks' +import { Name, PlaybackSource, Kind } from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { + accountSelectors, + QueueSource, + playerSelectors +} from '@audius/common/store' +import type { ChatMessageTileProps } from '@audius/common/store' +import { getPathFromPlaylistUrl, makeUid } from '@audius/common/utils' import { useSelector } from 'react-redux' import { CollectionTile } from 'app/components/lineup-tile' diff --git a/packages/mobile/src/screens/chat-screen/ChatMessageTrack.tsx b/packages/mobile/src/screens/chat-screen/ChatMessageTrack.tsx index f4d05e53bc3..eb6691f04b7 100644 --- a/packages/mobile/src/screens/chat-screen/ChatMessageTrack.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatMessageTrack.tsx @@ -1,18 +1,13 @@ import { useCallback, useEffect, useMemo } from 'react' -import type { ChatMessageTileProps, ID, TrackPlayback } from '@audius/common' -import { - Name, - Kind, - PlaybackSource, - QueueSource, - accountSelectors, - getPathFromTrackUrl, - makeUid, - useGetTrackByPermalink, - useToggleTrack, - useGatedContentAccess -} from '@audius/common' +import { useGetTrackByPermalink } from '@audius/common/api' +import { useGatedContentAccess, useToggleTrack } from '@audius/common/hooks' +import type { TrackPlayback } from '@audius/common/hooks' +import { Name, PlaybackSource, Kind } from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { accountSelectors, QueueSource } from '@audius/common/store' +import type { ChatMessageTileProps } from '@audius/common/store' +import { getPathFromTrackUrl, makeUid } from '@audius/common/utils' import { useSelector } from 'react-redux' import { TrackTile } from 'app/components/lineup-tile' diff --git a/packages/mobile/src/screens/chat-screen/ChatScreen.tsx b/packages/mobile/src/screens/chat-screen/ChatScreen.tsx index 19a268edcf7..3537a4e4277 100644 --- a/packages/mobile/src/screens/chat-screen/ChatScreen.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatScreen.tsx @@ -1,19 +1,21 @@ import { useCallback, useEffect, useMemo, useRef } from 'react' -import type { ChatMessageWithExtras } from '@audius/common' +import { useCanSendMessage } from '@audius/common/hooks' +import { Status } from '@audius/common/models' +import type { ChatMessageWithExtras } from '@audius/common/models' import { - Status, accountSelectors, chatActions, - chatCanFetchMoreMessages, chatSelectors, + playerSelectors +} from '@audius/common/store' +import { + encodeUrlName, decodeHashId, encodeHashId, - encodeUrlName, isEarliestUnread, - playerSelectors, - useCanSendMessage -} from '@audius/common' + chatCanFetchMoreMessages +} from '@audius/common/utils' import { Portal } from '@gorhom/portal' import { useKeyboard } from '@react-native-community/hooks' import { useFocusEffect } from '@react-navigation/native' diff --git a/packages/mobile/src/screens/chat-screen/ChatTextInput.tsx b/packages/mobile/src/screens/chat-screen/ChatTextInput.tsx index 56c6091641a..1fee8690e18 100644 --- a/packages/mobile/src/screens/chat-screen/ChatTextInput.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatTextInput.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' -import { chatActions, playerSelectors } from '@audius/common' +import { chatActions, playerSelectors } from '@audius/common/store' import { Platform, Pressable } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/ChatUnavailable.tsx b/packages/mobile/src/screens/chat-screen/ChatUnavailable.tsx index 69d3cfd852b..754e5b9477e 100644 --- a/packages/mobile/src/screens/chat-screen/ChatUnavailable.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatUnavailable.tsx @@ -1,10 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - ChatPermissionAction, - useCanSendMessage, - CHAT_BLOG_POST_URL -} from '@audius/common' +import { useCanSendMessage } from '@audius/common/hooks' +import { ChatPermissionAction } from '@audius/common/store' +import { CHAT_BLOG_POST_URL } from '@audius/common/utils' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/ChatUserListItem.tsx b/packages/mobile/src/screens/chat-screen/ChatUserListItem.tsx index 1a641142a0b..84fa05d8aa4 100644 --- a/packages/mobile/src/screens/chat-screen/ChatUserListItem.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatUserListItem.tsx @@ -1,14 +1,14 @@ import { useCallback } from 'react' import { - chatActions, accountSelectors, + cacheUsersSelectors, + chatActions, chatSelectors, ChatPermissionAction, - cacheUsersSelectors, - formatCount, useInboxUnavailableModal -} from '@audius/common' +} from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import { useSelector } from 'audius-client/src/common/hooks/useSelector' import { View, TouchableOpacity, Keyboard } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/ChatUserListScreen.tsx b/packages/mobile/src/screens/chat-screen/ChatUserListScreen.tsx index c85a5807d40..ecd5feaaed3 100644 --- a/packages/mobile/src/screens/chat-screen/ChatUserListScreen.tsx +++ b/packages/mobile/src/screens/chat-screen/ChatUserListScreen.tsx @@ -1,21 +1,21 @@ import { useCallback, useEffect, useState } from 'react' -import type { CreateChatModalState, User } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import { Status, statusIsNotFinalized } from '@audius/common/models' +import type { User } from '@audius/common/models' import { - FOLLOWERS_USER_LIST_TAG, - Status, accountSelectors, cacheUsersSelectors, chatActions, - followersUserListActions, - followersUserListSelectors, + chatSelectors, searchUsersModalActions, searchUsersModalSelectors, - statusIsNotFinalized, - chatSelectors, - useProxySelector, - userListActions -} from '@audius/common' + userListActions, + followersUserListActions, + followersUserListSelectors, + FOLLOWERS_USER_LIST_TAG +} from '@audius/common/store' +import type { CreateChatModalState } from '@audius/common/store' import { View, Image } from 'react-native' import { KeyboardAwareFlatList } from 'react-native-keyboard-aware-scroll-view' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/LinkPreview.tsx b/packages/mobile/src/screens/chat-screen/LinkPreview.tsx index fb211ea82a5..5737374edcb 100644 --- a/packages/mobile/src/screens/chat-screen/LinkPreview.tsx +++ b/packages/mobile/src/screens/chat-screen/LinkPreview.tsx @@ -1,11 +1,8 @@ import { useCallback, useEffect } from 'react' -import { - isAllowedExternalLink, - isAudiusUrl, - useLeavingAudiusModal, - useLinkUnfurlMetadata -} from '@audius/common' +import { useLinkUnfurlMetadata } from '@audius/common/hooks' +import { useLeavingAudiusModal } from '@audius/common/store' +import { isAudiusUrl, isAllowedExternalLink } from '@audius/common/utils' import type { GestureResponderEvent, ViewStyle } from 'react-native' import { View, Image, Pressable } from 'react-native' diff --git a/packages/mobile/src/screens/chat-screen/ReactionPopup.tsx b/packages/mobile/src/screens/chat-screen/ReactionPopup.tsx index 636c1bc7316..d851a5f2ce7 100644 --- a/packages/mobile/src/screens/chat-screen/ReactionPopup.tsx +++ b/packages/mobile/src/screens/chat-screen/ReactionPopup.tsx @@ -1,11 +1,10 @@ import { useCallback, useRef } from 'react' -import type { - ChatMessageWithExtras, - Nullable, - ReactionTypes -} from '@audius/common' -import { chatActions, encodeHashId, accountSelectors } from '@audius/common' +import type { ChatMessageWithExtras } from '@audius/common/models' +import type { ReactionTypes } from '@audius/common/store' +import { accountSelectors, chatActions } from '@audius/common/store' +import { encodeHashId } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import Clipboard from '@react-native-clipboard/clipboard' import { Dimensions, Pressable, Animated } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/chat-screen/ResendMessageButton.tsx b/packages/mobile/src/screens/chat-screen/ResendMessageButton.tsx index 45bd70d4390..89ee018050c 100644 --- a/packages/mobile/src/screens/chat-screen/ResendMessageButton.tsx +++ b/packages/mobile/src/screens/chat-screen/ResendMessageButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatActions, chatSelectors } from '@audius/common' +import { chatActions, chatSelectors } from '@audius/common/store' import { View, TouchableOpacity } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/collection-screen/CollectionHeader.tsx b/packages/mobile/src/screens/collection-screen/CollectionHeader.tsx index ee05b96a3f0..51c9d8b9808 100644 --- a/packages/mobile/src/screens/collection-screen/CollectionHeader.tsx +++ b/packages/mobile/src/screens/collection-screen/CollectionHeader.tsx @@ -1,13 +1,13 @@ import { useLayoutEffect, useState } from 'react' -import type { Collection, SmartCollectionVariant } from '@audius/common' +import { useThrottledCallback } from '@audius/common/hooks' +import { Variant } from '@audius/common/models' +import type { SmartCollectionVariant, Collection } from '@audius/common/models' import { - useThrottledCallback, accountSelectors, - reachabilitySelectors, collectionPageSelectors, - Variant -} from '@audius/common' + reachabilitySelectors +} from '@audius/common/store' import { View } from 'react-native' import { useSelector, useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/collection-screen/CollectionScreen.tsx b/packages/mobile/src/screens/collection-screen/CollectionScreen.tsx index 41abacc60dc..e13f65808f9 100644 --- a/packages/mobile/src/screens/collection-screen/CollectionScreen.tsx +++ b/packages/mobile/src/screens/collection-screen/CollectionScreen.tsx @@ -1,36 +1,36 @@ import { useCallback, useMemo } from 'react' +import { useFeatureFlag } from '@audius/common/hooks' import { - SquareSizes, - encodeUrlName, - removeNullable, - FavoriteSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, FavoriteType, - collectionPageActions, - formatDate, + SquareSizes +} from '@audius/common/models' +import type { + Collection, + SearchUser, + SearchPlaylist, + User +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, collectionPageSelectors, + collectionPageActions, collectionsSocialActions, - OverflowAction, - OverflowSource, - publishPlaylistConfirmationModalUIActions, mobileOverflowMenuUIActions, + publishPlaylistConfirmationModalUIActions, shareModalUIActions, - RepostType, + OverflowAction, + OverflowSource, repostsUserListActions, favoritesUserListActions, - useFeatureFlag, - FeatureFlags -} from '@audius/common' -import type { - Collection, - Nullable, - User, - SearchPlaylist, - SearchUser -} from '@audius/common' + RepostType +} from '@audius/common/store' +import { encodeUrlName, formatDate, removeNullable } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { diff --git a/packages/mobile/src/screens/collection-screen/CollectionScreenDetailsTile.tsx b/packages/mobile/src/screens/collection-screen/CollectionScreenDetailsTile.tsx index ae543d73880..bf75f782ef4 100644 --- a/packages/mobile/src/screens/collection-screen/CollectionScreenDetailsTile.tsx +++ b/packages/mobile/src/screens/collection-screen/CollectionScreenDetailsTile.tsx @@ -1,18 +1,16 @@ import { useCallback, useEffect, useMemo } from 'react' -import type { ID, Maybe, SmartCollectionVariant, UID } from '@audius/common' +import { Name, PlaybackSource, Status } from '@audius/common/models' +import type { SmartCollectionVariant, ID, UID } from '@audius/common/models' import { - removeNullable, - collectionPageSelectors, - playerSelectors, - Status, - Name, - PlaybackSource, - formatSecondsAsText, + cacheCollectionsSelectors, collectionPageLineupActions as tracksActions, + collectionPageSelectors, reachabilitySelectors, - cacheCollectionsSelectors -} from '@audius/common' + playerSelectors +} from '@audius/common/store' +import { formatSecondsAsText, removeNullable } from '@audius/common/utils' +import type { Maybe } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { usePrevious } from 'react-use' import { createSelector } from 'reselect' diff --git a/packages/mobile/src/screens/collection-screen/useFetchCollectionLineup.ts b/packages/mobile/src/screens/collection-screen/useFetchCollectionLineup.ts index 3318d184042..d0c4245635f 100644 --- a/packages/mobile/src/screens/collection-screen/useFetchCollectionLineup.ts +++ b/packages/mobile/src/screens/collection-screen/useFetchCollectionLineup.ts @@ -1,17 +1,15 @@ import { useCallback } from 'react' -import type { SmartCollectionVariant } from '@audius/common' +import type { SmartCollectionVariant } from '@audius/common/models' +import { Kind } from '@audius/common/models' import { - Uid, - areSetsEqual, - Kind, - makeUid, - cacheActions, cacheCollectionsSelectors, + cacheActions, collectionPageLineupActions, collectionPageSelectors, queueSelectors -} from '@audius/common' +} from '@audius/common/store' +import { areSetsEqual, Uid, makeUid } from '@audius/common/utils' import moment from 'moment' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistForm.tsx b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistForm.tsx index 3019849d4c1..71061cee093 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistForm.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistForm.tsx @@ -1,11 +1,8 @@ import { useCallback } from 'react' -import { - deletePlaylistConfirmationModalUIActions, - useGetCurrentUserId, - useGetPlaylistById -} from '@audius/common' -import type { EditPlaylistValues } from '@audius/common' +import { useGetPlaylistById, useGetCurrentUserId } from '@audius/common/api' +import type { EditPlaylistValues } from '@audius/common/store' +import { deletePlaylistConfirmationModalUIActions } from '@audius/common/store' import type { FormikProps } from 'formik' import { capitalize } from 'lodash' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistModalScreen.tsx b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistModalScreen.tsx index 893e7711606..b6da0b3385c 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistModalScreen.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistModalScreen.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' -import type { EditPlaylistValues } from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import type { EditPlaylistValues } from '@audius/common/store' import { - SquareSizes, cacheCollectionsActions, cacheCollectionsSelectors -} from '@audius/common' +} from '@audius/common/store' import { Formik } from 'formik' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistNavigator.tsx b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistNavigator.tsx index 31834b1bcc1..821ea52a855 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistNavigator.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/EditPlaylistNavigator.tsx @@ -1,4 +1,4 @@ -import type { EditPlaylistValues } from '@audius/common' +import type { EditPlaylistValues } from '@audius/common/store' import { createNativeStackNavigator } from '@react-navigation/native-stack' import type { FormikProps } from 'formik' diff --git a/packages/mobile/src/screens/edit-playlist-screen/PlaylistArtworkField.tsx b/packages/mobile/src/screens/edit-playlist-screen/PlaylistArtworkField.tsx index dacb0dd6fb1..6e7629642f3 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/PlaylistArtworkField.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/PlaylistArtworkField.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { useGeneratePlaylistArtwork } from '@audius/common' +import { useGeneratePlaylistArtwork } from '@audius/common/hooks' import { useField, useFormikContext } from 'formik' import { PickArtworkField } from 'app/components/fields' diff --git a/packages/mobile/src/screens/edit-playlist-screen/RandomImageButton.tsx b/packages/mobile/src/screens/edit-playlist-screen/RandomImageButton.tsx index 773ee24facc..f7c2036aa23 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/RandomImageButton.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/RandomImageButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { RandomImage } from '@audius/common' +import { RandomImage } from '@audius/common/services' import { useField } from 'formik' import { IconSearch } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/edit-playlist-screen/TrackListFieldArray.tsx b/packages/mobile/src/screens/edit-playlist-screen/TrackListFieldArray.tsx index 43d213897ab..d0d0094a614 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/TrackListFieldArray.tsx +++ b/packages/mobile/src/screens/edit-playlist-screen/TrackListFieldArray.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import type { PlaylistTrackId } from '@audius/common' +import type { PlaylistTrackId } from '@audius/common/models' import { useField } from 'formik' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/edit-playlist-screen/types.ts b/packages/mobile/src/screens/edit-playlist-screen/types.ts index 1d76b3db4f9..521b722236f 100644 --- a/packages/mobile/src/screens/edit-playlist-screen/types.ts +++ b/packages/mobile/src/screens/edit-playlist-screen/types.ts @@ -1,4 +1,4 @@ -import type { Image, EditPlaylistValues } from '@audius/common' +import type { Image, EditPlaylistValues } from '@audius/common/store' export type UpdatedPlaylist = Omit & { updatedCoverArt?: Image diff --git a/packages/mobile/src/screens/edit-profile-screen/EditProfileScreen.tsx b/packages/mobile/src/screens/edit-profile-screen/EditProfileScreen.tsx index fa223c8bc62..2f518e63e66 100644 --- a/packages/mobile/src/screens/edit-profile-screen/EditProfileScreen.tsx +++ b/packages/mobile/src/screens/edit-profile-screen/EditProfileScreen.tsx @@ -1,11 +1,8 @@ import { useCallback } from 'react' -import type { UserMetadata } from '@audius/common' -import { - accountSelectors, - profilePageActions, - SquareSizes -} from '@audius/common' +import type { UserMetadata } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' +import { accountSelectors, profilePageActions } from '@audius/common/store' import type { FormikProps } from 'formik' import { Formik } from 'formik' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/edit-profile-screen/types.ts b/packages/mobile/src/screens/edit-profile-screen/types.ts index 3999918f6ca..80aaa8794d3 100644 --- a/packages/mobile/src/screens/edit-profile-screen/types.ts +++ b/packages/mobile/src/screens/edit-profile-screen/types.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import type { Image } from 'app/types/image' diff --git a/packages/mobile/src/screens/edit-track-screen/EditTrackForm.tsx b/packages/mobile/src/screens/edit-track-screen/EditTrackForm.tsx index 71c8d262c0c..cfc71eebfcc 100644 --- a/packages/mobile/src/screens/edit-track-screen/EditTrackForm.tsx +++ b/packages/mobile/src/screens/edit-track-screen/EditTrackForm.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { FeatureFlags, type UploadTrack } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' +import type { UploadTrack } from '@audius/common/store' import { Keyboard } from 'react-native' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/edit-track-screen/EditTrackModalScreen.tsx b/packages/mobile/src/screens/edit-track-screen/EditTrackModalScreen.tsx index e22eae0d672..68eb40cc1ca 100644 --- a/packages/mobile/src/screens/edit-track-screen/EditTrackModalScreen.tsx +++ b/packages/mobile/src/screens/edit-track-screen/EditTrackModalScreen.tsx @@ -1,11 +1,8 @@ import { useCallback } from 'react' -import type { ExtendedTrackMetadata } from '@audius/common' -import { - SquareSizes, - cacheTracksActions, - cacheTracksSelectors -} from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import type { ExtendedTrackMetadata } from '@audius/common/store' +import { cacheTracksActions, cacheTracksSelectors } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { ModalScreen } from 'app/components/core' diff --git a/packages/mobile/src/screens/edit-track-screen/EditTrackNavigator.tsx b/packages/mobile/src/screens/edit-track-screen/EditTrackNavigator.tsx index 4b02b8b6194..0ac346a4b89 100644 --- a/packages/mobile/src/screens/edit-track-screen/EditTrackNavigator.tsx +++ b/packages/mobile/src/screens/edit-track-screen/EditTrackNavigator.tsx @@ -1,4 +1,4 @@ -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import { createNativeStackNavigator } from '@react-navigation/native-stack' import { GatedContentUploadPromptDrawer } from 'app/components/gated-content-upload-prompt-drawer' diff --git a/packages/mobile/src/screens/edit-track-screen/EditTrackScreen.tsx b/packages/mobile/src/screens/edit-track-screen/EditTrackScreen.tsx index 74457769038..2966e9eb61d 100644 --- a/packages/mobile/src/screens/edit-track-screen/EditTrackScreen.tsx +++ b/packages/mobile/src/screens/edit-track-screen/EditTrackScreen.tsx @@ -1,12 +1,9 @@ import { useCallback, useMemo } from 'react' -import type { UploadTrack } from '@audius/common' -import { - creativeCommons, - formatPrice, - isContentUSDCPurchaseGated, - useUSDCPurchaseConfig -} from '@audius/common' +import { useUSDCPurchaseConfig } from '@audius/common/hooks' +import { isContentUSDCPurchaseGated } from '@audius/common/models' +import type { UploadTrack } from '@audius/common/store' +import { creativeCommons, formatPrice } from '@audius/common/utils' import { Formik } from 'formik' import { z } from 'zod' import { toFormikValidationSchema } from 'zod-formik-adapter' diff --git a/packages/mobile/src/screens/edit-track-screen/components/CollectibleGatedAvailability.tsx b/packages/mobile/src/screens/edit-track-screen/components/CollectibleGatedAvailability.tsx index bab2a3a12fb..9793ac87af7 100644 --- a/packages/mobile/src/screens/edit-track-screen/components/CollectibleGatedAvailability.tsx +++ b/packages/mobile/src/screens/edit-track-screen/components/CollectibleGatedAvailability.tsx @@ -1,10 +1,9 @@ import { useCallback, useEffect, useState } from 'react' -import type { Nullable, AccessConditions } from '@audius/common' -import { - collectiblesSelectors, - isContentCollectibleGated -} from '@audius/common' +import { isContentCollectibleGated } from '@audius/common/models' +import type { AccessConditions } from '@audius/common/models' +import { collectiblesSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import { View, Image, Dimensions } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/edit-track-screen/components/RemixTrackPill.tsx b/packages/mobile/src/screens/edit-track-screen/components/RemixTrackPill.tsx index 6ef0a5c1a4c..dc70090c658 100644 --- a/packages/mobile/src/screens/edit-track-screen/components/RemixTrackPill.tsx +++ b/packages/mobile/src/screens/edit-track-screen/components/RemixTrackPill.tsx @@ -1,5 +1,5 @@ -import type { Track, User } from '@audius/common' -import { SquareSizes } from '@audius/common' +import type { Track, User } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' import type { StyleProp, ViewStyle } from 'react-native' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/edit-track-screen/components/SpecialAccessAvailability.tsx b/packages/mobile/src/screens/edit-track-screen/components/SpecialAccessAvailability.tsx index b098dc39a06..e9219d0e8f2 100644 --- a/packages/mobile/src/screens/edit-track-screen/components/SpecialAccessAvailability.tsx +++ b/packages/mobile/src/screens/edit-track-screen/components/SpecialAccessAvailability.tsx @@ -1,11 +1,9 @@ import { useCallback, useEffect, useState } from 'react' -import type { AccessConditions, Nullable } from '@audius/common' -import { - accountSelectors, - isContentFollowGated, - isContentTipGated -} from '@audius/common' +import { isContentFollowGated, isContentTipGated } from '@audius/common/models' +import type { AccessConditions } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import { Dimensions, View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/edit-track-screen/components/types.ts b/packages/mobile/src/screens/edit-track-screen/components/types.ts index d2dff685978..d5435f2d93b 100644 --- a/packages/mobile/src/screens/edit-track-screen/components/types.ts +++ b/packages/mobile/src/screens/edit-track-screen/components/types.ts @@ -1,4 +1,5 @@ -import type { Nullable, AccessConditions } from '@audius/common' +import type { AccessConditions } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' export type TrackAvailabilitySelectionProps = { selected: boolean diff --git a/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/AccessAndSaleField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/AccessAndSaleField.tsx index ed9e4699274..d972043fa2f 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/AccessAndSaleField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/AccessAndSaleField.tsx @@ -1,14 +1,13 @@ import { useMemo } from 'react' +import type { FieldVisibility, AccessConditions } from '@audius/common/models' import { + isContentCollectibleGated, isContentFollowGated, - type FieldVisibility, - type Nullable, - type AccessConditions, isContentTipGated, - isContentCollectibleGated, isContentUSDCPurchaseGated -} from '@audius/common' +} from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import type { ContextualMenuProps } from 'app/components/core' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/PremiumRadioField/PremiumRadioField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/PremiumRadioField/PremiumRadioField.tsx index 76be6c47b92..206fbc3fa30 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/PremiumRadioField/PremiumRadioField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/AccessAndSaleField/PremiumRadioField/PremiumRadioField.tsx @@ -1,11 +1,8 @@ import { useCallback, useEffect, useMemo, useRef } from 'react' -import { - FeatureFlags, - Name, - isContentUSDCPurchaseGated, - useFeatureFlag -} from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { Name, isContentUSDCPurchaseGated } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { useField } from 'formik' import { Dimensions, View } from 'react-native' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/IsrcIswcField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/IsrcIswcField.tsx index 903181ed35c..f6800dd4799 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/IsrcIswcField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/IsrcIswcField.tsx @@ -1,4 +1,4 @@ -import { removeNullable } from '@audius/common' +import { removeNullable } from '@audius/common/utils' import { useField } from 'formik' import type { ContextualMenuProps } from 'app/components/core' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/LicenseTypeField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/LicenseTypeField.tsx index a8e6e31ece5..77a894f7f68 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/LicenseTypeField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/LicenseTypeField.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateField.tsx index 438f8ef4406..e3505145c28 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateField.tsx @@ -1,4 +1,5 @@ -import { dayjs, type Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' +import { dayjs } from '@audius/common/utils' import { useField } from 'formik' import moment from 'moment' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateFieldLegacy.tsx b/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateFieldLegacy.tsx index 1bfe341da75..8f343c1f871 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateFieldLegacy.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/ReleaseDateFieldLegacy.tsx @@ -1,7 +1,7 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import type { Nullable } from '@audius/common' -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import { useField } from 'formik' import moment from 'moment' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/RemixSettingsField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/RemixSettingsField.tsx index 3281e9cee1b..4f1c27b3c37 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/RemixSettingsField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/RemixSettingsField.tsx @@ -1,4 +1,4 @@ -import { cacheUsersSelectors, cacheTracksSelectors } from '@audius/common' +import { cacheTracksSelectors, cacheUsersSelectors } from '@audius/common/store' import { useField } from 'formik' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/edit-track-screen/fields/TagField.tsx b/packages/mobile/src/screens/edit-track-screen/fields/TagField.tsx index aa8c3c5cb39..e0baf00f078 100644 --- a/packages/mobile/src/screens/edit-track-screen/fields/TagField.tsx +++ b/packages/mobile/src/screens/edit-track-screen/fields/TagField.tsx @@ -1,4 +1,4 @@ -import type { TrackMetadata } from '@audius/common' +import type { TrackMetadata } from '@audius/common/models' import { useField } from 'formik' import { TagInput } from 'app/components/core' diff --git a/packages/mobile/src/screens/edit-track-screen/screens/AccessAndSaleScreen.tsx b/packages/mobile/src/screens/edit-track-screen/screens/AccessAndSaleScreen.tsx index b0b9a88c837..389ad20edec 100644 --- a/packages/mobile/src/screens/edit-track-screen/screens/AccessAndSaleScreen.tsx +++ b/packages/mobile/src/screens/edit-track-screen/screens/AccessAndSaleScreen.tsx @@ -1,17 +1,17 @@ import { useCallback, useMemo, useState } from 'react' -import type { Nullable, AccessConditions } from '@audius/common' +import { useFeatureFlag, useAccessAndRemixSettings } from '@audius/common/hooks' import { - TrackAvailabilityType, + isContentCollectibleGated, isContentFollowGated, isContentTipGated, - isContentCollectibleGated, - FeatureFlags, - removeNullable, isContentUSDCPurchaseGated, - useAccessAndRemixSettings, - useFeatureFlag -} from '@audius/common' + StreamTrackAvailabilityType +} from '@audius/common/models' +import type { AccessConditions } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { removeNullable } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import { useField, useFormikContext } from 'formik' import { IconCaretLeft, IconCart } from '@audius/harmony-native' @@ -48,11 +48,12 @@ const messages = { done: 'Done' } -const publicAvailability = TrackAvailabilityType.PUBLIC -const premiumAvailability = TrackAvailabilityType.USDC_PURCHASE -const specialAccessAvailability = TrackAvailabilityType.SPECIAL_ACCESS -const collectibleGatedAvailability = TrackAvailabilityType.COLLECTIBLE_GATED -const hiddenAvailability = TrackAvailabilityType.HIDDEN +const publicAvailability = StreamTrackAvailabilityType.PUBLIC +const premiumAvailability = StreamTrackAvailabilityType.USDC_PURCHASE +const specialAccessAvailability = StreamTrackAvailabilityType.SPECIAL_ACCESS +const collectibleGatedAvailability = + StreamTrackAvailabilityType.COLLECTIBLE_GATED +const hiddenAvailability = StreamTrackAvailabilityType.HIDDEN const useStyles = makeStyles(({ spacing }) => ({ backButton: { @@ -104,21 +105,21 @@ export const AccessAndSaleScreen = () => { const initialStreamConditions = initialValues?.stream_conditions ?? null const initialAvailability = useMemo(() => { if (isUsdcEnabled && isContentUSDCPurchaseGated(streamConditions)) { - return TrackAvailabilityType.USDC_PURCHASE + return StreamTrackAvailabilityType.USDC_PURCHASE } if (isContentCollectibleGated(streamConditions)) { - return TrackAvailabilityType.COLLECTIBLE_GATED + return StreamTrackAvailabilityType.COLLECTIBLE_GATED } if ( isContentFollowGated(streamConditions) || isContentTipGated(streamConditions) ) { - return TrackAvailabilityType.SPECIAL_ACCESS + return StreamTrackAvailabilityType.SPECIAL_ACCESS } if (isUnlisted && !isScheduledRelease) { - return TrackAvailabilityType.HIDDEN + return StreamTrackAvailabilityType.HIDDEN } - return TrackAvailabilityType.PUBLIC + return StreamTrackAvailabilityType.PUBLIC // we only care about what the initial value was here // eslint-disable-next-line }, []) @@ -141,7 +142,7 @@ export const AccessAndSaleScreen = () => { const noUsdcGate = noUsdcGateOption || !isUsdcUploadEnabled const [availability, setAvailability] = - useState(initialAvailability) + useState(initialAvailability) const previousStreamConditions = useMemo( () => streamConditions ?? initialStreamConditions, @@ -179,7 +180,7 @@ export const AccessAndSaleScreen = () => { const items = { [publicAvailability]: ( ) } @@ -187,7 +188,7 @@ export const AccessAndSaleScreen = () => { if (isUsdcEnabled) { items[premiumAvailability] = ( { items[specialAccessAvailability] = ( { items[collectibleGatedAvailability] = ( { items[hiddenAvailability] = ( { {emailSchemaMessages.emailInUse}{' '} onChangeScreen('sign-in')}> - {messages.signIn} + {createEmailPageMessages.signIn} diff --git a/packages/mobile/src/screens/sign-on-screen/components/HandleField.tsx b/packages/mobile/src/screens/sign-on-screen/components/HandleField.tsx index 229acb400e1..c82daf96a60 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/HandleField.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/HandleField.tsx @@ -1,7 +1,5 @@ -import { - MAX_HANDLE_LENGTH, - pickHandlePageMessages as messages -} from '@audius/common' +import { pickHandlePageMessages } from '@audius/common/messages' +import { MAX_HANDLE_LENGTH } from '@audius/common/services' import { useField, useFormikContext } from 'formik' import { IconCheck } from '@audius/harmony-native' @@ -18,17 +16,17 @@ export const HandleField = (props: Partial) => { error && error !== 'handle required' && handle ? error : handle && isValid - ? messages.handleAvailable + ? pickHandlePageMessages.handleAvailable : '' return ( value.replace(/\s/g, '')} debouncedValidationMs={1000} endIcon={handle && isValid ? IconCheck : undefined} diff --git a/packages/mobile/src/screens/sign-on-screen/components/NewEmailField.tsx b/packages/mobile/src/screens/sign-on-screen/components/NewEmailField.tsx index a9965a68a99..1742deda6f9 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/NewEmailField.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/NewEmailField.tsx @@ -1,4 +1,4 @@ -import { emailSchemaMessages } from '@audius/common' +import { emailSchemaMessages } from '@audius/common/schemas' import { useField, useFormikContext } from 'formik' import { usePrevious } from 'react-use' diff --git a/packages/mobile/src/screens/sign-on-screen/components/PasswordCompletionChecklist.tsx b/packages/mobile/src/screens/sign-on-screen/components/PasswordCompletionChecklist.tsx index d415356cb62..3f58175b8e0 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/PasswordCompletionChecklist.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/PasswordCompletionChecklist.tsx @@ -1,8 +1,8 @@ import { - passwordSchema, createPasswordPageMessages, type CompletionChecklistType -} from '@audius/common' +} from '@audius/common/messages' +import { passwordSchema } from '@audius/common/schemas' import { useField } from 'formik' import { useAsync } from 'react-use' diff --git a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowInstagramAuth.tsx b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowInstagramAuth.tsx index a91e7352b6a..1c1d7926078 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowInstagramAuth.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowInstagramAuth.tsx @@ -1,11 +1,9 @@ import React, { useState } from 'react' -import { - Name, - pickHandleSchema, - socialMediaMessages, - useAudiusQueryContext -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { socialMediaMessages } from '@audius/common/messages' +import { Name } from '@audius/common/models' +import { pickHandleSchema } from '@audius/common/schemas' import * as signOnActions from 'common/store/pages/signon/actions' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTikTokAuth.tsx b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTikTokAuth.tsx index 18005fd2ab1..bca8bfa388f 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTikTokAuth.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTikTokAuth.tsx @@ -1,12 +1,10 @@ import { useEffect } from 'react' -import { - useAudiusQueryContext, - type TikTokProfileData, - pickHandleSchema, - Name, - formatTikTokProfile -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { Name } from '@audius/common/models' +import { pickHandleSchema } from '@audius/common/schemas' +import { formatTikTokProfile } from '@audius/common/services' +import type { TikTokProfileData } from '@audius/common/services' import type { GestureResponderEvent } from 'react-native' import { useDispatch, useSelector } from 'react-redux' import { restrictedHandles } from 'utils/restrictedHandles' diff --git a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTwitterAuth.tsx b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTwitterAuth.tsx index 62b074b5c0d..cba95fe5643 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTwitterAuth.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/SignUpFlowTwitterAuth.tsx @@ -1,11 +1,9 @@ import React, { useState } from 'react' -import { - formatTwitterProfile, - pickHandleSchema, - socialMediaMessages, - useAudiusQueryContext -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { socialMediaMessages } from '@audius/common/messages' +import { pickHandleSchema } from '@audius/common/schemas' +import { formatTwitterProfile } from '@audius/common/services' import { useAsync } from 'react-use' import { SocialButton } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/sign-on-screen/components/SignUpPolicyText.tsx b/packages/mobile/src/screens/sign-on-screen/components/SignUpPolicyText.tsx index 9b25d3f3ee5..0b3322afa7b 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/SignUpPolicyText.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/SignUpPolicyText.tsx @@ -1,4 +1,4 @@ -import { signUpPolicyMessages as messages } from '@audius/common' +import { signUpPolicyMessages } from '@audius/common/messages' import { BASE_URL, PRIVACY_POLICY, @@ -13,13 +13,13 @@ const privacyPolicyLink = `${BASE_URL}${PRIVACY_POLICY}` export const SignUpAgreementText = () => { return ( - {messages.agreeTo} + {signUpPolicyMessages.agreeTo} - {messages.termsOfService} + {signUpPolicyMessages.termsOfService} - {messages.and} + {signUpPolicyMessages.and} - {messages.privacyPolicy} + {signUpPolicyMessages.privacyPolicy} ) diff --git a/packages/mobile/src/screens/sign-on-screen/components/SocialMediaSignUpButtons.tsx b/packages/mobile/src/screens/sign-on-screen/components/SocialMediaSignUpButtons.tsx index f9871397d27..088c425d8a1 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/SocialMediaSignUpButtons.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/SocialMediaSignUpButtons.tsx @@ -1,4 +1,6 @@ -import { BooleanKeys, useRemoteVar, socialMediaMessages } from '@audius/common' +import { useRemoteVar } from '@audius/common/hooks' +import { socialMediaMessages } from '@audius/common/messages' +import { BooleanKeys } from '@audius/common/services' import { Flex } from '@audius/harmony-native' import { useToast } from 'app/hooks/useToast' diff --git a/packages/mobile/src/screens/sign-on-screen/components/WelcomeDrawer.tsx b/packages/mobile/src/screens/sign-on-screen/components/WelcomeDrawer.tsx index cf0441a1f2c..5759af26422 100644 --- a/packages/mobile/src/screens/sign-on-screen/components/WelcomeDrawer.tsx +++ b/packages/mobile/src/screens/sign-on-screen/components/WelcomeDrawer.tsx @@ -1,10 +1,8 @@ import { useCallback } from 'react' -import { - fillString, - welcomeModalMessages as messages, - settingsPageActions -} from '@audius/common' +import { welcomeModalMessages } from '@audius/common/messages' +import { settingsPageActions } from '@audius/common/store' +import { fillString } from '@audius/common/utils' import { css } from '@emotion/native' import { getNameField } from 'audius-client/src/common/store/pages/signon/selectors' import { useDispatch, useSelector } from 'react-redux' @@ -65,17 +63,17 @@ export const WelcomeDrawer = () => { color='accent' > {fillString( - messages.welcome, + welcomeModalMessages.welcome, displayName ? `, ${displayName}` : '' )} - {messages.youreIn} + {welcomeModalMessages.youreIn} diff --git a/packages/mobile/src/screens/sign-on-screen/screens/ConfirmEmailScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/ConfirmEmailScreen.tsx index bcf96500777..4c100f553df 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/ConfirmEmailScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/ConfirmEmailScreen.tsx @@ -1,11 +1,11 @@ import { useCallback, useEffect, useState } from 'react' +import { confirmEmailMessages } from '@audius/common/messages' import { - confirmEmailErrorMessages, confirmEmailSchema, formatOtp, - confirmEmailMessages as messages -} from '@audius/common' + confirmEmailErrorMessages +} from '@audius/common/schemas' import { setValueField, signIn } from 'common/store/pages/signon/actions' import { getEmailField, @@ -56,10 +56,13 @@ export const ConfirmEmailScreen = () => { validationSchema={ConfirmEmailSchema} > - + - {messages.noEmailNotice} + {confirmEmailMessages.noEmailNotice} @@ -85,8 +88,8 @@ const VerificationCodeField = () => { ) @@ -101,13 +104,13 @@ const ResendCodeLink = () => { const handleClick = useCallback(() => { dispatch(signIn(email, password)) - toast({ content: messages.resentToast }) + toast({ content: confirmEmailMessages.resentToast }) setHasResendCode(true) }, [dispatch, email, password, toast]) return ( - {messages.resendCode} + {confirmEmailMessages.resendCode} ) } diff --git a/packages/mobile/src/screens/sign-on-screen/screens/CreateEmailScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/CreateEmailScreen.tsx index 3a4d7fc57e4..d2e08175486 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/CreateEmailScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/CreateEmailScreen.tsx @@ -1,10 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - emailSchema, - useAudiusQueryContext, - createEmailPageMessages as messages -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { createEmailPageMessages } from '@audius/common/messages' +import { emailSchema } from '@audius/common/schemas' import { setLinkedSocialOnFirstPage, setValueField, @@ -104,12 +102,12 @@ export const CreateEmailScreen = (props: SignOnScreenProps) => { ) : null} - {messages.subHeader.line1} + {createEmailPageMessages.subHeader.line1} {'\n'} - {messages.subHeader.line2} + {createEmailPageMessages.subHeader.line2} } centered @@ -117,12 +115,12 @@ export const CreateEmailScreen = (props: SignOnScreenProps) => { - {messages.socialsDividerText} + {createEmailPageMessages.socialsDividerText} { fullWidth iconRight={IconArrowRight} > - {messages.signUp} + {createEmailPageMessages.signUp} - {messages.haveAccount}{' '} + {createEmailPageMessages.haveAccount}{' '} onChangeScreen('sign-in')} > - {messages.signIn} + {createEmailPageMessages.signIn} diff --git a/packages/mobile/src/screens/sign-on-screen/screens/CreateLoginDetailsScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/CreateLoginDetailsScreen.tsx index 3ae1bd9019a..6fd418b2227 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/CreateLoginDetailsScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/CreateLoginDetailsScreen.tsx @@ -1,11 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - createLoginDetailsSchema, - useAudiusQueryContext, - createLoginDetailsPageMessages as messages, - emailSchema -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { createLoginDetailsPageMessages } from '@audius/common/messages' +import { emailSchema, createLoginDetailsSchema } from '@audius/common/schemas' import { css } from '@emotion/native' import { setValueField } from 'audius-client/src/common/store/pages/signon/actions' import { @@ -56,7 +53,7 @@ const EmailField = ({ onChangeScreen }: { onChangeScreen: () => void }) => { return ( ) @@ -105,13 +102,13 @@ export const CreateLoginDetailsScreen = () => { {({ isValid, dirty }) => ( @@ -129,10 +126,13 @@ export const CreateLoginDetailsScreen = () => { } /> - + diff --git a/packages/mobile/src/screens/sign-on-screen/screens/CreatePasswordScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/CreatePasswordScreen.tsx index 901f1ea9a45..bb66a45effa 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/CreatePasswordScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/CreatePasswordScreen.tsx @@ -1,9 +1,7 @@ import { useCallback, useState } from 'react' -import { - createPasswordPageMessages as messages, - passwordSchema -} from '@audius/common' +import { createPasswordPageMessages } from '@audius/common/messages' +import { passwordSchema } from '@audius/common/schemas' import { setValueField } from 'common/store/pages/signon/actions' import { Formik } from 'formik' import { useDispatch } from 'react-redux' @@ -65,8 +63,8 @@ export const CreatePasswordScreen = () => { > { }) }} > - - + + diff --git a/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx index ef50eb6cb35..16f69e65124 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/FinishProfileScreen.tsx @@ -1,11 +1,9 @@ import { useCallback } from 'react' -import { - MAX_DISPLAY_NAME_LENGTH, - finishProfileSchema, - finishProfilePageMessages as messages -} from '@audius/common' -import type { Image } from '@audius/common' +import { finishProfilePageMessages } from '@audius/common/messages' +import { finishProfileSchema } from '@audius/common/schemas' +import { MAX_DISPLAY_NAME_LENGTH } from '@audius/common/services' +import type { Image } from '@audius/common/store' import { css } from '@emotion/native' import { getHandleField, @@ -73,13 +71,16 @@ export const FinishProfileScreen = () => { validationSchema={finishProfileFormikSchema} > - + { entering={FadeIn.duration(motion.calm.duration)} exiting={FadeOut.duration(motion.calm.duration)} > - {messages.uploadProfilePhoto} + {finishProfilePageMessages.uploadProfilePhoto} ) } diff --git a/packages/mobile/src/screens/sign-on-screen/screens/PickHandleScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/PickHandleScreen.tsx index d82344ce1af..d55ceaa818d 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/PickHandleScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/PickHandleScreen.tsx @@ -1,10 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - pickHandlePageMessages as messages, - pickHandleSchema, - useAudiusQueryContext -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { pickHandlePageMessages } from '@audius/common/messages' +import { pickHandleSchema } from '@audius/common/schemas' import { css } from '@emotion/native' import { getIsSocialConnected } from 'audius-client/src/common/store/pages/signon/selectors' import { @@ -63,12 +61,12 @@ const SocialMediaSection = ({ - {messages.claimHandleHeaderPrefix}{' '} - @{messages.handle} + {pickHandlePageMessages.claimHandleHeaderPrefix}{' '} + @{pickHandlePageMessages.handle} - {messages.claimHandleDescription} + {pickHandlePageMessages.claimHandleDescription} - {messages.claimHandleHeadsUp} + {pickHandlePageMessages.claimHandleHeadsUp} ) @@ -148,7 +146,10 @@ export const PickHandleScreen = () => { {isWaitingForSocialLogin ? ( ) : null} - + @@ -158,7 +159,7 @@ export const PickHandleScreen = () => { size='s' style={css({ textTransform: 'uppercase' })} > - {messages.or} + {pickHandlePageMessages.or} { {({ isValid }) => ( {hasImages ? ( diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/FollowArtistCard.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/FollowArtistCard.tsx index 8dfebd4defd..c2fbb45a59d 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/FollowArtistCard.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/FollowArtistCard.tsx @@ -1,7 +1,7 @@ import type { ChangeEvent } from 'react' import { useCallback, useContext } from 'react' -import type { UserMetadata } from '@audius/common' +import type { UserMetadata } from '@audius/common/models' import { css } from '@emotion/native' import { addFollowArtists, diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectArtistsScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectArtistsScreen.tsx index 7e561fb0e0a..dd94c109479 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectArtistsScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectArtistsScreen.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { selectArtstsPageMessages as messages } from '@audius/common' +import { selectArtistsPageMessages } from '@audius/common/messages' import { finishSignUp } from 'audius-client/src/common/store/pages/signon/actions' import { EditingStatus } from 'audius-client/src/common/store/pages/signon/types' import { @@ -42,8 +42,8 @@ export const SelectArtistsScreen = () => { { }} postfix={ - {messages.selected} {selectedArtists.length || 0}/3 + {selectArtistsPageMessages.selected} {selectedArtists.length || 0} + /3 } /> diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectedGenresTabBar.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectedGenresTabBar.tsx index c92aa99a316..5d178b36381 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectedGenresTabBar.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/SelectedGenresTabBar.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { Genre } from '@audius/common' -import { convertGenreLabelToValue } from '@audius/common' +import type { Genre } from '@audius/common/utils' +import { convertGenreLabelToValue } from '@audius/common/utils' import { css } from '@emotion/native' import type { MaterialTopTabBarProps } from '@react-navigation/material-top-tabs' import { ScrollView } from 'react-native' diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/TopArtistsCardList.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/TopArtistsCardList.tsx index 37d5d88e8c9..17c9b7821a8 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/TopArtistsCardList.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/TopArtistsCardList.tsx @@ -1,5 +1,8 @@ -import type { QueryHookOptions } from '@audius/common' -import { useGetFeaturedArtists, useGetTopArtistsInGenre } from '@audius/common' +import { + useGetTopArtistsInGenre, + useGetFeaturedArtists +} from '@audius/common/api' +import type { QueryHookOptions } from '@audius/common/audius-query' import { css } from '@emotion/native' import { useIsFocused, type RouteProp } from '@react-navigation/native' diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/selectArtistPreviewContext.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/selectArtistPreviewContext.tsx index 985d6380540..9e7ff2e0660 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/selectArtistPreviewContext.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectArtistScreen/selectArtistPreviewContext.tsx @@ -1,11 +1,8 @@ import { createContext, useCallback, useEffect, useMemo, useState } from 'react' -import type { ID } from '@audius/common' -import { - encodeHashId, - useGetUserById, - useGetUserTracksByHandle -} from '@audius/common' +import { useGetUserTracksByHandle, useGetUserById } from '@audius/common/api' +import type { ID } from '@audius/common/models' +import { encodeHashId } from '@audius/common/utils' import { Formik } from 'formik' import TrackPlayer, { RepeatMode, State } from 'react-native-track-player' import { useAsync, useEffectOnce } from 'react-use' diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SelectGenresScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SelectGenresScreen.tsx index 2f09e38138e..bdb69fe0847 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SelectGenresScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SelectGenresScreen.tsx @@ -1,11 +1,8 @@ import { memo, useCallback, useEffect, useState } from 'react' -import type { GENRES } from '@audius/common' -import { - selectGenresPageMessages as messages, - selectGenresSchema, - selectableGenres -} from '@audius/common' +import { selectGenresPageMessages } from '@audius/common/messages' +import { selectableGenres, selectGenresSchema } from '@audius/common/schemas' +import type { GENRES } from '@audius/common/utils' import { setField } from 'common/store/pages/signon/actions' import { Formik, useField } from 'formik' import { ScrollView } from 'react-native' @@ -100,8 +97,8 @@ export const SelectGenresScreen = () => { diff --git a/packages/mobile/src/screens/sign-on-screen/screens/SignInScreen.tsx b/packages/mobile/src/screens/sign-on-screen/screens/SignInScreen.tsx index 15f283b8590..0fc4225689c 100644 --- a/packages/mobile/src/screens/sign-on-screen/screens/SignInScreen.tsx +++ b/packages/mobile/src/screens/sign-on-screen/screens/SignInScreen.tsx @@ -1,10 +1,7 @@ import { useCallback, useEffect } from 'react' -import { - signInPageMessages as messages, - signInErrorMessages, - signInSchema -} from '@audius/common' +import { signInPageMessages } from '@audius/common/messages' +import { signInSchema, signInErrorMessages } from '@audius/common/schemas' import { getEmailField, getPasswordField, @@ -74,9 +71,9 @@ export const SignInScreen = () => { > {({ handleSubmit }) => ( <> - + - + @@ -87,7 +84,7 @@ export const SignInScreen = () => { isLoading={signInStatus === 'loading'} onPress={() => handleSubmit()} > - {messages.signIn} + {signInPageMessages.signIn} { textAlign='center' onPress={onOpen} > - {messages.forgotPassword} + {signInPageMessages.forgotPassword} @@ -116,5 +113,7 @@ const SignInPasswordField = () => { } }, [setError, signInError]) - return + return ( + + ) } diff --git a/packages/mobile/src/screens/sign-on-screen/utils/restrictedHandles.ts b/packages/mobile/src/screens/sign-on-screen/utils/restrictedHandles.ts index 1dd39879f50..e24d38b1ad5 100644 --- a/packages/mobile/src/screens/sign-on-screen/utils/restrictedHandles.ts +++ b/packages/mobile/src/screens/sign-on-screen/utils/restrictedHandles.ts @@ -1,4 +1,4 @@ -import { restrictedHandles as commonRestrictedHandles } from '@audius/common' +import { restrictedHandles as commonRestrictedHandles } from '@audius/common/utils' import { orderedRoutes } from 'audius-client/src/utils/route' const restrictedRoutes = orderedRoutes diff --git a/packages/mobile/src/screens/signon/ProfileAuto.tsx b/packages/mobile/src/screens/signon/ProfileAuto.tsx index d5d7ca32296..50ec552de7c 100644 --- a/packages/mobile/src/screens/signon/ProfileAuto.tsx +++ b/packages/mobile/src/screens/signon/ProfileAuto.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from 'react' -import type { Name } from '@audius/common' -import { BooleanKeys } from '@audius/common' +import type { Name } from '@audius/common/models' +import { BooleanKeys } from '@audius/common/services' import type { NativeStackScreenProps } from '@react-navigation/native-stack' import * as signOnActions from 'common/store/pages/signon/actions' import { diff --git a/packages/mobile/src/screens/signon/ProfileImage.tsx b/packages/mobile/src/screens/signon/ProfileImage.tsx index aea8b0b4cdb..d36751e7280 100644 --- a/packages/mobile/src/screens/signon/ProfileImage.tsx +++ b/packages/mobile/src/screens/signon/ProfileImage.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from 'react' -import type { Image as ImageType } from '@audius/common' +import type { Image as ImageType } from '@audius/common/store' import { Animated, TouchableOpacity, diff --git a/packages/mobile/src/screens/signon/ProfileManual.tsx b/packages/mobile/src/screens/signon/ProfileManual.tsx index 85edbb50b3b..08d7a540aaa 100644 --- a/packages/mobile/src/screens/signon/ProfileManual.tsx +++ b/packages/mobile/src/screens/signon/ProfileManual.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react' -import type { Image } from '@audius/common' +import type { Image } from '@audius/common/store' import type { NativeStackScreenProps } from '@react-navigation/native-stack' import * as signOnActions from 'common/store/pages/signon/actions' import { diff --git a/packages/mobile/src/screens/signon/SignOn.tsx b/packages/mobile/src/screens/signon/SignOn.tsx index e78e803fc77..e8d11878a4a 100644 --- a/packages/mobile/src/screens/signon/SignOn.tsx +++ b/packages/mobile/src/screens/signon/SignOn.tsx @@ -1,6 +1,6 @@ import { useState, useRef, useEffect, useCallback } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import Clipboard from '@react-native-clipboard/clipboard' import type { NativeStackScreenProps } from '@react-navigation/native-stack' import * as signOnActions from 'common/store/pages/signon/actions' diff --git a/packages/mobile/src/screens/smart-collection-screen/SmartCollectionScreen.tsx b/packages/mobile/src/screens/smart-collection-screen/SmartCollectionScreen.tsx index 6a10d05e433..e63351100f3 100644 --- a/packages/mobile/src/screens/smart-collection-screen/SmartCollectionScreen.tsx +++ b/packages/mobile/src/screens/smart-collection-screen/SmartCollectionScreen.tsx @@ -1,14 +1,14 @@ import { useCallback } from 'react' +import { FavoriteSource } from '@audius/common/models' import { - FavoriteSource, accountSelectors, smartCollectionPageSelectors, - collectionsSocialActions, smartCollectionPageActions, + collectionPageActions, playlistLibraryHelpers, - collectionPageActions -} from '@audius/common' + collectionsSocialActions +} from '@audius/common/store' import { useFocusEffect } from '@react-navigation/native' import { View } from 'react-native' import LinearGradient from 'react-native-linear-gradient' diff --git a/packages/mobile/src/screens/tip-artist-screen/AvailableAudio.tsx b/packages/mobile/src/screens/tip-artist-screen/AvailableAudio.tsx index 263031dc38d..30e071b6355 100644 --- a/packages/mobile/src/screens/tip-artist-screen/AvailableAudio.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/AvailableAudio.tsx @@ -1,5 +1,6 @@ -import type { BNWei } from '@audius/common' -import { formatWei, walletSelectors, isNullOrUndefined } from '@audius/common' +import type { BNWei } from '@audius/common/models' +import { walletSelectors } from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import { Image, Platform, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/tip-artist-screen/BecomeTopSupporter.tsx b/packages/mobile/src/screens/tip-artist-screen/BecomeTopSupporter.tsx index c602b8df92a..1899b8ab0ae 100644 --- a/packages/mobile/src/screens/tip-artist-screen/BecomeTopSupporter.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/BecomeTopSupporter.tsx @@ -1,5 +1,5 @@ -import type { BNWei } from '@audius/common' -import { formatWei } from '@audius/common' +import type { BNWei } from '@audius/common/models' +import { formatWei } from '@audius/common/utils' import { Platform, Text } from 'react-native' import LinearGradient from 'react-native-linear-gradient' diff --git a/packages/mobile/src/screens/tip-artist-screen/ConfirmSendTipScreen.tsx b/packages/mobile/src/screens/tip-artist-screen/ConfirmSendTipScreen.tsx index 02df4e9cdec..72d88d5b1f3 100644 --- a/packages/mobile/src/screens/tip-artist-screen/ConfirmSendTipScreen.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/ConfirmSendTipScreen.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect } from 'react' -import { tippingSelectors, tippingActions } from '@audius/common' +import { tippingSelectors, tippingActions } from '@audius/common/store' import type { NativeStackScreenProps } from '@react-navigation/native-stack' import { useKeepAwake } from '@sayem314/react-native-keep-awake' import { Platform } from 'react-native' diff --git a/packages/mobile/src/screens/tip-artist-screen/DegradationNotice.tsx b/packages/mobile/src/screens/tip-artist-screen/DegradationNotice.tsx index 89014f5b759..725a4ab842b 100644 --- a/packages/mobile/src/screens/tip-artist-screen/DegradationNotice.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/DegradationNotice.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { StringKeys } from '@audius/common' +import { StringKeys } from '@audius/common/services' import { Text } from 'react-native' import LinearGradient from 'react-native-linear-gradient' diff --git a/packages/mobile/src/screens/tip-artist-screen/ReceiverDetails.tsx b/packages/mobile/src/screens/tip-artist-screen/ReceiverDetails.tsx index 65958a762a7..571f2564b3b 100644 --- a/packages/mobile/src/screens/tip-artist-screen/ReceiverDetails.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/ReceiverDetails.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { tippingSelectors } from '@audius/common' +import { tippingSelectors } from '@audius/common/store' import { Pressable, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/tip-artist-screen/SendTipScreen.tsx b/packages/mobile/src/screens/tip-artist-screen/SendTipScreen.tsx index 37a5dfe8851..e84194f58fe 100644 --- a/packages/mobile/src/screens/tip-artist-screen/SendTipScreen.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/SendTipScreen.tsx @@ -1,15 +1,15 @@ import { useCallback, useEffect, useState } from 'react' -import type { BNWei, StringWei } from '@audius/common' +import { useGetFirstOrTopSupporter } from '@audius/common/hooks' +import type { StringWei, BNWei } from '@audius/common/models' import { - stringWeiToBN, accountSelectors, tippingSelectors, tippingActions, walletSelectors, - walletActions, - useGetFirstOrTopSupporter -} from '@audius/common' + walletActions +} from '@audius/common/store' +import { stringWeiToBN } from '@audius/common/utils' import { useFocusEffect } from '@react-navigation/native' import BN from 'bn.js' import { Platform } from 'react-native' diff --git a/packages/mobile/src/screens/tip-artist-screen/SendTipStatusText.tsx b/packages/mobile/src/screens/tip-artist-screen/SendTipStatusText.tsx index 20fd1873459..a02fa52ce5d 100644 --- a/packages/mobile/src/screens/tip-artist-screen/SendTipStatusText.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/SendTipStatusText.tsx @@ -1,4 +1,4 @@ -import { tippingSelectors } from '@audius/common' +import { tippingSelectors } from '@audius/common/store' import { Platform, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/tip-artist-screen/TipArtistModalScreen.tsx b/packages/mobile/src/screens/tip-artist-screen/TipArtistModalScreen.tsx index a1163849894..7ca69f43232 100644 --- a/packages/mobile/src/screens/tip-artist-screen/TipArtistModalScreen.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/TipArtistModalScreen.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { tippingActions } from '@audius/common' +import { tippingActions } from '@audius/common/store' import { createNativeStackNavigator } from '@react-navigation/native-stack' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/tip-artist-screen/TipHeader.tsx b/packages/mobile/src/screens/tip-artist-screen/TipHeader.tsx index 31415adba95..2a7ebb26571 100644 --- a/packages/mobile/src/screens/tip-artist-screen/TipHeader.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/TipHeader.tsx @@ -1,4 +1,5 @@ -import { formatNumberCommas, tippingSelectors } from '@audius/common' +import { tippingSelectors } from '@audius/common/store' +import { formatNumberCommas } from '@audius/common/utils' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/tip-artist-screen/TipInput.tsx b/packages/mobile/src/screens/tip-artist-screen/TipInput.tsx index 6bd42aacad0..692b2bdad87 100644 --- a/packages/mobile/src/screens/tip-artist-screen/TipInput.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/TipInput.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' -import { formatNumberCommas } from '@audius/common' +import { formatNumberCommas } from '@audius/common/utils' import type { TextInputProps } from 'app/components/core' import { AudioText, TextInput } from 'app/components/core' diff --git a/packages/mobile/src/screens/tip-artist-screen/TipSentScreen.tsx b/packages/mobile/src/screens/tip-artist-screen/TipSentScreen.tsx index c94341507cc..a0c5eb86e9f 100644 --- a/packages/mobile/src/screens/tip-artist-screen/TipSentScreen.tsx +++ b/packages/mobile/src/screens/tip-artist-screen/TipSentScreen.tsx @@ -1,11 +1,8 @@ import { useCallback } from 'react' -import type { SolanaWalletAddress } from '@audius/common' -import { - formatNumberCommas, - accountSelectors, - tippingSelectors -} from '@audius/common' +import type { SolanaWalletAddress } from '@audius/common/models' +import { accountSelectors, tippingSelectors } from '@audius/common/store' +import { formatNumberCommas } from '@audius/common/utils' import { useNavigation } from '@react-navigation/native' import { Platform } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/track-screen/DownloadRow.tsx b/packages/mobile/src/screens/track-screen/DownloadRow.tsx index a7ff952608d..e7a7266cb88 100644 --- a/packages/mobile/src/screens/track-screen/DownloadRow.tsx +++ b/packages/mobile/src/screens/track-screen/DownloadRow.tsx @@ -1,5 +1,6 @@ -import type { CommonState, ID, DownloadQuality } from '@audius/common' -import { cacheTracksSelectors } from '@audius/common' +import type { ID, DownloadQuality } from '@audius/common/models' +import type { CommonState } from '@audius/common/store' +import { cacheTracksSelectors } from '@audius/common/store' import { css } from '@emotion/native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/track-screen/DownloadSection.tsx b/packages/mobile/src/screens/track-screen/DownloadSection.tsx index b84b26b68a6..dc810461974 100644 --- a/packages/mobile/src/screens/track-screen/DownloadSection.tsx +++ b/packages/mobile/src/screens/track-screen/DownloadSection.tsx @@ -1,16 +1,18 @@ import { useCallback, useState } from 'react' import { - DownloadQuality, - ModalSource, - cacheTracksSelectors, useCurrentStems, - useDownloadableContentAccess, + useDownloadableContentAccess +} from '@audius/common/hooks' +import { ModalSource, DownloadQuality } from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { + cacheTracksSelectors, usePremiumContentPurchaseModal, - tracksSocialActions as socialTracksActions, - useWaitForDownloadModal -} from '@audius/common' -import type { ID, CommonState } from '@audius/common' + useWaitForDownloadModal, + tracksSocialActions as socialTracksActions +} from '@audius/common/store' +import type { CommonState } from '@audius/common/store' import { USDC } from '@audius/fixed-decimal' import { css } from '@emotion/native' import { LayoutAnimation } from 'react-native' diff --git a/packages/mobile/src/screens/track-screen/TrackRemixesScreen.tsx b/packages/mobile/src/screens/track-screen/TrackRemixesScreen.tsx index bc8b165c439..d2a597dd294 100644 --- a/packages/mobile/src/screens/track-screen/TrackRemixesScreen.tsx +++ b/packages/mobile/src/screens/track-screen/TrackRemixesScreen.tsx @@ -1,12 +1,12 @@ import { useCallback, useEffect } from 'react' import { - pluralize, lineupSelectors, remixesPageLineupActions as tracksActions, - remixesPageSelectors, - remixesPageActions -} from '@audius/common' + remixesPageActions, + remixesPageSelectors +} from '@audius/common/store' +import { pluralize } from '@audius/common/utils' import { Text, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' import { useEffectOnce } from 'react-use' diff --git a/packages/mobile/src/screens/track-screen/TrackScreen.tsx b/packages/mobile/src/screens/track-screen/TrackScreen.tsx index 0e76a4b5c92..fe65b60c950 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreen.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreen.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { useProxySelector } from '@audius/common/hooks' import { trackPageLineupActions, trackPageActions, trackPageSelectors, - useProxySelector, reachabilitySelectors -} from '@audius/common' +} from '@audius/common/store' import { useFocusEffect } from '@react-navigation/native' import { Text, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/track-screen/TrackScreenDetailsTile.tsx b/packages/mobile/src/screens/track-screen/TrackScreenDetailsTile.tsx index 780604ec0b9..bc8ff5cddbd 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreenDetailsTile.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreenDetailsTile.tsx @@ -1,38 +1,48 @@ import { useCallback } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - Genre, - SquareSizes, - removeNullable, - playerSelectors, - FavoriteSource, - RepostSource, - ShareSource, Name, + ShareSource, + RepostSource, + FavoriteSource, PlaybackSource, FavoriteType, - getCanonicalName, - formatSeconds, - formatDate, + SquareSizes, + isContentCollectibleGated, + isContentUSDCPurchaseGated +} from '@audius/common/models' +import type { + UID, + SearchUser, + SearchTrack, + Track, + User +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, trackPageLineupActions, + queueSelectors, + reachabilitySelectors, tracksSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, - RepostType, + OverflowAction, + OverflowSource, repostsUserListActions, favoritesUserListActions, - reachabilitySelectors, - useGatedContentAccess, - playbackPositionSelectors, - FeatureFlags, - isContentUSDCPurchaseGated, - isContentCollectibleGated, - queueSelectors -} from '@audius/common' -import type { UID, User, SearchTrack, SearchUser, Track } from '@audius/common' + RepostType, + playerSelectors, + playbackPositionSelectors +} from '@audius/common/store' +import { + Genre, + getCanonicalName, + formatSeconds, + formatDate, + removeNullable +} from '@audius/common/utils' import moment from 'moment' import { Image, View } from 'react-native' import LinearGradient from 'react-native-linear-gradient' diff --git a/packages/mobile/src/screens/track-screen/TrackScreenDownloadButtons.tsx b/packages/mobile/src/screens/track-screen/TrackScreenDownloadButtons.tsx index 4087f1fe757..55cdb2596b2 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreenDownloadButtons.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreenDownloadButtons.tsx @@ -1,12 +1,10 @@ import { useCallback } from 'react' -import { - Name, - ButtonState, - useDownloadTrackButtons, - tracksSocialActions -} from '@audius/common' -import type { ID, ButtonType as DownloadButtonType } from '@audius/common' +import type { ButtonType as DownloadButtonType } from '@audius/common/hooks' +import { ButtonState, useDownloadTrackButtons } from '@audius/common/hooks' +import { Name } from '@audius/common/models' +import type { ID } from '@audius/common/models' +import { tracksSocialActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/track-screen/TrackScreenMainContent.tsx b/packages/mobile/src/screens/track-screen/TrackScreenMainContent.tsx index cf93c022f2b..ce7be82e558 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreenMainContent.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreenMainContent.tsx @@ -2,12 +2,12 @@ import type { ReactNode } from 'react' import type { LineupState, - Track, - User, - Nullable, + SearchUser, SearchTrack, - SearchUser -} from '@audius/common' + Track, + User +} from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import { View } from 'react-native' import { useNavigation } from 'app/hooks/useNavigation' diff --git a/packages/mobile/src/screens/track-screen/TrackScreenRemix.tsx b/packages/mobile/src/screens/track-screen/TrackScreenRemix.tsx index 295e24804fc..792f2de261e 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreenRemix.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreenRemix.tsx @@ -1,11 +1,8 @@ import { useCallback } from 'react' -import type { ID, Track, User } from '@audius/common' -import { - SquareSizes, - cacheTracksSelectors, - cacheUsersSelectors -} from '@audius/common' +import type { ID, Track, User } from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' +import { cacheTracksSelectors, cacheUsersSelectors } from '@audius/common/store' import type { StyleProp, ViewStyle } from 'react-native' import { Pressable, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/track-screen/TrackScreenRemixes.tsx b/packages/mobile/src/screens/track-screen/TrackScreenRemixes.tsx index 0bd7caf29d8..b44974c35ac 100644 --- a/packages/mobile/src/screens/track-screen/TrackScreenRemixes.tsx +++ b/packages/mobile/src/screens/track-screen/TrackScreenRemixes.tsx @@ -1,4 +1,4 @@ -import type { ID } from '@audius/common' +import type { ID } from '@audius/common/models' import { View } from 'react-native' import { IconArrowRight, IconRemix } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/trending-screen/TrendingFilterButton.tsx b/packages/mobile/src/screens/trending-screen/TrendingFilterButton.tsx index e5abd22cf89..a3659a4dc60 100644 --- a/packages/mobile/src/screens/trending-screen/TrendingFilterButton.tsx +++ b/packages/mobile/src/screens/trending-screen/TrendingFilterButton.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { Genre, trendingPageSelectors, modalsActions } from '@audius/common' +import { trendingPageSelectors, modalsActions } from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { ScreenHeaderButton } from 'app/components/core' diff --git a/packages/mobile/src/screens/trending-screen/TrendingFilterDrawer.tsx b/packages/mobile/src/screens/trending-screen/TrendingFilterDrawer.tsx index a70da375d99..3cc26041ff6 100644 --- a/packages/mobile/src/screens/trending-screen/TrendingFilterDrawer.tsx +++ b/packages/mobile/src/screens/trending-screen/TrendingFilterDrawer.tsx @@ -1,14 +1,16 @@ import { useCallback, useMemo, useState } from 'react' import { + trendingPageLineupActions, + trendingPageActions, + trendingPageSelectors +} from '@audius/common/store' +import { + Genre, ELECTRONIC_PREFIX, ELECTRONIC_SUBGENRES, - Genre, - GENRES, - trendingPageLineupActions, - trendingPageSelectors, - trendingPageActions -} from '@audius/common' + GENRES +} from '@audius/common/utils' import { FlatList, Keyboard, View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/trending-screen/TrendingLineup.tsx b/packages/mobile/src/screens/trending-screen/TrendingLineup.tsx index 2286f250f96..8a3bac04fd1 100644 --- a/packages/mobile/src/screens/trending-screen/TrendingLineup.tsx +++ b/packages/mobile/src/screens/trending-screen/TrendingLineup.tsx @@ -1,13 +1,12 @@ import { useCallback, useEffect } from 'react' +import { Name, TimeRange } from '@audius/common/models' import { - Name, - TimeRange, lineupSelectors, trendingPageLineupActions, trendingPageActions, trendingPageSelectors -} from '@audius/common' +} from '@audius/common/store' import { useNavigation } from '@react-navigation/native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/trending-screen/TrendingScreen.tsx b/packages/mobile/src/screens/trending-screen/TrendingScreen.tsx index c91d92ed6a9..c8e0678bdb4 100644 --- a/packages/mobile/src/screens/trending-screen/TrendingScreen.tsx +++ b/packages/mobile/src/screens/trending-screen/TrendingScreen.tsx @@ -1,4 +1,5 @@ -import { TimeRange, trendingPageSelectors } from '@audius/common' +import { TimeRange } from '@audius/common/models' +import { trendingPageSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { diff --git a/packages/mobile/src/screens/upload-screen/components/UploadingTrackTile.tsx b/packages/mobile/src/screens/upload-screen/components/UploadingTrackTile.tsx index 9fcf7d263de..63c5117c299 100644 --- a/packages/mobile/src/screens/upload-screen/components/UploadingTrackTile.tsx +++ b/packages/mobile/src/screens/upload-screen/components/UploadingTrackTile.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import type { UploadTrack } from '@audius/common' +import type { UploadTrack } from '@audius/common/store' import { View } from 'react-native' import { IconImage } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/upload-screen/screens/CompleteTrackScreen.tsx b/packages/mobile/src/screens/upload-screen/screens/CompleteTrackScreen.tsx index 437641039e1..c2b967cfba2 100644 --- a/packages/mobile/src/screens/upload-screen/screens/CompleteTrackScreen.tsx +++ b/packages/mobile/src/screens/upload-screen/screens/CompleteTrackScreen.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { ExtendedTrackMetadata, UploadTrack } from '@audius/common' +import type { UploadTrack, ExtendedTrackMetadata } from '@audius/common/store' import { useRoute } from '@react-navigation/native' import { useNavigation } from 'app/hooks/useNavigation' diff --git a/packages/mobile/src/screens/upload-screen/screens/SelectTrackScreen.tsx b/packages/mobile/src/screens/upload-screen/screens/SelectTrackScreen.tsx index 9bbe955434c..f4985b5e25a 100644 --- a/packages/mobile/src/screens/upload-screen/screens/SelectTrackScreen.tsx +++ b/packages/mobile/src/screens/upload-screen/screens/SelectTrackScreen.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { useFocusEffect } from '@react-navigation/native' import DocumentPicker from 'react-native-document-picker' import { useAsyncFn } from 'react-use' diff --git a/packages/mobile/src/screens/upload-screen/screens/UploadCompleteScreen.tsx b/packages/mobile/src/screens/upload-screen/screens/UploadCompleteScreen.tsx index 9d69514fc4a..b4d46455b8b 100644 --- a/packages/mobile/src/screens/upload-screen/screens/UploadCompleteScreen.tsx +++ b/packages/mobile/src/screens/upload-screen/screens/UploadCompleteScreen.tsx @@ -1,13 +1,13 @@ import { useCallback, useState } from 'react' -import type { CommonState } from '@audius/common' +import type { CommonState } from '@audius/common/store' import { - uploadActions, - cacheTracksSelectors, accountSelectors, + cacheTracksSelectors, trackPageActions, + uploadActions, uploadSelectors -} from '@audius/common' +} from '@audius/common/store' import Clipboard from '@react-native-clipboard/clipboard' import { View, Image } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/upload-screen/screens/UploadingTracksScreen.tsx b/packages/mobile/src/screens/upload-screen/screens/UploadingTracksScreen.tsx index e7c9b6ebcad..2c27ad658f7 100644 --- a/packages/mobile/src/screens/upload-screen/screens/UploadingTracksScreen.tsx +++ b/packages/mobile/src/screens/upload-screen/screens/UploadingTracksScreen.tsx @@ -1,7 +1,11 @@ import { useEffect } from 'react' -import type { UploadTrack } from '@audius/common' -import { uploadSelectors, UploadType, uploadActions } from '@audius/common' +import type { UploadTrack } from '@audius/common/store' +import { + uploadActions, + uploadSelectors, + UploadType +} from '@audius/common/store' import { useRoute } from '@react-navigation/native' import { useKeepAwake } from '@sayem314/react-native-keep-awake' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/upload-screen/utils/processTrackFile.ts b/packages/mobile/src/screens/upload-screen/utils/processTrackFile.ts index c3cc9419275..b086b1938ee 100644 --- a/packages/mobile/src/screens/upload-screen/utils/processTrackFile.ts +++ b/packages/mobile/src/screens/upload-screen/utils/processTrackFile.ts @@ -1,10 +1,10 @@ -import type { UploadTrack } from '@audius/common' +import { newTrackMetadata } from '@audius/common/schemas' +import type { UploadTrack } from '@audius/common/store' import { - ALLOWED_AUDIO_FILE_EXTENSIONS, - ALLOWED_AUDIO_FILE_MIME, ALLOWED_MAX_AUDIO_SIZE_BYTES, - newTrackMetadata -} from '@audius/common' + ALLOWED_AUDIO_FILE_EXTENSIONS, + ALLOWED_AUDIO_FILE_MIME +} from '@audius/common/utils' import { FFprobeKit } from 'ffmpeg-kit-react-native' import type { DocumentPickerResponse } from 'react-native-document-picker' diff --git a/packages/mobile/src/screens/user-list-screen/FavoritedScreen.tsx b/packages/mobile/src/screens/user-list-screen/FavoritedScreen.tsx index 34c8a8a703f..b6cfa3b0640 100644 --- a/packages/mobile/src/screens/user-list-screen/FavoritedScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/FavoritedScreen.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { favoritesUserListActions, favoritesUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconHeart } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/FollowersScreen.tsx b/packages/mobile/src/screens/user-list-screen/FollowersScreen.tsx index 8e57173fd32..387553bc465 100644 --- a/packages/mobile/src/screens/user-list-screen/FollowersScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/FollowersScreen.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' import { - followersUserListSelectors, - followersUserListActions -} from '@audius/common' + followersUserListActions, + followersUserListSelectors +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconUserFollowers } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/FollowingScreen.tsx b/packages/mobile/src/screens/user-list-screen/FollowingScreen.tsx index e6434c329c9..360a46625ff 100644 --- a/packages/mobile/src/screens/user-list-screen/FollowingScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/FollowingScreen.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { followingUserListActions, followingUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconUserList } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx b/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx index d1c38b62ceb..2ed934ee338 100644 --- a/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx @@ -4,7 +4,7 @@ import { mutualsUserListActions, mutualsUserListSelectors, MUTUALS_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconUserFollowing } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/NotificationUsersScreen.tsx b/packages/mobile/src/screens/user-list-screen/NotificationUsersScreen.tsx index 1dfb591fb8f..5cd5e0104c7 100644 --- a/packages/mobile/src/screens/user-list-screen/NotificationUsersScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/NotificationUsersScreen.tsx @@ -4,7 +4,7 @@ import { NotificationType, notificationsUserListActions, notificationsUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { useRoute } from 'app/hooks/useRoute' diff --git a/packages/mobile/src/screens/user-list-screen/RelatedArtistsScreen.tsx b/packages/mobile/src/screens/user-list-screen/RelatedArtistsScreen.tsx index c756a81588b..6eba66f27cf 100644 --- a/packages/mobile/src/screens/user-list-screen/RelatedArtistsScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/RelatedArtistsScreen.tsx @@ -4,7 +4,7 @@ import { relatedArtistsUserListActions, relatedArtistsUserListSelectors, RELATED_ARTISTS_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconUserGroup } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/RepostsScreen.tsx b/packages/mobile/src/screens/user-list-screen/RepostsScreen.tsx index 2346252daf5..2c0085cf438 100644 --- a/packages/mobile/src/screens/user-list-screen/RepostsScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/RepostsScreen.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { repostsUserListActions, repostsUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconRepost } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/SupporterInfo.tsx b/packages/mobile/src/screens/user-list-screen/SupporterInfo.tsx index 7f9a18a10ee..3595de77c74 100644 --- a/packages/mobile/src/screens/user-list-screen/SupporterInfo.tsx +++ b/packages/mobile/src/screens/user-list-screen/SupporterInfo.tsx @@ -1,8 +1,8 @@ -import type { User } from '@audius/common' +import type { User } from '@audius/common/models' import { tippingSelectors, topSupportersUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/user-list-screen/SupportingInfo.tsx b/packages/mobile/src/screens/user-list-screen/SupportingInfo.tsx index 1bc5ca39f1c..52cff932687 100644 --- a/packages/mobile/src/screens/user-list-screen/SupportingInfo.tsx +++ b/packages/mobile/src/screens/user-list-screen/SupportingInfo.tsx @@ -1,5 +1,8 @@ -import type { User } from '@audius/common' -import { tippingSelectors, supportingUserListSelectors } from '@audius/common' +import type { User } from '@audius/common/models' +import { + tippingSelectors, + supportingUserListSelectors +} from '@audius/common/store' import { useSelector } from 'react-redux' import { Tip } from './Tip' diff --git a/packages/mobile/src/screens/user-list-screen/SupportingUsersScreen.tsx b/packages/mobile/src/screens/user-list-screen/SupportingUsersScreen.tsx index 262c7d577c4..d6890becdd3 100644 --- a/packages/mobile/src/screens/user-list-screen/SupportingUsersScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/SupportingUsersScreen.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { supportingUserListActions, supportingUserListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { IconTipping } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/Tip.tsx b/packages/mobile/src/screens/user-list-screen/Tip.tsx index 1f498226915..28fd97eca5d 100644 --- a/packages/mobile/src/screens/user-list-screen/Tip.tsx +++ b/packages/mobile/src/screens/user-list-screen/Tip.tsx @@ -1,5 +1,5 @@ -import type { StringWei } from '@audius/common' -import { formatWei, stringWeiToBN } from '@audius/common' +import type { StringWei } from '@audius/common/models' +import { stringWeiToBN, formatWei } from '@audius/common/utils' import { View } from 'react-native' import { IconTipping } from '@audius/harmony-native' diff --git a/packages/mobile/src/screens/user-list-screen/TopSupportersScreen.tsx b/packages/mobile/src/screens/user-list-screen/TopSupportersScreen.tsx index 845de72d831..570f2ba4ca1 100644 --- a/packages/mobile/src/screens/user-list-screen/TopSupportersScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/TopSupportersScreen.tsx @@ -2,9 +2,9 @@ import { useCallback } from 'react' import { cacheUsersSelectors, - topSupportersUserListSelectors, - topSupportersUserListActions -} from '@audius/common' + topSupportersUserListActions, + topSupportersUserListSelectors +} from '@audius/common/store' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/user-list-screen/UserList.tsx b/packages/mobile/src/screens/user-list-screen/UserList.tsx index cd711426f59..9116f01c542 100644 --- a/packages/mobile/src/screens/user-list-screen/UserList.tsx +++ b/packages/mobile/src/screens/user-list-screen/UserList.tsx @@ -1,11 +1,12 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' -import type { ID, User, UserListStoreState, CommonState } from '@audius/common' +import type { ID, User } from '@audius/common/models' +import type { CommonState, UserListStoreState } from '@audius/common/store' import { cacheUsersSelectors, userListActions, userListSelectors -} from '@audius/common' +} from '@audius/common/store' import { useFocusEffect, useIsFocused } from '@react-navigation/native' import { range } from 'lodash' import { View } from 'react-native' diff --git a/packages/mobile/src/screens/user-list-screen/UserListItem.tsx b/packages/mobile/src/screens/user-list-screen/UserListItem.tsx index 20e4036ed90..9b03a8ee544 100644 --- a/packages/mobile/src/screens/user-list-screen/UserListItem.tsx +++ b/packages/mobile/src/screens/user-list-screen/UserListItem.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { User } from '@audius/common' -import { FollowSource, accountSelectors } from '@audius/common' +import type { User } from '@audius/common/models' +import { FollowSource } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Pressable, View, Animated } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/wallet-connect/ConnectNewWalletButton.tsx b/packages/mobile/src/screens/wallet-connect/ConnectNewWalletButton.tsx index f7e9b932df0..c5d4ef9bc17 100644 --- a/packages/mobile/src/screens/wallet-connect/ConnectNewWalletButton.tsx +++ b/packages/mobile/src/screens/wallet-connect/ConnectNewWalletButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { tokenDashboardPageSelectors } from '@audius/common' +import { tokenDashboardPageSelectors } from '@audius/common/store' import { View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/wallet-connect/WalletConnectScreen.tsx b/packages/mobile/src/screens/wallet-connect/WalletConnectScreen.tsx index f557f2b5baa..28a7c9d3272 100644 --- a/packages/mobile/src/screens/wallet-connect/WalletConnectScreen.tsx +++ b/packages/mobile/src/screens/wallet-connect/WalletConnectScreen.tsx @@ -1,4 +1,4 @@ -import { tokenDashboardPageActions } from '@audius/common' +import { tokenDashboardPageActions } from '@audius/common/store' import { View } from 'react-native' import { useDispatch } from 'react-redux' import { useEffectOnce } from 'react-use' diff --git a/packages/mobile/src/screens/wallet-connect/components/ConfirmRemoveWalletDrawer.tsx b/packages/mobile/src/screens/wallet-connect/components/ConfirmRemoveWalletDrawer.tsx index 85cb44b9693..e0ff12d3f2d 100644 --- a/packages/mobile/src/screens/wallet-connect/components/ConfirmRemoveWalletDrawer.tsx +++ b/packages/mobile/src/screens/wallet-connect/components/ConfirmRemoveWalletDrawer.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' import { - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { ConfirmationDrawer } from 'app/components/drawers' diff --git a/packages/mobile/src/screens/wallet-connect/components/LinkedWallet.tsx b/packages/mobile/src/screens/wallet-connect/components/LinkedWallet.tsx index 1f8c1f4eae1..113a42f2ca3 100644 --- a/packages/mobile/src/screens/wallet-connect/components/LinkedWallet.tsx +++ b/packages/mobile/src/screens/wallet-connect/components/LinkedWallet.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import type { BNWei, Chain } from '@audius/common' -import { formatWei, tokenDashboardPageActions } from '@audius/common' +import type { Chain, BNWei } from '@audius/common/models' +import { tokenDashboardPageActions } from '@audius/common/store' +import { formatWei } from '@audius/common/utils' import Clipboard from '@react-native-clipboard/clipboard' import { View } from 'react-native' import { TouchableOpacity } from 'react-native-gesture-handler' diff --git a/packages/mobile/src/screens/wallet-connect/components/LinkedWallets.tsx b/packages/mobile/src/screens/wallet-connect/components/LinkedWallets.tsx index 22a23e86ad8..cb47c74ca6d 100644 --- a/packages/mobile/src/screens/wallet-connect/components/LinkedWallets.tsx +++ b/packages/mobile/src/screens/wallet-connect/components/LinkedWallets.tsx @@ -1,5 +1,6 @@ -import type { AssociatedWallet } from '@audius/common' -import { Chain, tokenDashboardPageSelectors } from '@audius/common' +import { Chain } from '@audius/common/models' +import type { AssociatedWallet } from '@audius/common/store' +import { tokenDashboardPageSelectors } from '@audius/common/store' import { FlatList, View } from 'react-native' import { useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/wallet-connect/components/SolanaPhoneOption.tsx b/packages/mobile/src/screens/wallet-connect/components/SolanaPhoneOption.tsx index 4b18acf0b2b..a2f4115435a 100644 --- a/packages/mobile/src/screens/wallet-connect/components/SolanaPhoneOption.tsx +++ b/packages/mobile/src/screens/wallet-connect/components/SolanaPhoneOption.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { Theme } from '@audius/common/models' import { accountSelectors, - tokenDashboardPageActions, - Theme -} from '@audius/common' + tokenDashboardPageActions +} from '@audius/common/store' import { transact } from '@solana-mobile/mobile-wallet-adapter-protocol' import { View } from 'react-native' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/mobile/src/screens/wallet-connect/components/WalletConnectDrawer.tsx b/packages/mobile/src/screens/wallet-connect/components/WalletConnectDrawer.tsx index 72b3bbad378..e7fbe6a423e 100644 --- a/packages/mobile/src/screens/wallet-connect/components/WalletConnectDrawer.tsx +++ b/packages/mobile/src/screens/wallet-connect/components/WalletConnectDrawer.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' -import { tokenDashboardPageSelectors } from '@audius/common' +import { tokenDashboardPageSelectors } from '@audius/common/store' import type { RenderQrcodeModalProps, WalletService diff --git a/packages/mobile/src/screens/wallet-connect/components/useSolanaPhoneAuthorization.ts b/packages/mobile/src/screens/wallet-connect/components/useSolanaPhoneAuthorization.ts index 4cb9e479a4b..542fd1d0358 100644 --- a/packages/mobile/src/screens/wallet-connect/components/useSolanaPhoneAuthorization.ts +++ b/packages/mobile/src/screens/wallet-connect/components/useSolanaPhoneAuthorization.ts @@ -1,6 +1,6 @@ import { useCallback, useMemo, useState } from 'react' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import { PublicKey } from '@solana/web3.js' import type { Account as AuthorizedAccount, diff --git a/packages/mobile/src/screens/wallet-connect/useCanConnectNewWallet.ts b/packages/mobile/src/screens/wallet-connect/useCanConnectNewWallet.ts index 574661cf9dc..79c68439a44 100644 --- a/packages/mobile/src/screens/wallet-connect/useCanConnectNewWallet.ts +++ b/packages/mobile/src/screens/wallet-connect/useCanConnectNewWallet.ts @@ -1,4 +1,4 @@ -import { tokenDashboardPageSelectors } from '@audius/common' +import { tokenDashboardPageSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' const { getConfirmingWalletStatus, getRemoveWallet } = diff --git a/packages/mobile/src/screens/wallet-connect/usePhantomConnect.ts b/packages/mobile/src/screens/wallet-connect/usePhantomConnect.ts index 438a1ac4d43..ac650f54ec0 100644 --- a/packages/mobile/src/screens/wallet-connect/usePhantomConnect.ts +++ b/packages/mobile/src/screens/wallet-connect/usePhantomConnect.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { tokenDashboardPageActions } from '@audius/common' +import { tokenDashboardPageActions } from '@audius/common/store' import { useRoute } from '@react-navigation/native' import { useDispatch } from 'react-redux' diff --git a/packages/mobile/src/screens/wallet-connect/useWalletConnect.ts b/packages/mobile/src/screens/wallet-connect/useWalletConnect.ts index 250a20eef98..6ffaa6223fd 100644 --- a/packages/mobile/src/screens/wallet-connect/useWalletConnect.ts +++ b/packages/mobile/src/screens/wallet-connect/useWalletConnect.ts @@ -2,9 +2,9 @@ import { useEffect } from 'react' import { accountSelectors, - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' import { useWalletConnect as useWalletConnectBase } from '@walletconnect/react-native-dapp' import { useDispatch, useSelector } from 'react-redux' import { useEffectOnce } from 'react-use' diff --git a/packages/mobile/src/screens/wallet-connect/useWalletStatusToasts.ts b/packages/mobile/src/screens/wallet-connect/useWalletStatusToasts.ts index 278f0d4b51a..eddca8e85b7 100644 --- a/packages/mobile/src/screens/wallet-connect/useWalletStatusToasts.ts +++ b/packages/mobile/src/screens/wallet-connect/useWalletStatusToasts.ts @@ -1,9 +1,9 @@ import { useEffect } from 'react' import { - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useToast } from 'app/hooks/useToast' diff --git a/packages/mobile/src/services/audio-player/NativeMobileAudio.ts b/packages/mobile/src/services/audio-player/NativeMobileAudio.ts index f87708afabb..dff74f2cd1c 100644 --- a/packages/mobile/src/services/audio-player/NativeMobileAudio.ts +++ b/packages/mobile/src/services/audio-player/NativeMobileAudio.ts @@ -1,4 +1,5 @@ -import type { Nullable, PlaybackRate } from '@audius/common' +import type { PlaybackRate } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import TrackPlayer from 'react-native-track-player' // Shim definition for audio-player needed for player sagas to not break. diff --git a/packages/mobile/src/services/audius-api-client/apiClient.ts b/packages/mobile/src/services/audius-api-client/apiClient.ts index 2fe3b40e9d5..b936d7513b1 100644 --- a/packages/mobile/src/services/audius-api-client/apiClient.ts +++ b/packages/mobile/src/services/audius-api-client/apiClient.ts @@ -1,4 +1,4 @@ -import { AudiusAPIClient } from '@audius/common' +import { AudiusAPIClient } from '@audius/common/services' import { env } from 'app/env' import { audiusBackendInstance } from 'app/services/audius-backend-instance' diff --git a/packages/mobile/src/services/audius-backend-instance.ts b/packages/mobile/src/services/audius-backend-instance.ts index 709d3bac00d..d1e0bfcd5f8 100644 --- a/packages/mobile/src/services/audius-backend-instance.ts +++ b/packages/mobile/src/services/audius-backend-instance.ts @@ -1,4 +1,4 @@ -import { audiusBackend } from '@audius/common' +import { audiusBackend } from '@audius/common/services' import * as nativeLibs from '@audius/sdk/dist/native-libs' import AsyncStorage from '@react-native-async-storage/async-storage' import { Image } from 'react-native' diff --git a/packages/mobile/src/services/eagerLoadUtils.ts b/packages/mobile/src/services/eagerLoadUtils.ts index d7d819de52a..4730a73f24f 100644 --- a/packages/mobile/src/services/eagerLoadUtils.ts +++ b/packages/mobile/src/services/eagerLoadUtils.ts @@ -1,10 +1,9 @@ +import { getEagerDiscprov, makeEagerRequest } from '@audius/common/services' /** * Utilities to assist in eager pre-fetching content from the * protocol before libs has initialized. */ -import { getEagerDiscprov, makeEagerRequest } from '@audius/common' - import { env } from 'app/env' import { audiusLibs, waitForLibsInit } from './libs' diff --git a/packages/mobile/src/services/explore.ts b/packages/mobile/src/services/explore.ts index bbcc298db8e..e68de46e04e 100644 --- a/packages/mobile/src/services/explore.ts +++ b/packages/mobile/src/services/explore.ts @@ -1,4 +1,4 @@ -import { Explore } from '@audius/common' +import { Explore } from '@audius/common/services' import { apiClient } from './audius-api-client' import { audiusBackendInstance } from './audius-backend-instance' diff --git a/packages/mobile/src/services/fingerprint.ts b/packages/mobile/src/services/fingerprint.ts index 9a30ae75342..802cfa0d988 100644 --- a/packages/mobile/src/services/fingerprint.ts +++ b/packages/mobile/src/services/fingerprint.ts @@ -1,4 +1,4 @@ -import { FingerprintClient } from '@audius/common' +import { FingerprintClient } from '@audius/common/services' import { FingerprintJsProAgent } from '@fingerprintjs/fingerprintjs-pro-react-native' import { env } from 'app/env' diff --git a/packages/mobile/src/services/libs.ts b/packages/mobile/src/services/libs.ts index e206b0d0c43..4235f30a53c 100644 --- a/packages/mobile/src/services/libs.ts +++ b/packages/mobile/src/services/libs.ts @@ -1,6 +1,6 @@ import EventEmitter from 'events' -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import type { AudiusLibs } from '@audius/sdk' // TODO: declare this at the root and use actual audiusLibs type diff --git a/packages/mobile/src/services/local-storage.ts b/packages/mobile/src/services/local-storage.ts index 1627dc72a2c..44c5055d929 100644 --- a/packages/mobile/src/services/local-storage.ts +++ b/packages/mobile/src/services/local-storage.ts @@ -1,4 +1,4 @@ -import { LocalStorage } from '@audius/common' +import { LocalStorage } from '@audius/common/services' import AsyncStorage from '@react-native-async-storage/async-storage' export const localStorage = new LocalStorage({ diff --git a/packages/mobile/src/services/monitoringCallbacks.ts b/packages/mobile/src/services/monitoringCallbacks.ts index c60d4fe8438..62e317e7953 100644 --- a/packages/mobile/src/services/monitoringCallbacks.ts +++ b/packages/mobile/src/services/monitoringCallbacks.ts @@ -1,5 +1,5 @@ -import type { MonitorPayload, ServiceMonitorType } from '@audius/common' -import { IntKeys } from '@audius/common' +import type { ServiceMonitorType, MonitorPayload } from '@audius/common/models' +import { IntKeys } from '@audius/common/services' import { track } from 'app/services/analytics' import { EventNames } from 'app/types/analytics' diff --git a/packages/mobile/src/services/offline-downloader/offline-storage.ts b/packages/mobile/src/services/offline-downloader/offline-storage.ts index db1dba2e1de..3dc4102e88b 100644 --- a/packages/mobile/src/services/offline-downloader/offline-storage.ts +++ b/packages/mobile/src/services/offline-downloader/offline-storage.ts @@ -1,15 +1,15 @@ import path from 'path' import type { - Collection, CollectionMetadata, + Collection, ID, - Nullable, Track, - UserMetadata, - UserTrackMetadata -} from '@audius/common' -import { allSettled } from '@audius/common' + UserTrackMetadata, + UserMetadata +} from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' +import { allSettled } from '@audius/common/utils' import RNFetchBlob from 'rn-fetch-blob' const { diff --git a/packages/mobile/src/services/remote-config/getFeatureEnabled.ts b/packages/mobile/src/services/remote-config/getFeatureEnabled.ts index 6483e555ac6..5689a700a88 100644 --- a/packages/mobile/src/services/remote-config/getFeatureEnabled.ts +++ b/packages/mobile/src/services/remote-config/getFeatureEnabled.ts @@ -1,5 +1,6 @@ -import type { FeatureFlags, OverrideSetting } from '@audius/common' -import { FEATURE_FLAG_OVERRIDE_KEY } from '@audius/common' +import { FEATURE_FLAG_OVERRIDE_KEY } from '@audius/common/hooks' +import type { OverrideSetting } from '@audius/common/hooks' +import type { FeatureFlags } from '@audius/common/services' import AsyncStorage from '@react-native-async-storage/async-storage' import { remoteConfigInstance } from './remote-config-instance' diff --git a/packages/mobile/src/services/remote-config/remote-config-instance.ts b/packages/mobile/src/services/remote-config/remote-config-instance.ts index 235d475ab03..9800401f49d 100644 --- a/packages/mobile/src/services/remote-config/remote-config-instance.ts +++ b/packages/mobile/src/services/remote-config/remote-config-instance.ts @@ -1,5 +1,6 @@ -import type { Environment } from '@audius/common' -import { ErrorLevel, remoteConfig } from '@audius/common' +import { ErrorLevel } from '@audius/common/models' +import type { Environment } from '@audius/common/services' +import { remoteConfig } from '@audius/common/services' import * as optimizely from '@optimizely/optimizely-sdk' import AsyncStorage from '@react-native-async-storage/async-storage' import { Platform } from 'react-native' diff --git a/packages/mobile/src/services/sdk/discoveryNodeSelector.ts b/packages/mobile/src/services/sdk/discoveryNodeSelector.ts index 93da0493d7c..cce155e4e6c 100644 --- a/packages/mobile/src/services/sdk/discoveryNodeSelector.ts +++ b/packages/mobile/src/services/sdk/discoveryNodeSelector.ts @@ -1,4 +1,4 @@ -import { DiscoveryNodeSelectorService } from '@audius/common' +import { DiscoveryNodeSelectorService } from '@audius/common/services' import { env } from 'app/env' import { remoteConfigInstance } from 'app/services/remote-config/remote-config-instance' diff --git a/packages/mobile/src/services/sdk/storageNodeSelector.ts b/packages/mobile/src/services/sdk/storageNodeSelector.ts index 6288723981b..833e2319460 100644 --- a/packages/mobile/src/services/sdk/storageNodeSelector.ts +++ b/packages/mobile/src/services/sdk/storageNodeSelector.ts @@ -1,4 +1,4 @@ -import { makeGetStorageNodeSelector } from '@audius/common' +import { makeGetStorageNodeSelector } from '@audius/common/services' import { env } from 'app/env' diff --git a/packages/mobile/src/services/track-download.ts b/packages/mobile/src/services/track-download.ts index e14cdc3c73e..5c4e45a61d3 100644 --- a/packages/mobile/src/services/track-download.ts +++ b/packages/mobile/src/services/track-download.ts @@ -1,8 +1,7 @@ -import { - TrackDownload as TrackDownloadBase, - tracksSocialActions -} from '@audius/common' -import type { DownloadTrackArgs, Nullable } from '@audius/common' +import type { DownloadTrackArgs } from '@audius/common/services' +import { TrackDownload as TrackDownloadBase } from '@audius/common/services' +import { tracksSocialActions } from '@audius/common/store' +import type { Nullable } from '@audius/common/utils' import { Platform, Share } from 'react-native' import { zip } from 'react-native-zip-archive' import type { diff --git a/packages/mobile/src/services/wallet-client.ts b/packages/mobile/src/services/wallet-client.ts index 8d085db2d14..1d6f9f7c1ba 100644 --- a/packages/mobile/src/services/wallet-client.ts +++ b/packages/mobile/src/services/wallet-client.ts @@ -1,4 +1,4 @@ -import { WalletClient } from '@audius/common' +import { WalletClient } from '@audius/common/services' import { apiClient } from './audius-api-client' import { audiusBackendInstance } from './audius-backend-instance' diff --git a/packages/mobile/src/store/account/sagas.ts b/packages/mobile/src/store/account/sagas.ts index b75f3db6d65..faa91635959 100644 --- a/packages/mobile/src/store/account/sagas.ts +++ b/packages/mobile/src/store/account/sagas.ts @@ -1,12 +1,7 @@ -import type { User } from '@audius/common' -import { - accountActions, - getContext, - removeNullable, - SquareSizes, - WidthSizes, - accountSagas -} from '@audius/common' +import type { User } from '@audius/common/models' +import { SquareSizes, WidthSizes } from '@audius/common/models' +import { accountActions, accountSagas, getContext } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import webAccountSagas from 'common/store/account/sagas' import { updateProfileAsync } from 'common/store/profile/sagas' import FastImage from 'react-native-fast-image' diff --git a/packages/mobile/src/store/cache/collections/createPlaylistRequestedSaga.ts b/packages/mobile/src/store/cache/collections/createPlaylistRequestedSaga.ts index 93a4d0b7b37..3ec45f642e6 100644 --- a/packages/mobile/src/store/cache/collections/createPlaylistRequestedSaga.ts +++ b/packages/mobile/src/store/cache/collections/createPlaylistRequestedSaga.ts @@ -1,4 +1,5 @@ -import { cacheCollectionsActions, toastActions, uuid } from '@audius/common' +import { cacheCollectionsActions, toastActions } from '@audius/common/store' +import { uuid } from '@audius/common/utils' import { put, takeEvery } from 'typed-redux-saga' import { navigationRef } from 'app/components/navigation-container/NavigationContainer' diff --git a/packages/mobile/src/store/chat/sagas.ts b/packages/mobile/src/store/chat/sagas.ts index b59744d80e1..dc6e5208112 100644 --- a/packages/mobile/src/store/chat/sagas.ts +++ b/packages/mobile/src/store/chat/sagas.ts @@ -1,4 +1,4 @@ -import { chatActions } from '@audius/common' +import { chatActions } from '@audius/common/store' import { StackActions } from '@react-navigation/native' import { takeLatest } from 'redux-saga/effects' diff --git a/packages/mobile/src/store/download/slice.ts b/packages/mobile/src/store/download/slice.ts index a2f731a7918..fd6d3ef1c46 100644 --- a/packages/mobile/src/store/download/slice.ts +++ b/packages/mobile/src/store/download/slice.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/drawers/slice.ts b/packages/mobile/src/store/drawers/slice.ts index 0a66908d365..a390856d482 100644 --- a/packages/mobile/src/store/drawers/slice.ts +++ b/packages/mobile/src/store/drawers/slice.ts @@ -1,4 +1,5 @@ -import type { ID, Nullable } from '@audius/common' +import type { ID } from '@audius/common/models' +import type { Nullable } from '@audius/common/utils' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/notifications/sagas.ts b/packages/mobile/src/store/notifications/sagas.ts index 3139dce1b07..804b10a9f73 100644 --- a/packages/mobile/src/store/notifications/sagas.ts +++ b/packages/mobile/src/store/notifications/sagas.ts @@ -1,8 +1,8 @@ import { accountSelectors, - getContext, - notificationsActions -} from '@audius/common' + notificationsActions, + getContext +} from '@audius/common/store' import commonNotificationsSagas, { getPollingIntervalMs } from 'audius-client/src/common/store/notifications/sagas' diff --git a/packages/mobile/src/store/oauth/actions.ts b/packages/mobile/src/store/oauth/actions.ts index be950fe4c65..bf741943f27 100644 --- a/packages/mobile/src/store/oauth/actions.ts +++ b/packages/mobile/src/store/oauth/actions.ts @@ -3,7 +3,7 @@ import type { TwitterProfile, TikTokProfile, Image -} from '@audius/common' +} from '@audius/common/store' import type { Provider } from './reducer' import type { Credentials } from './types' diff --git a/packages/mobile/src/store/oauth/reducer.ts b/packages/mobile/src/store/oauth/reducer.ts index e103b327dd3..c7739c19a9b 100644 --- a/packages/mobile/src/store/oauth/reducer.ts +++ b/packages/mobile/src/store/oauth/reducer.ts @@ -1,4 +1,4 @@ -import type { Image, TikTokProfile } from '@audius/common' +import type { TikTokProfile, Image } from '@audius/common/store' import type { OAuthActions } from './actions' import { diff --git a/packages/mobile/src/store/oauth/sagas.ts b/packages/mobile/src/store/oauth/sagas.ts index bc3e72c607b..d6fd9a1384f 100644 --- a/packages/mobile/src/store/oauth/sagas.ts +++ b/packages/mobile/src/store/oauth/sagas.ts @@ -1,9 +1,9 @@ -import type { RemoteConfigInstance } from '@audius/common' +import type { RemoteConfigInstance } from '@audius/common/services' import { - getContext, - formatInstagramProfile, - formatTwitterProfile -} from '@audius/common' + formatTwitterProfile, + formatInstagramProfile +} from '@audius/common/services' +import { getContext } from '@audius/common/store' import * as Sentry from '@sentry/react-native' import { takeEvery, put, takeLatest, call } from 'redux-saga/effects' diff --git a/packages/mobile/src/store/oauth/types.ts b/packages/mobile/src/store/oauth/types.ts index 52ebf8c8ac0..04504426099 100644 --- a/packages/mobile/src/store/oauth/types.ts +++ b/packages/mobile/src/store/oauth/types.ts @@ -1,4 +1,4 @@ -import type { Credentials as TikTokCredentials } from '@audius/common' +import type { Credentials as TikTokCredentials } from '@audius/common/hooks' export type InstagramCredentials = { code: string diff --git a/packages/mobile/src/store/offline-downloads/sagas/getIsOfflineEnabled.ts b/packages/mobile/src/store/offline-downloads/sagas/getIsOfflineEnabled.ts index 72391c2bd37..0636f01e087 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/getIsOfflineEnabled.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/getIsOfflineEnabled.ts @@ -1,4 +1,5 @@ -import { FeatureFlags, getContext } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' +import { getContext } from '@audius/common/store' import { call } from 'typed-redux-saga' import { OFFLINE_OVERRIDE_STORAGE_KEY } from 'app/constants/storage-keys' diff --git a/packages/mobile/src/store/offline-downloads/sagas/getStaleTracks.ts b/packages/mobile/src/store/offline-downloads/sagas/getStaleTracks.ts index ef79b12016b..1909596a849 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/getStaleTracks.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/getStaleTracks.ts @@ -1,4 +1,4 @@ -import type { ID } from '@audius/common' +import type { ID } from '@audius/common/models' import moment from 'moment' import { select } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchNetworkType.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchNetworkType.ts index 59d868bd0ce..43fcb115bc5 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchNetworkType.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchNetworkType.ts @@ -1,4 +1,7 @@ -import { reachabilityActions, reachabilitySelectors } from '@audius/common' +import { + reachabilityActions, + reachabilitySelectors +} from '@audius/common/store' import { NetInfoStateType } from '@react-native-community/netinfo' import { put, select, takeEvery } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchReachability.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchReachability.ts index 6121aa8093f..d1d5d949ace 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchReachability.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/watchReachability.ts @@ -1,4 +1,4 @@ -import { reachabilityActions } from '@audius/common' +import { reachabilityActions } from '@audius/common/store' import { takeEvery, put, select } from 'typed-redux-saga' import { getOfflineQueue, getQueueStatus } from '../../selectors' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadCollectionWorker.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadCollectionWorker.ts index e0f7c2a8be2..f90af20ed30 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadCollectionWorker.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadCollectionWorker.ts @@ -1,10 +1,10 @@ -import type { CollectionMetadata, UserCollectionMetadata } from '@audius/common' -import { - removeNullable, - SquareSizes, - accountSelectors, - getContext -} from '@audius/common' +import type { + CollectionMetadata, + UserCollectionMetadata +} from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' +import { accountSelectors, getContext } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import RNFetchBlob from 'rn-fetch-blob' import { select, call, put, take, race, all } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadTrackWorker.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadTrackWorker.ts index c3cde316a81..0d46f7d8fd8 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadTrackWorker.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/downloadTrackWorker.ts @@ -1,19 +1,21 @@ import type { ID, - QueryParams, - Track, TrackMetadata, + Track, UserTrackMetadata -} from '@audius/common' +} from '@audius/common/models' +import { SquareSizes } from '@audius/common/models' +import type { QueryParams } from '@audius/common/services' import { - getQueryParams, - removeNullable, - SquareSizes, - encodeHashId, accountSelectors, getContext, gatedContentSelectors -} from '@audius/common' +} from '@audius/common/store' +import { + encodeHashId, + removeNullable, + getQueryParams +} from '@audius/common/utils' import RNFetchBlob from 'rn-fetch-blob' import { select, call, put, all, take, race } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/playCounterWorker.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/playCounterWorker.ts index d716f439f52..e72f670a092 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/playCounterWorker.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/playCounterWorker.ts @@ -1,5 +1,5 @@ -import type { ID } from '@audius/common' -import { tracksSocialActions } from '@audius/common' +import type { ID } from '@audius/common/models' +import { tracksSocialActions } from '@audius/common/store' import { put } from 'typed-redux-saga' import { make, track } from 'app/services/analytics' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/staleTrackWorker.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/staleTrackWorker.ts index 6e7adca3e04..3140f6c51d6 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/staleTrackWorker.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/staleTrackWorker.ts @@ -1,9 +1,9 @@ -import type { ID } from '@audius/common' +import type { ID } from '@audius/common/models' import { - getContext, accountSelectors, - cacheTracksSelectors -} from '@audius/common' + cacheTracksSelectors, + getContext +} from '@audius/common/store' import moment from 'moment' import { put, select, call, take, race } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/syncCollectionWorker.ts b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/syncCollectionWorker.ts index fe3b22b8c09..9e0bae11f07 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/syncCollectionWorker.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/offlineQueueSagas/workers/syncCollectionWorker.ts @@ -1,9 +1,9 @@ -import type { DownloadReason, ID } from '@audius/common' +import type { ID, DownloadReason } from '@audius/common/models' import { - cacheCollectionsSelectors, accountSelectors, + cacheCollectionsSelectors, getContext -} from '@audius/common' +} from '@audius/common/store' import { difference } from 'lodash' import moment from 'moment' import { call, put, race, select, take } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/rehydrateOfflineDataSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/rehydrateOfflineDataSaga.ts index b37d072dc4b..9669aaad972 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/rehydrateOfflineDataSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/rehydrateOfflineDataSaga.ts @@ -1,11 +1,13 @@ import type { CollectionMetadata, ID, - TrackMetadata, UID, + TrackMetadata, UserMetadata -} from '@audius/common' -import { cacheActions, Kind, makeUid } from '@audius/common' +} from '@audius/common/models' +import { Kind } from '@audius/common/models' +import { cacheActions } from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { call, select, put } from 'typed-redux-saga' import { diff --git a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadAllFavoritesSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadAllFavoritesSaga.ts index d4e43405e22..aff931146e2 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadAllFavoritesSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadAllFavoritesSaga.ts @@ -1,8 +1,8 @@ import { accountSelectors, - getContext, - savedPageSelectors -} from '@audius/common' + savedPageSelectors, + getContext +} from '@audius/common/store' import { fetchAllAccountCollections } from 'common/store/saved-collections/sagas' import moment from 'moment' import { takeEvery, select, call, put } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadCollectionSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadCollectionSaga.ts index 169dd0717b6..95db8ba9270 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadCollectionSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadCollectionSaga.ts @@ -1,9 +1,9 @@ +import { FavoriteSource } from '@audius/common/models' import { accountSelectors, collectionsSocialActions, - FavoriteSource, getContext -} from '@audius/common' +} from '@audius/common/store' import { takeEvery, select, put, call } from 'typed-redux-saga' import { make, track } from 'app/services/analytics' diff --git a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadFavoritedCollectionSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadFavoritedCollectionSaga.ts index 7d994359093..932f123aaca 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/requestDownloadFavoritedCollectionSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/requestDownloadFavoritedCollectionSaga.ts @@ -1,4 +1,4 @@ -import { accountSelectors, getContext } from '@audius/common' +import { accountSelectors, getContext } from '@audius/common/store' import { takeEvery, select, put, call } from 'typed-redux-saga' import type { CollectionAction, OfflineEntry } from '../slice' diff --git a/packages/mobile/src/store/offline-downloads/sagas/syncOfflineDataSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/syncOfflineDataSaga.ts index 9247f9281c4..3343a7b64b1 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/syncOfflineDataSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/syncOfflineDataSaga.ts @@ -1,4 +1,4 @@ -import type { CommonState } from '@audius/common' +import type { CommonState } from '@audius/common/store' import { waitForBackendSetup } from 'audius-client/src/common/store/backend/sagas' import { waitForRead } from 'audius-client/src/utils/sagaHelpers' import { difference, intersection } from 'lodash' diff --git a/packages/mobile/src/store/offline-downloads/sagas/utils/isCollectionDownloadable.ts b/packages/mobile/src/store/offline-downloads/sagas/utils/isCollectionDownloadable.ts index 2a1fd68e721..17b8311b3cc 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/utils/isCollectionDownloadable.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/utils/isCollectionDownloadable.ts @@ -1,4 +1,4 @@ -import type { ID, UserCollectionMetadata } from '@audius/common' +import type { UserCollectionMetadata, ID } from '@audius/common/models' export const isCollectionDownloadable = ( collection: UserCollectionMetadata, diff --git a/packages/mobile/src/store/offline-downloads/sagas/utils/isTrackDownloadable.ts b/packages/mobile/src/store/offline-downloads/sagas/utils/isTrackDownloadable.ts index 7da5f4a3e2d..af18b2e7c85 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/utils/isTrackDownloadable.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/utils/isTrackDownloadable.ts @@ -1,4 +1,4 @@ -import type { ID, UserTrackMetadata } from '@audius/common' +import type { ID, UserTrackMetadata } from '@audius/common/models' export const isTrackDownloadable = ( track: UserTrackMetadata, diff --git a/packages/mobile/src/store/offline-downloads/sagas/utils/shouldCancelJob.ts b/packages/mobile/src/store/offline-downloads/sagas/utils/shouldCancelJob.ts index a1ef70511f3..5140f1ba888 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/utils/shouldCancelJob.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/utils/shouldCancelJob.ts @@ -1,4 +1,7 @@ -import { reachabilityActions, reachabilitySelectors } from '@audius/common' +import { + reachabilityActions, + reachabilitySelectors +} from '@audius/common/store' import { NetInfoStateType } from '@react-native-community/netinfo' import { select, take } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/watchAddTrackToPlaylistSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/watchAddTrackToPlaylistSaga.ts index 7d09d0509a4..6175334ec9d 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/watchAddTrackToPlaylistSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/watchAddTrackToPlaylistSaga.ts @@ -1,4 +1,4 @@ -import { cacheCollectionsActions } from '@audius/common' +import { cacheCollectionsActions } from '@audius/common/store' import { put, select, takeEvery } from 'typed-redux-saga' import { getCollectionDownloadStatus } from 'app/components/offline-downloads/CollectionDownloadStatusIndicator' diff --git a/packages/mobile/src/store/offline-downloads/sagas/watchSaveCollectionSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/watchSaveCollectionSaga.ts index ba3e241d009..a877e7b21ee 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/watchSaveCollectionSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/watchSaveCollectionSaga.ts @@ -1,4 +1,5 @@ -import { collectionsSocialActions, FavoriteSource } from '@audius/common' +import { FavoriteSource } from '@audius/common/models' +import { collectionsSocialActions } from '@audius/common/store' import { takeEvery, select, put } from 'typed-redux-saga' import { make, track } from 'app/services/analytics' diff --git a/packages/mobile/src/store/offline-downloads/sagas/watchSaveTrackSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/watchSaveTrackSaga.ts index 592066748bc..2794deb341e 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/watchSaveTrackSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/watchSaveTrackSaga.ts @@ -1,4 +1,4 @@ -import { tracksSocialActions } from '@audius/common' +import { tracksSocialActions } from '@audius/common/store' import moment from 'moment' import { put, takeEvery, select } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveCollectionSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveCollectionSaga.ts index 6e31aaa3011..10848e6936a 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveCollectionSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveCollectionSaga.ts @@ -1,4 +1,4 @@ -import { collectionsSocialActions } from '@audius/common' +import { collectionsSocialActions } from '@audius/common/store' import { put, select, takeEvery } from 'typed-redux-saga' import { diff --git a/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveTrackSaga.ts b/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveTrackSaga.ts index 0d4bd78699f..e2a90f74933 100644 --- a/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveTrackSaga.ts +++ b/packages/mobile/src/store/offline-downloads/sagas/watchUnsaveTrackSaga.ts @@ -1,4 +1,4 @@ -import { tracksSocialActions } from '@audius/common' +import { tracksSocialActions } from '@audius/common/store' import { put, takeEvery } from 'typed-redux-saga' import { DOWNLOAD_REASON_FAVORITES } from 'app/store/offline-downloads/constants' diff --git a/packages/mobile/src/store/offline-downloads/selectors.ts b/packages/mobile/src/store/offline-downloads/selectors.ts index a5b39835e28..7096a69fd08 100644 --- a/packages/mobile/src/store/offline-downloads/selectors.ts +++ b/packages/mobile/src/store/offline-downloads/selectors.ts @@ -1,5 +1,6 @@ -import type { ID, TrackMetadata } from '@audius/common' -import { removeNullable, cacheTracksSelectors } from '@audius/common' +import type { ID, TrackMetadata } from '@audius/common/models' +import { cacheTracksSelectors } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import type { AppState } from 'app/store' diff --git a/packages/mobile/src/store/offline-downloads/slice.ts b/packages/mobile/src/store/offline-downloads/slice.ts index 2bff7e76212..16802c20781 100644 --- a/packages/mobile/src/store/offline-downloads/slice.ts +++ b/packages/mobile/src/store/offline-downloads/slice.ts @@ -2,7 +2,7 @@ import type { OfflineCollectionMetadata, ID, OfflineTrackMetadata -} from '@audius/common' +} from '@audius/common/models' import AsyncStorage from '@react-native-async-storage/async-storage' import { NetInfoStateType } from '@react-native-community/netinfo' import type { PayloadAction } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/offline-downloads/utils.ts b/packages/mobile/src/store/offline-downloads/utils.ts index cd31215960e..6fd9b03af9d 100644 --- a/packages/mobile/src/store/offline-downloads/utils.ts +++ b/packages/mobile/src/store/offline-downloads/utils.ts @@ -1,8 +1,8 @@ import type { - ID, OfflineCollectionMetadata, + ID, OfflineTrackMetadata -} from '@audius/common' +} from '@audius/common/models' import type { CollectionId } from './slice' diff --git a/packages/mobile/src/store/purchase-vendor/slice.ts b/packages/mobile/src/store/purchase-vendor/slice.ts index 888add127dd..c4b4f73bb07 100644 --- a/packages/mobile/src/store/purchase-vendor/slice.ts +++ b/packages/mobile/src/store/purchase-vendor/slice.ts @@ -1,4 +1,4 @@ -import type { PurchaseVendor } from '@audius/common' +import type { PurchaseVendor } from '@audius/common/models' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/rate-cta/sagas.ts b/packages/mobile/src/store/rate-cta/sagas.ts index 2130c65b018..76c68749a37 100644 --- a/packages/mobile/src/store/rate-cta/sagas.ts +++ b/packages/mobile/src/store/rate-cta/sagas.ts @@ -1,4 +1,4 @@ -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { waitForWrite } from 'audius-client/src/utils/sagaHelpers' import { make } from 'common/store/analytics/actions' import { call, put, takeEvery } from 'typed-redux-saga' diff --git a/packages/mobile/src/store/sagas.ts b/packages/mobile/src/store/sagas.ts index bdffe377eeb..e6ccb78a81b 100644 --- a/packages/mobile/src/store/sagas.ts +++ b/packages/mobile/src/store/sagas.ts @@ -1,29 +1,29 @@ import { + buyCryptoSagas, + buyUSDCSagas, castSagas, chatSagas, - playerSagas as commonPlayerSagas, - playbackPositionSagas, - gatedContentSagas, - remoteConfigSagas as remoteConfig, + reachabilitySagas, + remoteConfigSagas, + solanaSagas, + relatedArtistsSagas, deletePlaylistConfirmationModalUISagas as deletePlaylistConfirmationModalSagas, duplicateAddConfirmationModalUISagas as duplicateAddConfirmationModalSagas, - publishPlaylistConfirmationModalUISagas as publishPlaylistConfirmationModalSagas, - publishTrackConfirmationModalUISagas as publishTrackConfirmationModalSagas, mobileOverflowMenuUISagas as overflowMenuSagas, + publishPlaylistConfirmationModalUISagas as publishPlaylistConfirmationModalSagas, shareModalUISagas as shareModalSagas, + stripeModalUISagas, vipDiscordModalSagas, - reachabilitySagas, - relatedArtistsSagas, - searchUsersModalSagas, - solanaSagas, toastSagas, - confirmerSagas, + publishTrackConfirmationModalUISagas as publishTrackConfirmationModalSagas, + searchUsersModalSagas, + modalsSagas, + playerSagas as commonPlayerSagas, + playbackPositionSagas, + gatedContentSagas, purchaseContentSagas, - buyUSDCSagas, - buyCryptoSagas, - stripeModalUISagas, - modalsSagas -} from '@audius/common' + confirmerSagas +} from '@audius/common/store' import addToCollectionSagas from 'common/store/add-to-collection/sagas' import analyticsSagas from 'common/store/analytics/sagas' import backendSagas from 'common/store/backend/sagas' @@ -201,7 +201,7 @@ export default function* rootSaga() { ...toastSagas(), initKeyboardEvents, - ...remoteConfig(), + ...remoteConfigSagas(), ...oauthSagas(), ...walletsSagas() ] diff --git a/packages/mobile/src/store/search/searchSlice.ts b/packages/mobile/src/store/search/searchSlice.ts index 64bdc32f1b0..95612a0056d 100644 --- a/packages/mobile/src/store/search/searchSlice.ts +++ b/packages/mobile/src/store/search/searchSlice.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import AsyncStorage from '@react-native-async-storage/async-storage' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/settings/sagas.ts b/packages/mobile/src/store/settings/sagas.ts index c239c3cb294..c8cbfa6efcb 100644 --- a/packages/mobile/src/store/settings/sagas.ts +++ b/packages/mobile/src/store/settings/sagas.ts @@ -1,16 +1,17 @@ -import type { PushNotifications as TPushNotifications } from '@audius/common' +import type { PushNotifications as TPushNotifications } from '@audius/common/store' import { - getErrorMessage, accountSelectors, - settingsPageInitialState as initialState, settingsPageSelectors, + settingsPageInitialState as initialState, + settingsPageActions, PushNotificationSetting, - settingsPageActions as actions, - getContext, + getContext +} from '@audius/common/store' +import { + getErrorMessage, waitForValue, - waitForAccount, - settingsPageActions -} from '@audius/common' + waitForAccount +} from '@audius/common/utils' import { waitForRead } from 'audius-client/src/utils/sagaHelpers' import commonSettingsSagas from 'common/store/pages/settings/sagas' import { mapValues } from 'lodash' @@ -77,7 +78,7 @@ function* enablePushNotifications() { // Enabling push notifications should enable all of the notification types const newSettings = { ...initialState.pushNotifications } - yield* put(actions.setPushNotificationSettings(newSettings)) + yield* put(settingsPageActions.setPushNotificationSettings(newSettings)) // We need a user for this to work (and in the case of sign up, we might not // have one right away when this function is called) @@ -93,7 +94,7 @@ function* disablePushNotifications() { return false } ) - yield* put(actions.setPushNotificationSettings(newSettings)) + yield* put(settingsPageActions.setPushNotificationSettings(newSettings)) yield* call(waitForValue, getAccountUser) yield* call(audiusBackendInstance.updatePushNotificationSettings, newSettings) yield* call(deregisterPushNotifications) @@ -109,42 +110,51 @@ function pushNotificationsEnabled(settings: TPushNotifications): boolean { function* watchGetPushNotificationSettings() { const audiusBackendInstance = yield* getContext('audiusBackendInstance') - yield* takeEvery(actions.GET_PUSH_NOTIFICATION_SETTINGS, function* () { - yield* call(waitForRead) - try { - const settings = yield* call( - audiusBackendInstance.getPushNotificationSettings - ) - let pushNotificationSettings = mapValues( - initialState.pushNotifications, - function (_val: boolean) { - return false + yield* takeEvery( + settingsPageActions.GET_PUSH_NOTIFICATION_SETTINGS, + function* () { + yield* call(waitForRead) + try { + const settings = yield* call( + audiusBackendInstance.getPushNotificationSettings + ) + let pushNotificationSettings = mapValues( + initialState.pushNotifications, + function (_val: boolean) { + return false + } + ) + + if (settings) { + pushNotificationSettings = { + ...settings, + [PushNotificationSetting.MobilePush]: yield* call( + pushNotificationsEnabled, + settings + ) + } } - ) - - if (settings) { - pushNotificationSettings = { - ...settings, - [PushNotificationSetting.MobilePush]: yield* call( - pushNotificationsEnabled, - settings + yield* put( + settingsPageActions.setPushNotificationSettings( + pushNotificationSettings ) - } + ) + } catch (error) { + const errorMessage = getErrorMessage(error) + console.error(errorMessage) + yield* put( + settingsPageActions.getPushNotificationSettingsFailed(errorMessage) + ) } - yield* put(actions.setPushNotificationSettings(pushNotificationSettings)) - } catch (error) { - const errorMessage = getErrorMessage(error) - console.error(errorMessage) - yield* put(actions.getPushNotificationSettingsFailed(errorMessage)) } - }) + ) } function* watchUpdatePushNotificationSettings() { const audiusBackendInstance = yield* getContext('audiusBackendInstance') yield* takeEvery( - actions.TOGGLE_PUSH_NOTIFICATION_SETTING, - function* (action: actions.TogglePushNotificationSetting) { + settingsPageActions.TOGGLE_PUSH_NOTIFICATION_SETTING, + function* (action: settingsPageActions.TogglePushNotificationSetting) { let isOn = action.isOn try { @@ -167,7 +177,7 @@ function* watchUpdatePushNotificationSettings() { } } catch (e) { yield* put( - actions.togglePushNotificationSettingFailed( + settingsPageActions.togglePushNotificationSettingFailed( action.notificationType, action.isOn ) @@ -178,23 +188,26 @@ function* watchUpdatePushNotificationSettings() { } function* watchRequestPushNotificationPermissions() { - yield* takeEvery(actions.REQUEST_PUSH_NOTIFICATION_PERMISSIONS, function* () { - const { status } = yield* call(checkNotifications) - const isMobilePushEnabled = yield* call(getIsMobilePushEnabled) - - if ( - (status === RESULTS.GRANTED || status === RESULTS.LIMITED) && - isMobilePushEnabled - ) { - yield* call(registerDeviceToken) - } else if (status === RESULTS.BLOCKED || status === RESULTS.UNAVAILABLE) { - // do nothing - } else { - yield* put( - setVisibility({ drawer: 'EnablePushNotifications', visible: true }) - ) + yield* takeEvery( + settingsPageActions.REQUEST_PUSH_NOTIFICATION_PERMISSIONS, + function* () { + const { status } = yield* call(checkNotifications) + const isMobilePushEnabled = yield* call(getIsMobilePushEnabled) + + if ( + (status === RESULTS.GRANTED || status === RESULTS.LIMITED) && + isMobilePushEnabled + ) { + yield* call(registerDeviceToken) + } else if (status === RESULTS.BLOCKED || status === RESULTS.UNAVAILABLE) { + // do nothing + } else { + yield* put( + setVisibility({ drawer: 'EnablePushNotifications', visible: true }) + ) + } } - }) + ) } export default function sagas() { diff --git a/packages/mobile/src/store/share-to-story-progress/slice.ts b/packages/mobile/src/store/share-to-story-progress/slice.ts index 263a743389f..751c784c903 100644 --- a/packages/mobile/src/store/share-to-story-progress/slice.ts +++ b/packages/mobile/src/store/share-to-story-progress/slice.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/store/sign-out/sagas.ts b/packages/mobile/src/store/sign-out/sagas.ts index 46677ef9e1f..96ccb98add2 100644 --- a/packages/mobile/src/store/sign-out/sagas.ts +++ b/packages/mobile/src/store/sign-out/sagas.ts @@ -1,13 +1,12 @@ +import { Name, Theme } from '@audius/common/models' import { - Name, - signOutActions, accountActions, + tokenDashboardPageActions, feedPageLineupActions, - themeActions, - Theme, - waitForValue, - tokenDashboardPageActions -} from '@audius/common' + signOutActions, + themeActions +} from '@audius/common/store' +import { waitForValue } from '@audius/common/utils' import { setupBackend } from 'audius-client/src/common/store/backend/actions' import { getIsSettingUp } from 'audius-client/src/common/store/backend/selectors' import { resetSignOn } from 'audius-client/src/common/store/pages/signon/actions' diff --git a/packages/mobile/src/store/store.ts b/packages/mobile/src/store/store.ts index e68a22df62e..8fe41a8f10d 100644 --- a/packages/mobile/src/store/store.ts +++ b/packages/mobile/src/store/store.ts @@ -1,11 +1,11 @@ -import type { CommonState, RemoteConfigState } from '@audius/common' +import { ErrorLevel } from '@audius/common/models' +import type { CommonState, RemoteConfigState } from '@audius/common/store' import { - toastActions, - ErrorLevel, + chatMiddleware, remoteConfigReducer as remoteConfig, - reducers as commonReducers, - chatMiddleware -} from '@audius/common' + toastActions, + reducers as commonReducers +} from '@audius/common/store' import AsyncStorage from '@react-native-async-storage/async-storage' import backend from 'audius-client/src/common/store/backend/reducer' import type { BackendState } from 'audius-client/src/common/store/backend/types' diff --git a/packages/mobile/src/store/storeContext.ts b/packages/mobile/src/store/storeContext.ts index 24a49d5f240..8af12ca5593 100644 --- a/packages/mobile/src/store/storeContext.ts +++ b/packages/mobile/src/store/storeContext.ts @@ -1,5 +1,5 @@ -import type { CommonStoreContext } from '@audius/common' -import { OpenSeaClient, SolanaClient } from '@audius/common' +import { OpenSeaClient, SolanaClient } from '@audius/common/services' +import type { CommonStoreContext } from '@audius/common/store' import AsyncStorage from '@react-native-async-storage/async-storage' import * as Sentry from '@sentry/react-native' diff --git a/packages/mobile/src/store/theme/sagas.ts b/packages/mobile/src/store/theme/sagas.ts index 35ff6f85dea..5ecd0190e4d 100644 --- a/packages/mobile/src/store/theme/sagas.ts +++ b/packages/mobile/src/store/theme/sagas.ts @@ -1,5 +1,5 @@ -import type { SetThemeAction } from '@audius/common' -import { themeActions } from '@audius/common' +import type { SetThemeAction } from '@audius/common/store' +import { themeActions } from '@audius/common/store' import { takeEvery, call } from 'typed-redux-saga' import { THEME_STORAGE_KEY } from 'app/constants/storage-keys' diff --git a/packages/mobile/src/store/wallet-connect/sagas/connectNewWalletSaga.ts b/packages/mobile/src/store/wallet-connect/sagas/connectNewWalletSaga.ts index 1339d9b6a79..213670be787 100644 --- a/packages/mobile/src/store/wallet-connect/sagas/connectNewWalletSaga.ts +++ b/packages/mobile/src/store/wallet-connect/sagas/connectNewWalletSaga.ts @@ -1,12 +1,12 @@ -import type { WalletAddress, Nullable } from '@audius/common' +import type { WalletAddress } from '@audius/common/models' +import { Name, Chain } from '@audius/common/models' import { accountSelectors, - Chain, - getContext, tokenDashboardPageActions, - Name, - getErrorMessage -} from '@audius/common' + getContext +} from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' +import type { Nullable } from '@audius/common/utils' import bs58 from 'bs58' import { checkIsNewWallet } from 'common/store/pages/token-dashboard/checkIsNewWallet' import { getWalletInfo } from 'common/store/pages/token-dashboard/getWalletInfo' diff --git a/packages/mobile/src/store/wallet-connect/sagas/signMessageSaga.ts b/packages/mobile/src/store/wallet-connect/sagas/signMessageSaga.ts index 3560496dea5..d7caeb795f4 100644 --- a/packages/mobile/src/store/wallet-connect/sagas/signMessageSaga.ts +++ b/packages/mobile/src/store/wallet-connect/sagas/signMessageSaga.ts @@ -1,11 +1,7 @@ -import type { CommonState } from '@audius/common' -import { - tokenDashboardPageSelectors, - getContext, - waitForValue, - Name, - getErrorMessage -} from '@audius/common' +import { Name } from '@audius/common/models' +import type { CommonState } from '@audius/common/store' +import { tokenDashboardPageSelectors, getContext } from '@audius/common/store' +import { getErrorMessage, waitForValue } from '@audius/common/utils' import bs58 from 'bs58' import { addWalletToUser } from 'common/store/pages/token-dashboard/addWalletToUser' import { associateNewWallet } from 'common/store/pages/token-dashboard/associateNewWallet' diff --git a/packages/mobile/src/store/wallet-connect/slice.ts b/packages/mobile/src/store/wallet-connect/slice.ts index 03f354f4ce2..876f28e1e1f 100644 --- a/packages/mobile/src/store/wallet-connect/slice.ts +++ b/packages/mobile/src/store/wallet-connect/slice.ts @@ -1,4 +1,4 @@ -import type { Nullable } from '@audius/common' +import type { Nullable } from '@audius/common/utils' import type { PayloadAction } from '@reduxjs/toolkit' import { createSlice } from '@reduxjs/toolkit' diff --git a/packages/mobile/src/styles/makeAnimations.ts b/packages/mobile/src/styles/makeAnimations.ts index 9b6f01e225f..2b0d69f3431 100644 --- a/packages/mobile/src/styles/makeAnimations.ts +++ b/packages/mobile/src/styles/makeAnimations.ts @@ -1,4 +1,4 @@ -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import type { ThemeColors } from 'app/utils/theme' import { diff --git a/packages/mobile/src/styles/makeStyles.ts b/packages/mobile/src/styles/makeStyles.ts index 83adcef8861..496958d2f5a 100644 --- a/packages/mobile/src/styles/makeStyles.ts +++ b/packages/mobile/src/styles/makeStyles.ts @@ -1,4 +1,4 @@ -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import type { ImageStyle, TextStyle, ViewStyle } from 'react-native' import { StyleSheet } from 'react-native' diff --git a/packages/mobile/src/types/analytics.ts b/packages/mobile/src/types/analytics.ts index e6914b1d034..f2defa636d1 100644 --- a/packages/mobile/src/types/analytics.ts +++ b/packages/mobile/src/types/analytics.ts @@ -1,8 +1,8 @@ import type { - AllTrackingEvents as CommonTrackingEvents, - ID -} from '@audius/common' -import { Name as CommonEventNames } from '@audius/common' + ID, + AllTrackingEvents as CommonTrackingEvents +} from '@audius/common/models' +import { Name as CommonEventNames } from '@audius/common/models' import type { OfflineJob } from 'app/store/offline-downloads/slice' @@ -196,4 +196,4 @@ export { FavoriteSource, FollowSource, CreatePlaylistSource -} from '@audius/common' +} from '@audius/common/models' diff --git a/packages/mobile/src/utils/challenges.tsx b/packages/mobile/src/utils/challenges.tsx index b2f0ee248e3..3f838d15c9d 100644 --- a/packages/mobile/src/utils/challenges.tsx +++ b/packages/mobile/src/utils/challenges.tsx @@ -1,5 +1,9 @@ -import { ChallengeName, challengeRewardsConfig } from '@audius/common' -import type { ChallengeRewardID, OptimisticUserChallenge } from '@audius/common' +import type { + ChallengeRewardID, + OptimisticUserChallenge +} from '@audius/common/models' +import { ChallengeName } from '@audius/common/models' +import { challengeRewardsConfig } from '@audius/common/utils' import type { ImageSourcePropType } from 'react-native' import { Platform } from 'react-native' diff --git a/packages/mobile/src/utils/convertRGBtoHex.ts b/packages/mobile/src/utils/convertRGBtoHex.ts index f5fe51e03d9..9d840e7a7d8 100644 --- a/packages/mobile/src/utils/convertRGBtoHex.ts +++ b/packages/mobile/src/utils/convertRGBtoHex.ts @@ -1,4 +1,4 @@ -import type { Color } from '@audius/common' +import type { Color } from '@audius/common/models' const componentToHex = (value: number) => { const hex = value.toString(16) diff --git a/packages/mobile/src/utils/dominantColors.ts b/packages/mobile/src/utils/dominantColors.ts index e1dca73eda9..f7f04bee89f 100644 --- a/packages/mobile/src/utils/dominantColors.ts +++ b/packages/mobile/src/utils/dominantColors.ts @@ -1,4 +1,4 @@ -import type { Color } from '@audius/common' +import type { Color } from '@audius/common/models' import Jimp from 'jimp' const DEFAULT_RGB = '#7e1bcc' diff --git a/packages/mobile/src/utils/generatePlaylistArtwork.ts b/packages/mobile/src/utils/generatePlaylistArtwork.ts index 2ad944e08b9..374e115cc3f 100644 --- a/packages/mobile/src/utils/generatePlaylistArtwork.ts +++ b/packages/mobile/src/utils/generatePlaylistArtwork.ts @@ -1,4 +1,4 @@ -import { uuid } from '@audius/common' +import { uuid } from '@audius/common/utils' import Jimp from 'jimp' import RNFetchBlob from 'rn-fetch-blob' diff --git a/packages/mobile/src/utils/launchSelectImageActionSheet.ts b/packages/mobile/src/utils/launchSelectImageActionSheet.ts index 1ecbcee155f..127b1a47977 100644 --- a/packages/mobile/src/utils/launchSelectImageActionSheet.ts +++ b/packages/mobile/src/utils/launchSelectImageActionSheet.ts @@ -1,4 +1,4 @@ -import type { Image } from '@audius/common' +import type { Image } from '@audius/common/store' import { ActionSheetIOS, Alert, Platform } from 'react-native' import type { Image as CropPickerImage, diff --git a/packages/mobile/src/utils/navigation.ts b/packages/mobile/src/utils/navigation.ts index 584eadc358b..909a477e520 100644 --- a/packages/mobile/src/utils/navigation.ts +++ b/packages/mobile/src/utils/navigation.ts @@ -1,4 +1,4 @@ -import type { Maybe } from '@audius/common' +import type { Maybe } from '@audius/common/utils' import type { NavigationProp, NavigationState } from '@react-navigation/native' import type { NativeStackNavigationProp } from '@react-navigation/native-stack' diff --git a/packages/mobile/src/utils/reachability.ts b/packages/mobile/src/utils/reachability.ts index ea069845b7c..85a6886a952 100644 --- a/packages/mobile/src/utils/reachability.ts +++ b/packages/mobile/src/utils/reachability.ts @@ -1,4 +1,4 @@ -import { reachabilityActions } from '@audius/common' +import { reachabilityActions } from '@audius/common/store' import type { NetInfoState } from '@react-native-community/netinfo' import NetInfo from '@react-native-community/netinfo' import { debounce } from 'lodash' diff --git a/packages/mobile/src/utils/reportToSentry.ts b/packages/mobile/src/utils/reportToSentry.ts index 31e4e0e88c6..3ffe316fd92 100644 --- a/packages/mobile/src/utils/reportToSentry.ts +++ b/packages/mobile/src/utils/reportToSentry.ts @@ -1,5 +1,5 @@ -import type { ReportToSentryArgs, ErrorLevel } from '@audius/common' -import { getErrorMessage } from '@audius/common' +import type { ErrorLevel, ReportToSentryArgs } from '@audius/common/models' +import { getErrorMessage } from '@audius/common/utils' import { captureException, withScope } from '@sentry/react-native' import type { SeverityLevel } from '@sentry/types' diff --git a/packages/mobile/src/utils/routes.tsx b/packages/mobile/src/utils/routes.tsx index d7839804e59..2579844ed61 100644 --- a/packages/mobile/src/utils/routes.tsx +++ b/packages/mobile/src/utils/routes.tsx @@ -1,5 +1,5 @@ -import type { UserCollection, User } from '@audius/common' -import { getHash, encodeUrlName } from '@audius/common' +import type { UserCollection, User } from '@audius/common/models' +import { encodeUrlName, getHash } from '@audius/common/utils' import { env } from 'app/env' diff --git a/packages/mobile/src/utils/theme.ts b/packages/mobile/src/utils/theme.ts index 6c70bc99201..7aa514c8255 100644 --- a/packages/mobile/src/utils/theme.ts +++ b/packages/mobile/src/utils/theme.ts @@ -1,5 +1,5 @@ -import type { CommonState } from '@audius/common' -import { themeSelectors } from '@audius/common' +import type { CommonState } from '@audius/common/store' +import { themeSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' const { getTheme, getSystemAppearance } = themeSelectors diff --git a/packages/mobile/tsconfig.json b/packages/mobile/tsconfig.json index 1ca1559b16d..361e6a9e0c0 100644 --- a/packages/mobile/tsconfig.json +++ b/packages/mobile/tsconfig.json @@ -1,10 +1,27 @@ { "extends": "@react-native/typescript-config/tsconfig.json", "compilerOptions": { - // Remove "dom" when no longer dependent on audius-client - "lib": ["dom", "es2019"], + // Use react-native's builtin lib when no longer dependent on audius-client + "lib": [ + "dom", + "es2019", + "es2020.bigint", + "es2020.date", + "es2020.number", + "es2020.promise", + "es2020.string", + "es2020.symbol.wellknown", + "es2021.promise", + "es2021.string", + "es2021.weakref", + "es2022.array", + "es2022.object", + "es2022.string" + ], + "module": "esnext", "paths": { "@audius/harmony-native": ["./src/harmony-native/index.ts"], + "~/*": ["../common/src/*"], "app/*": ["./src/*"], // Remove these when no longer dependent on audius-client "audio/*": ["../../node_modules/audius-client/src/audio/*"], diff --git a/packages/mobile/types/react-redux.d.ts b/packages/mobile/types/react-redux.d.ts index 8e419bcf4b7..720a8534466 100644 --- a/packages/mobile/types/react-redux.d.ts +++ b/packages/mobile/types/react-redux.d.ts @@ -45,4 +45,6 @@ declare module 'react-redux' { State = unknown, Action extends BasicAction = AnyAction >() => Store + + export declare function shallowEqual(objA: any, objB: any): boolean } diff --git a/packages/web/package.json b/packages/web/package.json index 2af4e6b0f1a..a42fc424982 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -272,7 +272,6 @@ "vite": "4.5.0", "vite-plugin-glslify": "2.0.2", "vite-plugin-svgr": "4.1.0", - "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.6" } } diff --git a/packages/web/src/app/App.tsx b/packages/web/src/app/App.tsx index fe3e730dad9..137d91a8c9f 100644 --- a/packages/web/src/app/App.tsx +++ b/packages/web/src/app/App.tsx @@ -2,7 +2,8 @@ import { useEffect, Suspense, lazy } from 'react' -import { FeatureFlags, useFeatureFlag } from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' import { CoinflowPurchaseProtection } from '@coinflowlabs/react' import { Redirect, Route, Switch } from 'react-router-dom' diff --git a/packages/web/src/app/AppContextProvider.tsx b/packages/web/src/app/AppContextProvider.tsx index 19aa7d1da17..89183154628 100644 --- a/packages/web/src/app/AppContextProvider.tsx +++ b/packages/web/src/app/AppContextProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode, useMemo } from 'react' -import { AppContext } from '@audius/common' +import { AppContext } from '@audius/common/context' import { useAsync } from 'react-use' import * as analytics from 'services/analytics' diff --git a/packages/web/src/app/AppErrorBoundary.tsx b/packages/web/src/app/AppErrorBoundary.tsx index ad4dca3b9a2..404f1425556 100644 --- a/packages/web/src/app/AppErrorBoundary.tsx +++ b/packages/web/src/app/AppErrorBoundary.tsx @@ -1,6 +1,6 @@ import { ReactNode, useCallback } from 'react' -import { ErrorLevel } from '@audius/common' +import { ErrorLevel } from '@audius/common/models' import { ErrorBoundary, ErrorBoundaryProps } from 'react-error-boundary' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/app/AudiusQueryProvider.tsx b/packages/web/src/app/AudiusQueryProvider.tsx index 626aec1b765..12f86517d46 100644 --- a/packages/web/src/app/AudiusQueryProvider.tsx +++ b/packages/web/src/app/AudiusQueryProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react' -import { AudiusQueryContext } from '@audius/common' +import { AudiusQueryContext } from '@audius/common/audius-query' import { useDispatch } from 'react-redux' import { apiClient } from 'services/audius-api-client' diff --git a/packages/web/src/app/ThemeProvider.tsx b/packages/web/src/app/ThemeProvider.tsx index a9883689325..ef629dfe8e0 100644 --- a/packages/web/src/app/ThemeProvider.tsx +++ b/packages/web/src/app/ThemeProvider.tsx @@ -1,6 +1,7 @@ import { ReactNode } from 'react' -import { SystemAppearance, Theme, themeSelectors } from '@audius/common' +import { Theme, SystemAppearance } from '@audius/common/models' +import { themeSelectors } from '@audius/common/store' import { ThemeProvider as HarmonyThemeProvider } from '@audius/harmony' import { AppState } from 'store/types' diff --git a/packages/web/src/app/TrpcProvider.tsx b/packages/web/src/app/TrpcProvider.tsx index 04fcf47bd1c..2d12208dd31 100644 --- a/packages/web/src/app/TrpcProvider.tsx +++ b/packages/web/src/app/TrpcProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode, useMemo, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { useSelector } from 'react-redux' diff --git a/packages/web/src/app/web-player/WebPlayer.jsx b/packages/web/src/app/web-player/WebPlayer.jsx index 4689ae60eec..34595c0709f 100644 --- a/packages/web/src/app/web-player/WebPlayer.jsx +++ b/packages/web/src/app/web-player/WebPlayer.jsx @@ -1,19 +1,20 @@ import { lazy, Component, Suspense } from 'react' import { - Client, Name, + Client, SmartCollectionVariant, Status, - Theme, - StringKeys, + Theme +} from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { accountSelectors, ExploreCollectionsVariant, - themeSelectors, themeActions, - UploadType, - FeatureFlags -} from '@audius/common' + themeSelectors, + UploadType +} from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' import { matchPath } from 'react-router' diff --git a/packages/web/src/assets/styles/index.css b/packages/web/src/assets/styles/index.css index 6e767ff880f..be8ce3a5519 100644 --- a/packages/web/src/assets/styles/index.css +++ b/packages/web/src/assets/styles/index.css @@ -1,9 +1,9 @@ -@import 'assets/styles/colors.css'; -@import 'assets/styles/sizing.css'; -@import 'assets/styles/type.css'; -@import 'assets/styles/emoji.css'; -@import 'assets/styles/ant-overrides.css'; -@import 'assets/styles/shadows.css'; +@import './colors.css'; +@import './sizing.css'; +@import './type.css'; +@import './emoji.css'; +@import './ant-overrides.css'; +@import './shadows.css'; #root *, body * { diff --git a/packages/web/src/common/hooks/useModalState.ts b/packages/web/src/common/hooks/useModalState.ts index 0fc72e53b15..5d141c4fa24 100644 --- a/packages/web/src/common/hooks/useModalState.ts +++ b/packages/web/src/common/hooks/useModalState.ts @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import { modalsSelectors, modalsActions, Modals } from '@audius/common' +import { modalsSelectors, modalsActions, Modals } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from './useSelector' diff --git a/packages/web/src/common/hooks/useSelector.ts b/packages/web/src/common/hooks/useSelector.ts index fe030c43140..102d84d18a6 100644 --- a/packages/web/src/common/hooks/useSelector.ts +++ b/packages/web/src/common/hooks/useSelector.ts @@ -1,4 +1,4 @@ -import { CommonState } from '@audius/common' +import { CommonState } from '@audius/common/store' import { useSelector as untypedUseSelector, TypedUseSelectorHook diff --git a/packages/web/src/common/store/account/sagas.js b/packages/web/src/common/store/account/sagas.js index fe49f92affb..0bde0eda4e8 100644 --- a/packages/web/src/common/store/account/sagas.js +++ b/packages/web/src/common/store/account/sagas.js @@ -1,17 +1,18 @@ +import { ErrorLevel, Kind } from '@audius/common/models' import { - Kind, + FeatureFlags, + recordIP, + createUserBankIfNeeded +} from '@audius/common/services' +import { + accountActions, accountSelectors, cacheActions, profilePageActions, - accountActions, - recordIP, - solanaSelectors, - createUserBankIfNeeded, - getContext, - FeatureFlags, chatActions, - ErrorLevel -} from '@audius/common' + solanaSelectors, + getContext +} from '@audius/common/store' import { call, put, fork, select, takeEvery } from 'redux-saga/effects' import { identify } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/add-to-collection/sagas.ts b/packages/web/src/common/store/add-to-collection/sagas.ts index 3e05163dac1..63a8019a696 100644 --- a/packages/web/src/common/store/add-to-collection/sagas.ts +++ b/packages/web/src/common/store/add-to-collection/sagas.ts @@ -1,8 +1,8 @@ import { accountActions, - modalsActions, - addToCollectionUIActions as actions -} from '@audius/common' + addToCollectionUIActions as actions, + modalsActions +} from '@audius/common/store' import { takeEvery, put } from 'redux-saga/effects' import { requiresAccount } from 'common/utils/requiresAccount' diff --git a/packages/web/src/common/store/analytics/actions.ts b/packages/web/src/common/store/analytics/actions.ts index c005392865a..bbae4e14224 100644 --- a/packages/web/src/common/store/analytics/actions.ts +++ b/packages/web/src/common/store/analytics/actions.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { Name, AllTrackingEvents } from '@audius/common' +import { Name, AllTrackingEvents } from '@audius/common/models' import { useDispatch as useDispatchRedux } from 'react-redux' /** UI EVENTS */ diff --git a/packages/web/src/common/store/analytics/sagas.ts b/packages/web/src/common/store/analytics/sagas.ts index 9848fc716b7..b5f2e128384 100644 --- a/packages/web/src/common/store/analytics/sagas.ts +++ b/packages/web/src/common/store/analytics/sagas.ts @@ -1,4 +1,4 @@ -import { getContext } from '@audius/common' +import { getContext } from '@audius/common/store' import { omit } from 'lodash' import { takeEvery, call } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/backend/sagas.ts b/packages/web/src/common/store/backend/sagas.ts index 00d9de31b40..1350fa60712 100644 --- a/packages/web/src/common/store/backend/sagas.ts +++ b/packages/web/src/common/store/backend/sagas.ts @@ -1,9 +1,9 @@ import { + accountActions, reachabilityActions, reachabilitySelectors, - getContext, - accountActions -} from '@audius/common' + getContext +} from '@audius/common/store' import { put, all, diff --git a/packages/web/src/common/store/cache/collections/addTrackToPlaylistSaga.ts b/packages/web/src/common/store/cache/collections/addTrackToPlaylistSaga.ts index f60e4c91644..8b0f179234d 100644 --- a/packages/web/src/common/store/cache/collections/addTrackToPlaylistSaga.ts +++ b/packages/web/src/common/store/cache/collections/addTrackToPlaylistSaga.ts @@ -1,24 +1,23 @@ +import { Name, Kind, Collection, ID } from '@audius/common/models' import { - Name, - Kind, - makeKindId, - makeUid, - cacheCollectionsSelectors, cacheCollectionsActions, - PlaylistOperations, + cacheCollectionsSelectors, + cacheTracksSelectors, cacheActions, - getContext, + PlaylistOperations, + reformatCollection, audioRewardsPageActions, - Collection, - Nullable, - ID, - cacheTracksSelectors, - updatePlaylistArtwork, + toastActions, + getContext, confirmerActions, - confirmTransaction, - reformatCollection, - toastActions -} from '@audius/common' + confirmTransaction +} from '@audius/common/store' +import { + makeUid, + makeKindId, + updatePlaylistArtwork, + Nullable +} from '@audius/common/utils' import { call, put, select, takeEvery } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/cache/collections/commonSagas.ts b/packages/web/src/common/store/cache/collections/commonSagas.ts index de57a503284..ffdc0936180 100644 --- a/packages/web/src/common/store/cache/collections/commonSagas.ts +++ b/packages/web/src/common/store/cache/collections/commonSagas.ts @@ -2,38 +2,42 @@ import { Name, DefaultSizes, Kind, - makeKindId, - squashNewLines, - accountSelectors, + PlaylistContents, + ID, + Collection, + PlaylistTrackId, + UserCollectionMetadata, + User, + UserFollowees, + FolloweeRepost, + UID +} from '@audius/common/models' +import { TransactionReceipt } from '@audius/common/services' +import { accountActions, - cacheCollectionsSelectors, + accountSelectors, cacheCollectionsActions as collectionActions, + cacheCollectionsSelectors, + cacheTracksSelectors, + cacheActions, PlaylistOperations, + reformatCollection, cacheUsersSelectors, - cacheActions, - getContext, + savedPageActions, + LibraryCategory, toastActions, - updatePlaylistArtwork, - cacheTracksSelectors, - removeNullable, + getContext, confirmerActions, - LibraryCategory, confirmTransaction, - reformatCollection, - savedPageActions, - ID, - PlaylistContents, - Collection, - UserCollectionMetadata, - PlaylistTrackId, - TransactionReceipt, - User, - Entry, SubscriptionInfo, - UID, - UserFollowees, - FolloweeRepost -} from '@audius/common' + Entry +} from '@audius/common/store' +import { + squashNewLines, + removeNullable, + makeKindId, + updatePlaylistArtwork +} from '@audius/common/utils' import { all, call, diff --git a/packages/web/src/common/store/cache/collections/confirmOrderPlaylist.ts b/packages/web/src/common/store/cache/collections/confirmOrderPlaylist.ts index 528f32fbbed..a8a024e9711 100644 --- a/packages/web/src/common/store/cache/collections/confirmOrderPlaylist.ts +++ b/packages/web/src/common/store/cache/collections/confirmOrderPlaylist.ts @@ -1,15 +1,13 @@ +import { Kind, Collection, ID } from '@audius/common/models' import { - Kind, - makeKindId, cacheCollectionsActions as collectionActions, - PlaylistOperations, cacheActions, + PlaylistOperations, getContext, confirmerActions, - confirmTransaction, - Collection, - ID -} from '@audius/common' + confirmTransaction +} from '@audius/common/store' +import { makeKindId } from '@audius/common/utils' import { call, put } from 'typed-redux-saga' import { fixInvalidTracksInPlaylist } from './fixInvalidTracksInPlaylist' diff --git a/packages/web/src/common/store/cache/collections/createPlaylistRequestedSaga.ts b/packages/web/src/common/store/cache/collections/createPlaylistRequestedSaga.ts index 8f743907d4f..cd6d0ab499a 100644 --- a/packages/web/src/common/store/cache/collections/createPlaylistRequestedSaga.ts +++ b/packages/web/src/common/store/cache/collections/createPlaylistRequestedSaga.ts @@ -2,7 +2,7 @@ import { cacheCollectionsActions, cacheCollectionsSelectors, toastActions -} from '@audius/common' +} from '@audius/common/store' import { push } from 'connected-react-router' import { put, select, takeEvery } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/cache/collections/createPlaylistSaga.ts b/packages/web/src/common/store/cache/collections/createPlaylistSaga.ts index b3c0b754d17..f8f53796d61 100644 --- a/packages/web/src/common/store/cache/collections/createPlaylistSaga.ts +++ b/packages/web/src/common/store/cache/collections/createPlaylistSaga.ts @@ -1,30 +1,31 @@ import { - Collection, - CollectionMetadata, + Name, DefaultSizes, - EditPlaylistValues, - ID, Kind, - Name, - Nullable, - Track, + CollectionMetadata, + Collection, + ID, + Track +} from '@audius/common/models' +import { newCollectionMetadata } from '@audius/common/schemas' +import { accountActions, accountSelectors, - cacheUsersSelectors, - cacheActions, cacheCollectionsActions, cacheCollectionsSelectors, cacheTracksSelectors, + cacheActions, + reformatCollection, + cacheUsersSelectors, + savedPageActions, + LibraryCategory, getContext, - makeKindId, - newCollectionMetadata, confirmerActions, confirmTransaction, - RequestConfirmationError, - reformatCollection, - savedPageActions, - LibraryCategory -} from '@audius/common' + EditPlaylistValues, + RequestConfirmationError +} from '@audius/common/store' +import { makeKindId, Nullable } from '@audius/common/utils' import { call, put, select, takeLatest } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/cache/collections/errorSagas.ts b/packages/web/src/common/store/cache/collections/errorSagas.ts index 99680a1c359..3b31dba55b1 100644 --- a/packages/web/src/common/store/cache/collections/errorSagas.ts +++ b/packages/web/src/common/store/cache/collections/errorSagas.ts @@ -1,4 +1,4 @@ -import { cacheCollectionsActions } from '@audius/common' +import { cacheCollectionsActions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/common/store/cache/collections/fixInvalidTracksInPlaylist.ts b/packages/web/src/common/store/cache/collections/fixInvalidTracksInPlaylist.ts index 51210235a63..12ad1f1c950 100644 --- a/packages/web/src/common/store/cache/collections/fixInvalidTracksInPlaylist.ts +++ b/packages/web/src/common/store/cache/collections/fixInvalidTracksInPlaylist.ts @@ -1,10 +1,9 @@ +import { ID, UserCollectionMetadata } from '@audius/common/models' import { - ID, - UserCollectionMetadata, accountSelectors, cacheCollectionsSelectors, getContext -} from '@audius/common' +} from '@audius/common/store' import { call, select } from 'typed-redux-saga' import { waitForWrite } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/cache/collections/utils/addTracksFromCollections.ts b/packages/web/src/common/store/cache/collections/utils/addTracksFromCollections.ts index 710e15a91b8..ddc4b4ceb8d 100644 --- a/packages/web/src/common/store/cache/collections/utils/addTracksFromCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/addTracksFromCollections.ts @@ -1,5 +1,5 @@ +import { CollectionMetadata, UserTrackMetadata } from '@audius/common/models' // Move all to web -import { CollectionMetadata, UserTrackMetadata } from '@audius/common' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/cache/collections/utils/addUsersFromCollections.ts b/packages/web/src/common/store/cache/collections/utils/addUsersFromCollections.ts index 4397c965f1e..0f769bc64cd 100644 --- a/packages/web/src/common/store/cache/collections/utils/addUsersFromCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/addUsersFromCollections.ts @@ -1,12 +1,11 @@ +import { Kind, UserCollectionMetadata } from '@audius/common/models' import { - UserCollectionMetadata, - Kind, - makeUid, accountSelectors, cacheActions, - getContext, - reformatUser -} from '@audius/common' + reformatUser, + getContext +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { uniqBy } from 'lodash' import { put, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/cache/collections/utils/getUnclaimedPlaylistId.ts b/packages/web/src/common/store/cache/collections/utils/getUnclaimedPlaylistId.ts index 0d7d07853e9..e9009348f15 100644 --- a/packages/web/src/common/store/cache/collections/utils/getUnclaimedPlaylistId.ts +++ b/packages/web/src/common/store/cache/collections/utils/getUnclaimedPlaylistId.ts @@ -1,4 +1,5 @@ -import { decodeHashId, getContext } from '@audius/common' +import { getContext } from '@audius/common/store' +import { decodeHashId } from '@audius/common/utils' import { call } from 'typed-redux-saga' export function* getUnclaimedPlaylistId() { diff --git a/packages/web/src/common/store/cache/collections/utils/optimisticUpdateCollection.ts b/packages/web/src/common/store/cache/collections/utils/optimisticUpdateCollection.ts index 6f22c536bc9..2f19ea89689 100644 --- a/packages/web/src/common/store/cache/collections/utils/optimisticUpdateCollection.ts +++ b/packages/web/src/common/store/cache/collections/utils/optimisticUpdateCollection.ts @@ -1,4 +1,5 @@ -import { Collection, Kind, cacheActions } from '@audius/common' +import { Kind, Collection } from '@audius/common/models' +import { cacheActions } from '@audius/common/store' import { put } from 'typed-redux-saga' export function* optimisticUpdateCollection(collection: Collection) { diff --git a/packages/web/src/common/store/cache/collections/utils/processAndCacheCollections.ts b/packages/web/src/common/store/cache/collections/utils/processAndCacheCollections.ts index 08f6277b466..86752493f5f 100644 --- a/packages/web/src/common/store/cache/collections/utils/processAndCacheCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/processAndCacheCollections.ts @@ -1,13 +1,15 @@ import { - ID, Kind, - makeUid, + CollectionMetadata, UserCollectionMetadata, + ID +} from '@audius/common/models' +import { cacheActions, - getContext, - CollectionMetadata, - reformatCollection -} from '@audius/common' + reformatCollection, + getContext +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { put, call } from 'redux-saga/effects' import { addTracksFromCollections } from './addTracksFromCollections' diff --git a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts index a2734ad3069..6256e205536 100644 --- a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts @@ -1,19 +1,20 @@ import { - ID, - Collection, + Kind, CollectionMetadata, + Collection, UserCollectionMetadata, - Kind, - Nullable, - makeUid, + ID +} from '@audius/common/models' +import { accountSelectors, + cacheCollectionsActions, cacheCollectionsSelectors, cacheSelectors, - CommonState, + reformatCollection, getContext, - cacheCollectionsActions, - reformatCollection -} from '@audius/common' + CommonState +} from '@audius/common/store' +import { makeUid, Nullable } from '@audius/common/utils' import { chunk } from 'lodash' import { all, call, select, put } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/cache/sagas.ts b/packages/web/src/common/store/cache/sagas.ts index 87cd98b0eba..d731207b4f2 100644 --- a/packages/web/src/common/store/cache/sagas.ts +++ b/packages/web/src/common/store/cache/sagas.ts @@ -1,24 +1,20 @@ +import { Status } from '@audius/common/models' +import type { ID, Kind, Cache } from '@audius/common/models' +import { IntKeys, FeatureFlags } from '@audius/common/services' import { - Status, - makeUids, - getIdFromKindId, cacheActions, - cacheSelectors, cacheConfig, - FeatureFlags, + cacheSelectors, confirmerSelectors, - IntKeys, getContext -} from '@audius/common' +} from '@audius/common/store' import type { - ID, - Kind, Metadata, - Cache, Entry, SubscriberInfo, CacheType -} from '@audius/common' +} from '@audius/common/store' +import { makeUids, getIdFromKindId } from '@audius/common/utils' import { pick } from 'lodash' import { all, call, put, select, takeEvery } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/cache/store.test.js b/packages/web/src/common/store/cache/store.test.js index ae9cb39b728..7448cbd73f9 100644 --- a/packages/web/src/common/store/cache/store.test.js +++ b/packages/web/src/common/store/cache/store.test.js @@ -1,12 +1,11 @@ -/* eslint-disable no-import-assign */ +import { Kind, Status } from '@audius/common/models' import { cacheActions as actions, - cacheReducer, - Kind, - makeKindId, - Status, - cacheConfig as config -} from '@audius/common' + cacheConfig as config, + cacheReducer +} from '@audius/common/store' +import { makeKindId } from '@audius/common/utils' +/* eslint-disable no-import-assign */ import { combineReducers } from 'redux' import { expectSaga } from 'redux-saga-test-plan' import { describe, it, expect, vitest } from 'vitest' diff --git a/packages/web/src/common/store/cache/tracks/sagaHelpers.ts b/packages/web/src/common/store/cache/tracks/sagaHelpers.ts index 29ad476ed31..afde7d21913 100644 --- a/packages/web/src/common/store/cache/tracks/sagaHelpers.ts +++ b/packages/web/src/common/store/cache/tracks/sagaHelpers.ts @@ -1,13 +1,13 @@ import { Name, - Track, TrackAccessType, - accountSelectors, isContentCollectibleGated, isContentFollowGated, isContentTipGated, - isContentUSDCPurchaseGated -} from '@audius/common' + isContentUSDCPurchaseGated, + Track +} from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { put, select } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/cache/tracks/sagas.js b/packages/web/src/common/store/cache/tracks/sagas.js new file mode 100644 index 00000000000..fd5a11e15b7 --- /dev/null +++ b/packages/web/src/common/store/cache/tracks/sagas.js @@ -0,0 +1,413 @@ +import { Name, DefaultSizes, SquareSizes, Kind } from '@audius/common/models' +import { + accountSelectors, + averageColorActions, + cacheTracksActions as trackActions, + cacheTracksSelectors, + cacheActions, + cacheUsersSelectors, + confirmerActions, + confirmTransaction +} from '@audius/common/store' +import { + formatUrlName, + squashNewLines, + makeKindId, + waitForValue, + waitForAccount +} from '@audius/common/utils' +import { + call, + fork, + getContext, + put, + select, + takeEvery +} from 'redux-saga/effects' + +import { make } from 'common/store/analytics/actions' +import { fetchUsers } from 'common/store/cache/users/sagas' +import * as signOnActions from 'common/store/pages/signon/actions' +import { updateProfileAsync } from 'common/store/profile/sagas' +import { processTracksForUpload } from 'common/store/upload/sagaHelpers' +import { dominantColor } from 'utils/imageProcessingUtil' +import { waitForWrite } from 'utils/sagaHelpers' + +import { recordEditTrackAnalytics } from './sagaHelpers' + +const { getUser } = cacheUsersSelectors +const { getTrack } = cacheTracksSelectors +const setDominantColors = averageColorActions.setDominantColors +const { getAccountUser, getUserId, getUserHandle } = accountSelectors + +function* fetchRepostInfo(entries) { + const userIds = [] + entries.forEach((entry) => { + if (entry.metadata.followee_reposts) { + entry.metadata.followee_reposts.forEach((repost) => + userIds.push(repost.user_id) + ) + } + }) + + if (userIds.length) { + yield call(fetchUsers, userIds) + } +} + +function* watchAdd() { + yield takeEvery(cacheActions.ADD_SUCCEEDED, function* (action) { + if (action.kind === Kind.TRACKS) { + const isNativeMobile = yield getContext('isNativeMobile') + if (!isNativeMobile) { + yield fork(fetchRepostInfo, action.entries) + } + } + }) +} + +export function* trackNewRemixEvent(remixTrack) { + yield waitForAccount() + const account = yield select(getAccountUser) + const remixParentTrack = remixTrack.remix_of.tracks[0] + const parentTrack = yield select(getTrack, { + id: remixParentTrack.parent_track_id + }) + const parentTrackUser = parentTrack + ? yield select(getUser, { id: parentTrack.owner_id }) + : null + yield put( + make(Name.REMIX_NEW_REMIX, { + id: remixTrack.track_id, + handle: account.handle, + title: remixTrack.title, + parent_track_id: remixParentTrack.parent_track_id, + parent_track_title: parentTrack ? parentTrack.title : '', + parent_track_user_handle: parentTrackUser ? parentTrackUser.handle : '' + }) + ) +} + +function* editTrackAsync(action) { + yield call(waitForWrite) + action.formFields.description = squashNewLines(action.formFields.description) + + const currentTrack = yield select(getTrack, { id: action.trackId }) + const wasDownloadable = + currentTrack.is_downloadable || + (currentTrack.download && currentTrack.download.is_downloadable) + const isNowDownloadable = + action.formFields.is_downloadable || + (action.formFields.download && action.formFields.download.is_downloadable) + + const isPublishing = currentTrack._is_publishing + const wasUnlisted = currentTrack.is_unlisted + const isNowListed = !action.formFields.is_unlisted + + if (!isPublishing && wasUnlisted && isNowListed) { + yield put( + cacheActions.update(Kind.TRACKS, [ + { + id: action.trackId, + metadata: { _is_publishing: true } + } + ]) + ) + } + + const [{ metadata: trackForEdit }] = yield processTracksForUpload([ + { metadata: action.formFields } + ]) + + yield call( + confirmEditTrack, + action.trackId, + trackForEdit, + wasDownloadable, + isNowDownloadable, + wasUnlisted, + isNowListed, + currentTrack + ) + + const track = { ...trackForEdit } + track.track_id = action.trackId + if (track.artwork?.file) { + track._cover_art_sizes = { + ...track._cover_art_sizes, + [DefaultSizes.OVERRIDE]: track.artwork.url + } + } + + yield put( + cacheActions.update(Kind.TRACKS, [{ id: track.track_id, metadata: track }]) + ) + yield put(trackActions.editTrackSucceeded()) + + // This is a new remix + if ( + track?.remix_of?.tracks?.[0]?.parent_track_id && + currentTrack?.remix_of?.tracks?.[0]?.parent_track_id !== + track?.remix_of?.tracks?.[0]?.parent_track_id + ) { + // This is a new remix + yield call(trackNewRemixEvent, track) + } +} + +function* confirmEditTrack( + trackId, + formFields, + wasDownloadable, + isNowDownloadable, + wasUnlisted, + isNowListed, + currentTrack +) { + yield waitForWrite() + const audiusBackendInstance = yield getContext('audiusBackendInstance') + const apiClient = yield getContext('apiClient') + const transcodePreview = + formFields.preview_start_seconds !== null && + currentTrack.preview_start_seconds !== formFields.preview_start_seconds + yield put( + confirmerActions.requestConfirmation( + makeKindId(Kind.TRACKS, trackId), + function* () { + const { blockHash, blockNumber } = yield call( + audiusBackendInstance.updateTrack, + trackId, + { ...formFields }, + transcodePreview + ) + + const confirmed = yield call(confirmTransaction, blockHash, blockNumber) + if (!confirmed) { + throw new Error( + `Could not confirm edit track for track id ${trackId}` + ) + } + + yield waitForAccount() + // Need to poll with the new track name in case it changed + const userId = yield select(getUserId) + const handle = yield select(getUserHandle) + + return yield apiClient.getTrack( + { + id: trackId, + currentUserId: userId, + unlistedArgs: { + urlTitle: formatUrlName(formFields.title), + handle + } + }, + /* retry */ false + ) + }, + function* (confirmedTrack) { + if (wasUnlisted && isNowListed) { + confirmedTrack._is_publishing = false + } + // Update the cached track so it no longer contains image upload artifacts + const { artwork: ignoredArtwork, ...metadata } = confirmedTrack + yield put( + cacheActions.update(Kind.TRACKS, [ + { + id: confirmedTrack.track_id, + metadata + } + ]) + ) + yield call(recordEditTrackAnalytics, currentTrack, confirmedTrack) + }, + function* () { + yield put(trackActions.editTrackFailed()) + // Throw so the user can't capture a bad upload state (especially for downloads). + // TODO: Consider better update revesion logic here coupled with a toast or similar. + throw new Error('Edit track failed') + } + ) + ) +} + +function* watchEditTrack() { + yield takeEvery(trackActions.EDIT_TRACK, editTrackAsync) +} + +function* deleteTrackAsync(action) { + const audiusBackendInstance = yield getContext('audiusBackendInstance') + yield waitForWrite() + const userId = yield select(getUserId) + if (!userId) { + yield put(signOnActions.openSignOn(false)) + return + } + const handle = yield select(getUserHandle) + + // Before deleting, check if the track is set as the artist pick & delete if so + const socials = yield call(audiusBackendInstance.getSocialHandles, handle) + if (socials.pinnedTrackId === action.trackId) { + yield put( + cacheActions.update(Kind.USERS, [ + { + id: userId, + metadata: { + artist_pick_track_id: null + } + } + ]) + ) + const user = yield call(waitForValue, getUser, { id: userId }) + yield fork(updateProfileAsync, { metadata: user }) + } + + const track = yield select(getTrack, { id: action.trackId }) + yield put( + cacheActions.update(Kind.TRACKS, [ + { id: track.track_id, metadata: { _marked_deleted: true } } + ]) + ) + + yield call(confirmDeleteTrack, track.track_id) +} + +function* confirmDeleteTrack(trackId) { + yield waitForWrite() + const audiusBackendInstance = yield getContext('audiusBackendInstance') + const apiClient = yield getContext('apiClient') + yield put( + confirmerActions.requestConfirmation( + makeKindId(Kind.TRACKS, trackId), + function* () { + const { blockHash, blockNumber } = yield call( + audiusBackendInstance.deleteTrack, + trackId + ) + + const confirmed = yield call(confirmTransaction, blockHash, blockNumber) + if (!confirmed) { + throw new Error( + `Could not confirm delete track for track id ${trackId}` + ) + } + + const track = yield select(getTrack, { id: trackId }) + const handle = yield select(getUserHandle) + yield waitForAccount() + const userId = yield select(getUserId) + + return yield apiClient.getTrack( + { + id: trackId, + currentUserId: userId, + unlistedArgs: { + urlTitle: formatUrlName(track.title), + handle + } + }, + /* retry */ false + ) + }, + function* (deletedTrack) { + // NOTE: we do not delete from the cache as the track may be playing + yield put(trackActions.deleteTrackSucceeded(deletedTrack.track_id)) + + // Record Delete Event + const event = make(Name.DELETE, { + kind: 'track', + id: deletedTrack.trackId + }) + yield put(event) + if (deletedTrack.stem_of) { + const stemDeleteEvent = make(Name.STEM_DELETE, { + id: deletedTrack.track_id, + parent_track_id: deletedTrack.stem_of.parent_track_id, + category: deletedTrack.stem_of.category + }) + yield put(stemDeleteEvent) + } + }, + function* () { + // On failure, do not mark the track as deleted + yield put( + cacheActions.update(Kind.TRACKS, [ + { id: trackId, metadata: { _marked_deleted: false } } + ]) + ) + } + ) + ) +} + +function* watchDeleteTrack() { + yield takeEvery(trackActions.DELETE_TRACK, deleteTrackAsync) +} + +function* watchFetchCoverArt() { + const audiusBackendInstance = yield getContext('audiusBackendInstance') + const isNativeMobile = yield getContext('isNativeMobile') + + const inProgress = new Set() + yield takeEvery(trackActions.FETCH_COVER_ART, function* ({ trackId, size }) { + // Unique on id and size + const key = `${trackId}-${size}` + if (inProgress.has(key)) return + inProgress.add(key) + + try { + let track = yield call(waitForValue, getTrack, { id: trackId }) + const user = yield call(waitForValue, getUser, { id: track.owner_id }) + if (!track || !user || (!track.cover_art_sizes && !track.cover_art)) + return + const multihash = track.cover_art_sizes || track.cover_art + const coverArtSize = multihash === track.cover_art_sizes ? size : null + const url = yield call( + audiusBackendInstance.getImageUrl, + multihash, + coverArtSize, + track.cover_art_cids + ) + track = yield select(getTrack, { id: trackId }) + track._cover_art_sizes = { + ...track._cover_art_sizes, + [coverArtSize || DefaultSizes.OVERRIDE]: url + } + yield put( + cacheActions.update(Kind.TRACKS, [{ id: trackId, metadata: track }]) + ) + + let smallImageUrl = url + if (coverArtSize !== SquareSizes.SIZE_150_BY_150) { + smallImageUrl = yield call( + audiusBackendInstance.getImageUrl, + multihash, + SquareSizes.SIZE_150_BY_150 + ) + } + + if (!isNativeMobile) { + // Disabling dominant color fetch on mobile because it requires WebWorker + // Can revisit this when doing glass morphism on NowPlaying + const dominantColors = yield call(dominantColor, smallImageUrl) + + yield put( + setDominantColors({ + multihash, + colors: dominantColors + }) + ) + } + } catch (e) { + console.error(`Unable to fetch cover art for track ${trackId}`) + } finally { + inProgress.delete(key) + } + }) +} + +const sagas = () => { + return [watchAdd, watchEditTrack, watchDeleteTrack, watchFetchCoverArt] +} + +export default sagas diff --git a/packages/web/src/common/store/cache/tracks/sagas.ts b/packages/web/src/common/store/cache/tracks/sagas.ts index 940c2264ee4..bcc5d221ed0 100644 --- a/packages/web/src/common/store/cache/tracks/sagas.ts +++ b/packages/web/src/common/store/cache/tracks/sagas.ts @@ -3,26 +3,30 @@ import { DefaultSizes, SquareSizes, Kind, - makeKindId, - squashNewLines, - formatUrlName, + Track, + Collection, + ID +} from '@audius/common/models' +import { + Entry, + ExtendedTrackMetadata, + getContext, accountSelectors, averageColorActions, cacheTracksSelectors, cacheTracksActions as trackActions, cacheUsersSelectors, cacheActions, - waitForAccount, - waitForValue, confirmerActions, - confirmTransaction, - Track, - Entry, - Collection, - ID, - ExtendedTrackMetadata, - getContext -} from '@audius/common' + confirmTransaction +} from '@audius/common/store' +import { + makeKindId, + squashNewLines, + formatUrlName, + waitForAccount, + waitForValue +} from '@audius/common/utils' import { call, fork, put, select, takeEvery } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts index af73a21980b..823915dc6f7 100644 --- a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts +++ b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts @@ -1,14 +1,11 @@ +import { Kind, ID, UserTrackMetadata } from '@audius/common/models' import { - ID, - Kind, - UserTrackMetadata, - removeNullable, accountSelectors, cacheTracksSelectors, cacheActions, - getContext, - waitForValue -} from '@audius/common' + getContext +} from '@audius/common/store' +import { removeNullable, waitForValue } from '@audius/common/utils' import { select, call, put } from 'typed-redux-saga' import { waitForRead } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts index eef151909ae..2eb950e5aa1 100644 --- a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts +++ b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts @@ -1,14 +1,16 @@ import { - ID, Kind, StemCategory, + ID, Stem, - StemTrackMetadata, + StemTrackMetadata +} from '@audius/common/models' +import { cacheTracksSelectors, cacheActions, - getContext, - waitForValue -} from '@audius/common' + getContext +} from '@audius/common/store' +import { waitForValue } from '@audius/common/utils' import { call, put } from 'redux-saga/effects' import { waitForRead } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/cache/tracks/utils/helpers.ts b/packages/web/src/common/store/cache/tracks/utils/helpers.ts index 440f595d93f..21daba5aa11 100644 --- a/packages/web/src/common/store/cache/tracks/utils/helpers.ts +++ b/packages/web/src/common/store/cache/tracks/utils/helpers.ts @@ -1,13 +1,11 @@ +import { Kind, TrackMetadata, User } from '@audius/common/models' import { - Kind, - TrackMetadata, - User, - makeUid, accountSelectors, cacheActions, - getContext, - reformatUser -} from '@audius/common' + reformatUser, + getContext +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { uniqBy } from 'lodash' import { put, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/cache/tracks/utils/processAndCacheTracks.ts b/packages/web/src/common/store/cache/tracks/utils/processAndCacheTracks.ts index c4520e1fd7f..208eb05ec97 100644 --- a/packages/web/src/common/store/cache/tracks/utils/processAndCacheTracks.ts +++ b/packages/web/src/common/store/cache/tracks/utils/processAndCacheTracks.ts @@ -1,11 +1,6 @@ -import { - Kind, - Track, - TrackMetadata, - makeUid, - cacheActions, - getContext -} from '@audius/common' +import { Kind, TrackMetadata, Track } from '@audius/common/models' +import { cacheActions, getContext } from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { put, call } from 'typed-redux-saga' import { waitForRead } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/cache/tracks/utils/reformat.ts b/packages/web/src/common/store/cache/tracks/utils/reformat.ts index 0444fb222f4..d6e3ebfe2f4 100644 --- a/packages/web/src/common/store/cache/tracks/utils/reformat.ts +++ b/packages/web/src/common/store/cache/tracks/utils/reformat.ts @@ -1,4 +1,5 @@ -import { Track, TrackMetadata, AudiusBackend } from '@audius/common' +import { TrackMetadata, Track } from '@audius/common/models' +import { AudiusBackend } from '@audius/common/services' import { omit } from 'lodash' /** diff --git a/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts b/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts index a5bf41b90b6..29afb2b8a77 100644 --- a/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts +++ b/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts @@ -1,18 +1,20 @@ import { - ID, Kind, - Track, + ID, TrackMetadata, - UserTrackMetadata, + Track, + UserTrackMetadata +} from '@audius/common/models' +import { accountSelectors, - CommonState, - getContext, - cacheSelectors, - cacheTracksSelectors, cacheTracksActions, + cacheTracksSelectors, + cacheSelectors, + trackPageActions, trackPageSelectors, - trackPageActions -} from '@audius/common' + getContext, + CommonState +} from '@audius/common/store' import { call, put, select, spawn } from 'typed-redux-saga' import { retrieve } from 'common/store/cache/sagas' diff --git a/packages/web/src/common/store/cache/users/sagas.d.ts b/packages/web/src/common/store/cache/users/sagas.d.ts index 22ca8fcd94a..28c11a53f72 100644 --- a/packages/web/src/common/store/cache/users/sagas.d.ts +++ b/packages/web/src/common/store/cache/users/sagas.d.ts @@ -1,4 +1,4 @@ -import type { User, UID } from '@audius/common' +import type { User, UID } from '@audius/common/models' export declare function* adjustUserField(config: { user: User fieldName: string diff --git a/packages/web/src/common/store/cache/users/sagas.js b/packages/web/src/common/store/cache/users/sagas.js index ca226726e58..22a6ca2c418 100644 --- a/packages/web/src/common/store/cache/users/sagas.js +++ b/packages/web/src/common/store/cache/users/sagas.js @@ -1,15 +1,13 @@ +import { DefaultSizes, Kind } from '@audius/common/models' import { - DefaultSizes, - Kind, accountSelectors, + cacheUsersActions as userActions, cacheActions, - cacheUsersSelectors, cacheReducer, - cacheUsersActions as userActions, - waitForValue, - waitForAccount, - reformatUser -} from '@audius/common' + reformatUser, + cacheUsersSelectors +} from '@audius/common/store' +import { waitForValue, waitForAccount } from '@audius/common/utils' import { mergeWith } from 'lodash' import { call, put, select, takeEvery, getContext } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/cache/users/utils/pruneBlobValues.ts b/packages/web/src/common/store/cache/users/utils/pruneBlobValues.ts index de257d04e94..8bc4d56c441 100644 --- a/packages/web/src/common/store/cache/users/utils/pruneBlobValues.ts +++ b/packages/web/src/common/store/cache/users/utils/pruneBlobValues.ts @@ -1,4 +1,4 @@ -import { SquareSizes, WidthSizes, User } from '@audius/common' +import { SquareSizes, WidthSizes, User } from '@audius/common/models' /** * Prunes blob url values off of a user. diff --git a/packages/web/src/common/store/change-password/sagas.ts b/packages/web/src/common/store/change-password/sagas.ts index bf0e428645b..d7b7614d7a9 100644 --- a/packages/web/src/common/store/change-password/sagas.ts +++ b/packages/web/src/common/store/change-password/sagas.ts @@ -1,4 +1,5 @@ -import { Name, changePasswordActions, getContext } from '@audius/common' +import { Name } from '@audius/common/models' +import { changePasswordActions, getContext } from '@audius/common/store' import { call, put, takeEvery } from 'typed-redux-saga' import { make, TrackEvent } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/lineup/sagas.d.ts b/packages/web/src/common/store/lineup/sagas.d.ts index 8cd56cf708b..90ac65526fc 100644 --- a/packages/web/src/common/store/lineup/sagas.d.ts +++ b/packages/web/src/common/store/lineup/sagas.d.ts @@ -1,9 +1,5 @@ -import { - Collection, - LineupBaseActions, - LineupState, - LineupTrack -} from '@audius/common' +import { Collection, LineupState, LineupTrack } from '@audius/common/models' +import { LineupBaseActions } from '@audius/common/store' export class LineupSagas { constructor( diff --git a/packages/web/src/common/store/lineup/sagas.ts b/packages/web/src/common/store/lineup/sagas.ts index 626cab6436b..2d5e2933414 100644 --- a/packages/web/src/common/store/lineup/sagas.ts +++ b/packages/web/src/common/store/lineup/sagas.ts @@ -1,37 +1,35 @@ import { - Kind, Name, - makeUid, - makeUids, - Uid, + Kind, + isContentUSDCPurchaseGated, + LineupEntry, + Track, + Collection, + UID, + LineupState, + CollectionMetadata +} from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { + accountSelectors, cacheCollectionsSelectors, cacheTracksSelectors, cacheActions, cacheUsersSelectors, lineupActions as baseLineupActions, + premiumTracksPageLineupActions, queueActions, - playerSelectors, queueSelectors, getContext, - FeatureFlags, - isContentUSDCPurchaseGated, - StringKeys, - premiumTracksPageLineupActions, - accountSelectors, - LineupBaseActions, - LineupEntry, - LineupState, - Track, - UID, + playerSelectors, SubscriberInfo, - Collection, - CollectionMetadata, - Entry, SubscriptionInfo, - removeNullable, + Entry, + LineupBaseActions, QueueSource, UnsubscribeInfo -} from '@audius/common' +} from '@audius/common/store' +import { Uid, makeUids, makeUid, removeNullable } from '@audius/common/utils' import { all, call, diff --git a/packages/web/src/common/store/notifications/checkForNewNotificationsSaga.ts b/packages/web/src/common/store/notifications/checkForNewNotificationsSaga.ts index 7d74c37bb5f..441ef6264c0 100644 --- a/packages/web/src/common/store/notifications/checkForNewNotificationsSaga.ts +++ b/packages/web/src/common/store/notifications/checkForNewNotificationsSaga.ts @@ -1,11 +1,11 @@ import { accountSelectors, - Notification, notificationsActions, notificationsSelectors, NotificationType, - walletActions -} from '@audius/common' + walletActions, + Notification +} from '@audius/common/store' import { Dictionary } from '@reduxjs/toolkit' import { call, put, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/notifications/errorSagas.ts b/packages/web/src/common/store/notifications/errorSagas.ts index 08043e26c8b..9d3adcb1528 100644 --- a/packages/web/src/common/store/notifications/errorSagas.ts +++ b/packages/web/src/common/store/notifications/errorSagas.ts @@ -1,8 +1,8 @@ +import { ErrorLevel } from '@audius/common/models' import { notificationsActions, - ErrorLevel, FetchNotificationsFailedAction -} from '@audius/common' +} from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/notifications/fetchNotifications.ts b/packages/web/src/common/store/notifications/fetchNotifications.ts index 90ad5d62bd6..9dc7dbd50d0 100644 --- a/packages/web/src/common/store/notifications/fetchNotifications.ts +++ b/packages/web/src/common/store/notifications/fetchNotifications.ts @@ -1,9 +1,6 @@ -import { - FeatureFlags, - getContext, - IntKeys, - removeNullable -} from '@audius/common' +import { IntKeys, FeatureFlags } from '@audius/common/services' +import { getContext } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { partition } from 'lodash' import { call } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/notifications/fetchNotificationsSaga.ts b/packages/web/src/common/store/notifications/fetchNotificationsSaga.ts index 988e73151bc..190d9070e14 100644 --- a/packages/web/src/common/store/notifications/fetchNotificationsSaga.ts +++ b/packages/web/src/common/store/notifications/fetchNotificationsSaga.ts @@ -1,9 +1,9 @@ import { - FetchNotificationsAction, - getErrorMessage, notificationsActions, - notificationsSelectors -} from '@audius/common' + notificationsSelectors, + FetchNotificationsAction +} from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { call, put, select, takeEvery } from 'typed-redux-saga' import { NOTIFICATION_LIMIT_DEFAULT } from './constants' diff --git a/packages/web/src/common/store/notifications/parseAndProcessNotifications.ts b/packages/web/src/common/store/notifications/parseAndProcessNotifications.ts index 3a9979d7149..860f5820a11 100644 --- a/packages/web/src/common/store/notifications/parseAndProcessNotifications.ts +++ b/packages/web/src/common/store/notifications/parseAndProcessNotifications.ts @@ -1,16 +1,13 @@ +import { ID, Remix, Track } from '@audius/common/models' import { - ID, - waitForRead, - Notification, + accountSelectors, NotificationType, Entity, - reactionsUIActions, - waitForAccount, - Track, Achievement, - Remix, - accountSelectors -} from '@audius/common' + reactionsUIActions, + Notification +} from '@audius/common/store' +import { waitForAccount, waitForRead } from '@audius/common/utils' import moment from 'moment' import { all, call, put, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/notifications/refreshNotificationsSaga.ts b/packages/web/src/common/store/notifications/refreshNotificationsSaga.ts index 43df3b2b147..03670978eb1 100644 --- a/packages/web/src/common/store/notifications/refreshNotificationsSaga.ts +++ b/packages/web/src/common/store/notifications/refreshNotificationsSaga.ts @@ -1,4 +1,5 @@ -import { getErrorMessage, notificationsActions } from '@audius/common' +import { notificationsActions } from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { call, put, takeLatest } from 'typed-redux-saga' import { NOTIFICATION_LIMIT_DEFAULT } from './constants' diff --git a/packages/web/src/common/store/notifications/sagas.ts b/packages/web/src/common/store/notifications/sagas.ts index 0120ef37ff4..084db68ba94 100644 --- a/packages/web/src/common/store/notifications/sagas.ts +++ b/packages/web/src/common/store/notifications/sagas.ts @@ -1,10 +1,9 @@ import { IntKeys, remoteConfigIntDefaults, - RemoteConfigInstance, - getContext, - notificationsActions -} from '@audius/common' + RemoteConfigInstance +} from '@audius/common/services' +import { notificationsActions, getContext } from '@audius/common/store' import { call, takeEvery } from 'typed-redux-saga' import { waitForWrite } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/pages/ai/lineups/tracks/sagas.ts b/packages/web/src/common/store/pages/ai/lineups/tracks/sagas.ts index 6c6f8c9da9f..c36f5477c9f 100644 --- a/packages/web/src/common/store/pages/ai/lineups/tracks/sagas.ts +++ b/packages/web/src/common/store/pages/ai/lineups/tracks/sagas.ts @@ -1,12 +1,12 @@ +import { Track } from '@audius/common/models' import { accountSelectors, aiPageLineupActions as tracksActions, aiPageActions, aiPageSelectors, getContext, - CommonState, - Track -} from '@audius/common' + CommonState +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/pages/ai/sagas.ts b/packages/web/src/common/store/pages/ai/sagas.ts index bfc9608fea4..594b4c55596 100644 --- a/packages/web/src/common/store/pages/ai/sagas.ts +++ b/packages/web/src/common/store/pages/ai/sagas.ts @@ -1,4 +1,6 @@ -import { aiPageActions, FetchAiUserAction, Maybe, User } from '@audius/common' +import { User } from '@audius/common/models' +import { aiPageActions, FetchAiUserAction } from '@audius/common/store' +import { Maybe } from '@audius/common/utils' import { takeEvery, call, put } from 'typed-redux-saga' import { waitForRead } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/pages/audio-rewards/sagas.ts b/packages/web/src/common/store/pages/audio-rewards/sagas.ts index 9564e1968ae..d8f71196592 100644 --- a/packages/web/src/common/store/pages/audio-rewards/sagas.ts +++ b/packages/web/src/common/store/pages/audio-rewards/sagas.ts @@ -1,27 +1,30 @@ import { FailureReason, UserChallenge, - StringAudio, + StringAudio +} from '@audius/common/models' +import { IntKeys, StringKeys, - RemoteConfigInstance, - getContext, - stringAudioToStringWei, - accountSelectors, + createUserBankIfNeeded, + Env, + RemoteConfigInstance +} from '@audius/common/services' +import { accountActions, + accountSelectors, + audioRewardsPageSelectors, audioRewardsPageActions, - ClaimStatus, HCaptchaStatus, - UndisbursedUserChallenge, - audioRewardsPageSelectors, + ClaimStatus, solanaSelectors, walletActions, modalsActions, - waitForValue, - Env, + getContext, musicConfettiActions, - createUserBankIfNeeded -} from '@audius/common' + UndisbursedUserChallenge +} from '@audius/common/store' +import { stringAudioToStringWei, waitForValue } from '@audius/common/utils' import { call, fork, diff --git a/packages/web/src/common/store/pages/audio-rewards/store.test.ts b/packages/web/src/common/store/pages/audio-rewards/store.test.ts index 023f9e0eb50..944777214c5 100644 --- a/packages/web/src/common/store/pages/audio-rewards/store.test.ts +++ b/packages/web/src/common/store/pages/audio-rewards/store.test.ts @@ -1,21 +1,22 @@ import { - ChallengeRewardID, FailureReason, UserChallenge, - StringAudio, - IntKeys, - StringKeys, + ChallengeRewardID, + StringAudio +} from '@audius/common/models' +import { IntKeys, StringKeys } from '@audius/common/services' +import { accountSelectors, + audioRewardsPageSelectors, audioRewardsPageActions, - AudioRewardsClaim, - ClaimStatus, HCaptchaStatus, - audioRewardsPageSelectors, + ClaimStatus, solanaSelectors, walletActions, modalsActions, - stringAudioToStringWei -} from '@audius/common' + AudioRewardsClaim +} from '@audius/common/store' +import { stringAudioToStringWei } from '@audius/common/utils' import delayP from '@redux-saga/delay-p' import { all, fork } from 'redux-saga/effects' import { expectSaga } from 'redux-saga-test-plan' diff --git a/packages/web/src/common/store/pages/audio-transactions/sagas.ts b/packages/web/src/common/store/pages/audio-transactions/sagas.ts index 4df69be38f1..1179b26028f 100644 --- a/packages/web/src/common/store/pages/audio-transactions/sagas.ts +++ b/packages/web/src/common/store/pages/audio-transactions/sagas.ts @@ -1,15 +1,14 @@ +import { StringAudio } from '@audius/common/models' import { audioTransactionsPageActions, - TransactionDetails, - TransactionMethod, - TransactionType, - formatDate, - StringAudio, transactionDetailsActions, + TransactionType, + TransactionMethod, getContext, - Nullable -} from '@audius/common' -import type { InAppAudioPurchaseMetadata } from '@audius/common' + InAppAudioPurchaseMetadata, + TransactionDetails +} from '@audius/common/store' +import { formatDate, Nullable } from '@audius/common/utils' import { AudiusLibs, full } from '@audius/sdk' import { call, takeLatest, put } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/pages/collection/lineups/sagas.js b/packages/web/src/common/store/pages/collection/lineups/sagas.js index 201c4d24c3a..6e67893e165 100644 --- a/packages/web/src/common/store/pages/collection/lineups/sagas.js +++ b/packages/web/src/common/store/pages/collection/lineups/sagas.js @@ -1,13 +1,11 @@ +import { Kind } from '@audius/common/models' import { - Kind, - removeNullable, - Uid, smartCollectionPageSelectors, collectionPageLineupActions as tracksActions, collectionPageSelectors, - waitForValue, queueSelectors -} from '@audius/common' +} from '@audius/common/store' +import { removeNullable, Uid, waitForValue } from '@audius/common/utils' import { keyBy } from 'lodash' import moment from 'moment' import { select, call } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/pages/collection/sagas.js b/packages/web/src/common/store/pages/collection/sagas.js index d6fe2d4c412..e16003ec23c 100644 --- a/packages/web/src/common/store/pages/collection/sagas.js +++ b/packages/web/src/common/store/pages/collection/sagas.js @@ -1,12 +1,12 @@ +import { Kind } from '@audius/common/models' import { - Kind, - makeUid, cacheActions, - collectionPageActions as collectionActions, collectionPageLineupActions as tracksActions, collectionPageSelectors, + collectionPageActions as collectionActions, reachabilitySelectors -} from '@audius/common' +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { call, put, select, takeLatest, takeEvery } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/pages/deactivate-account/sagas.ts b/packages/web/src/common/store/pages/deactivate-account/sagas.ts index 0ab123c22ea..be1e44fe592 100644 --- a/packages/web/src/common/store/pages/deactivate-account/sagas.ts +++ b/packages/web/src/common/store/pages/deactivate-account/sagas.ts @@ -1,14 +1,14 @@ +import { Name } from '@audius/common/models' import { - Name, accountSelectors, - getContext, - waitForValue, - signOutActions, deactivateAccountActions, + signOutActions, + getContext, confirmerActions, - confirmTransaction, - confirmerSelectors -} from '@audius/common' + confirmerSelectors, + confirmTransaction +} from '@audius/common/store' +import { waitForValue } from '@audius/common/utils' import { call, delay, put, select, takeEvery } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/pages/explore/exploreCollections/sagas.ts b/packages/web/src/common/store/pages/explore/exploreCollections/sagas.ts index 5d7fd197f08..7175d5228d7 100644 --- a/packages/web/src/common/store/pages/explore/exploreCollections/sagas.ts +++ b/packages/web/src/common/store/pages/explore/exploreCollections/sagas.ts @@ -1,11 +1,10 @@ +import { Collection, UserCollectionMetadata } from '@audius/common/models' import { accountSelectors, - Collection, explorePageCollectionsActions, ExploreCollectionsVariant, - getContext, - UserCollectionMetadata -} from '@audius/common' + getContext +} from '@audius/common/store' import { uniq } from 'lodash' import { takeEvery, call, select, put } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/pages/explore/sagas.ts b/packages/web/src/common/store/pages/explore/sagas.ts index 52aafe23901..ceb01b2dfb7 100644 --- a/packages/web/src/common/store/pages/explore/sagas.ts +++ b/packages/web/src/common/store/pages/explore/sagas.ts @@ -1,9 +1,9 @@ +import { ID } from '@audius/common/models' import { - ID, + explorePageSelectors, explorePageActions, - getContext, - explorePageSelectors -} from '@audius/common' + getContext +} from '@audius/common/store' import { call, put, takeEvery, select } from 'typed-redux-saga' import { retrieveCollections } from 'common/store/cache/collections/utils' diff --git a/packages/web/src/common/store/pages/feed/lineup/sagas.ts b/packages/web/src/common/store/pages/feed/lineup/sagas.ts index 0f2898e19d0..084ef5bcfd0 100644 --- a/packages/web/src/common/store/pages/feed/lineup/sagas.ts +++ b/packages/web/src/common/store/pages/feed/lineup/sagas.ts @@ -1,19 +1,21 @@ import { - ID, - Collection, - UserCollectionMetadata, FeedFilter, Kind, - LineupTrack, + Collection, + UserCollectionMetadata, + ID, TrackMetadata, UserTrackMetadata, - getContext, + LineupTrack +} from '@audius/common/models' +import { GetSocialFeedArgs } from '@audius/common/services' +import { accountSelectors, feedPageLineupActions as feedActions, feedPageSelectors, - GetSocialFeedArgs, + getContext, CommonState -} from '@audius/common' +} from '@audius/common/store' import { select, all } from 'redux-saga/effects' import { processAndCacheCollections } from 'common/store/cache/collections/utils' diff --git a/packages/web/src/common/store/pages/feed/sagas.ts b/packages/web/src/common/store/pages/feed/sagas.ts index ff82607dbcd..30c90f2849c 100644 --- a/packages/web/src/common/store/pages/feed/sagas.ts +++ b/packages/web/src/common/store/pages/feed/sagas.ts @@ -1,11 +1,10 @@ +import { FollowSource, ID } from '@audius/common/models' import { - ID, - FollowSource, - getErrorMessage, feedPageLineupActions as feedActions, feedPageActions as discoverActions, usersSocialActions as socialActions -} from '@audius/common' +} from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { call, put, take, fork, takeEvery } from 'redux-saga/effects' import { fetchUsers } from 'common/store/cache/users/sagas' diff --git a/packages/web/src/common/store/pages/history/lineups/sagas.js b/packages/web/src/common/store/pages/history/lineups/sagas.js index 6a7ed76cc66..4808b4f4fc4 100644 --- a/packages/web/src/common/store/pages/history/lineups/sagas.js +++ b/packages/web/src/common/store/pages/history/lineups/sagas.js @@ -1,8 +1,8 @@ +import { Kind } from '@audius/common/models' import { - Kind, accountSelectors, historyPageTracksLineupActions as tracksActions -} from '@audius/common' +} from '@audius/common/store' import { keyBy } from 'lodash' import { call, getContext, select } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/pages/premium-tracks/lineups/tracks/sagas.ts b/packages/web/src/common/store/pages/premium-tracks/lineups/tracks/sagas.ts index 925f938e893..ee642a3bf92 100644 --- a/packages/web/src/common/store/pages/premium-tracks/lineups/tracks/sagas.ts +++ b/packages/web/src/common/store/pages/premium-tracks/lineups/tracks/sagas.ts @@ -1,10 +1,10 @@ +import { Track } from '@audius/common/models' import { accountSelectors, - premiumTracksPageLineupActions, premiumTracksPageLineupSelectors, - getContext, - Track -} from '@audius/common' + premiumTracksPageLineupActions, + getContext +} from '@audius/common/store' import { call, select } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts b/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts index 1bf1afe4118..72f625dd8bb 100644 --- a/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts +++ b/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts @@ -1,10 +1,10 @@ import { - ID, UserCollection, + ID, Track, - UserTrackMetadata, - getContext -} from '@audius/common' + UserTrackMetadata +} from '@audius/common/models' +import { getContext } from '@audius/common/store' import { all } from 'redux-saga/effects' import { processAndCacheCollections } from 'common/store/cache/collections/utils' diff --git a/packages/web/src/common/store/pages/profile/lineups/feed/sagas.js b/packages/web/src/common/store/pages/profile/lineups/feed/sagas.js index c07484d13c0..7adb9a54c38 100644 --- a/packages/web/src/common/store/pages/profile/lineups/feed/sagas.js +++ b/packages/web/src/common/store/pages/profile/lineups/feed/sagas.js @@ -1,17 +1,19 @@ +import { Kind } from '@audius/common/models' import { - Kind, - getIdFromKindId, - getKindFromKindId, accountSelectors, cacheCollectionsSelectors, cacheTracksSelectors, - profilePageSelectors, profilePageFeedLineupActions as feedActions, - tracksSocialActions, + profilePageSelectors, collectionsSocialActions, - makeUid, + tracksSocialActions, confirmerSelectors -} from '@audius/common' +} from '@audius/common/store' +import { + makeUid, + getIdFromKindId, + getKindFromKindId +} from '@audius/common/utils' import { select, call, takeEvery, put } from 'redux-saga/effects' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts b/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts index 7e28604de08..92745920853 100644 --- a/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts +++ b/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts @@ -1,4 +1,5 @@ -import { ID, Track, getContext } from '@audius/common' +import { ID, Track } from '@audius/common/models' +import { getContext } from '@audius/common/store' import { call } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/pages/profile/lineups/tracks/sagas.js b/packages/web/src/common/store/pages/profile/lineups/tracks/sagas.js index 5f08714e573..59988ba0084 100644 --- a/packages/web/src/common/store/pages/profile/lineups/tracks/sagas.js +++ b/packages/web/src/common/store/pages/profile/lineups/tracks/sagas.js @@ -1,14 +1,14 @@ +import { Kind } from '@audius/common/models' import { - Kind, + profilePageTracksLineupActions as tracksActions, accountSelectors, cacheTracksActions, cacheTracksSelectors, + profilePageTracksLineupActions as lineupActions, profilePageSelectors, TracksSortMode, - profilePageTracksLineupActions as tracksActions, - profilePageTracksLineupActions as lineupActions, tracksSocialActions -} from '@audius/common' +} from '@audius/common/store' import { call, select, takeEvery, put } from 'redux-saga/effects' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/common/store/pages/profile/lineups/tracks/watchUploadTracksSaga.ts b/packages/web/src/common/store/pages/profile/lineups/tracks/watchUploadTracksSaga.ts index 49b89cc8617..584753dcb43 100644 --- a/packages/web/src/common/store/pages/profile/lineups/tracks/watchUploadTracksSaga.ts +++ b/packages/web/src/common/store/pages/profile/lineups/tracks/watchUploadTracksSaga.ts @@ -1,12 +1,11 @@ +import { Kind, Track } from '@audius/common/models' import { accountSelectors, - Kind, - makeUid, profilePageTracksLineupActions, profilePageSelectors, - uploadActions, - Track -} from '@audius/common' + uploadActions +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { put, select, takeEvery } from 'typed-redux-saga' const { UPLOAD_TRACKS_SUCCEEDED, uploadTracksSucceeded } = uploadActions diff --git a/packages/web/src/common/store/pages/remixes-page/lineups/tracks/sagas.ts b/packages/web/src/common/store/pages/remixes-page/lineups/tracks/sagas.ts index de9a5d2c81c..07b7d8502f1 100644 --- a/packages/web/src/common/store/pages/remixes-page/lineups/tracks/sagas.ts +++ b/packages/web/src/common/store/pages/remixes-page/lineups/tracks/sagas.ts @@ -1,12 +1,12 @@ +import { Track } from '@audius/common/models' import { accountSelectors, remixesPageLineupActions as tracksActions, remixesPageActions, remixesPageSelectors, getContext, - CommonState, - Track -} from '@audius/common' + CommonState +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/pages/remixes-page/sagas.ts b/packages/web/src/common/store/pages/remixes-page/sagas.ts index 244d4613b60..434e6ff2672 100644 --- a/packages/web/src/common/store/pages/remixes-page/sagas.ts +++ b/packages/web/src/common/store/pages/remixes-page/sagas.ts @@ -1,4 +1,5 @@ -import { TrackMetadata, remixesPageActions, Track } from '@audius/common' +import { TrackMetadata, Track } from '@audius/common/models' +import { remixesPageActions } from '@audius/common/store' import { takeEvery, call, put } from 'redux-saga/effects' import { diff --git a/packages/web/src/common/store/pages/saved/lineups/sagas.js b/packages/web/src/common/store/pages/saved/lineups/sagas.js index 482a38e596a..0e2d5909323 100644 --- a/packages/web/src/common/store/pages/saved/lineups/sagas.js +++ b/packages/web/src/common/store/pages/saved/lineups/sagas.js @@ -1,21 +1,21 @@ +import { Kind } from '@audius/common/models' import { - Kind, - makeUid, cacheTracksSelectors, savedPageTracksLineupActions as savedTracksActions, savedPageActions as saveActions, savedPageSelectors, + LibraryCategory, + SavedPageTabs, queueActions, queueSelectors, - tracksSocialActions, - playerSelectors, QueueSource, + tracksSocialActions, getContext, - LibraryCategory, - SavedPageTabs, + playerSelectors, purchaseContentActions, ContentType -} from '@audius/common' +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { uniq } from 'lodash' import moment from 'moment' import { call, select, put, takeEvery } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/pages/saved/sagas.ts b/packages/web/src/common/store/pages/saved/sagas.ts index cd24cee7d27..56640635a19 100644 --- a/packages/web/src/common/store/pages/saved/sagas.ts +++ b/packages/web/src/common/store/pages/saved/sagas.ts @@ -1,22 +1,25 @@ import { - APIActivityV2, - Favorite, FavoriteType, - LibraryCategoryType, - Nullable, - User, + Favorite, UserTrackMetadata, + User +} from '@audius/common/models' +import { responseAdapter, APIActivityV2 } from '@audius/common/services' +import { accountSelectors, + savedPageTracksLineupActions as tracksActions, savedPageActions as actions, + savedPageSelectors, + getContext, + LibraryCategoryType +} from '@audius/common/store' +import { decodeHashId, encodeHashId, - getContext, removeNullable, - responseAdapter, - savedPageSelectors, - savedPageTracksLineupActions as tracksActions, - waitForValue -} from '@audius/common' + waitForValue, + Nullable +} from '@audius/common/utils' import { call, fork, put, select, takeLatest } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/pages/search-page/lineups/tracks/sagas.js b/packages/web/src/common/store/pages/search-page/lineups/tracks/sagas.js index 9677efdc4b1..b0ac07fdaa1 100644 --- a/packages/web/src/common/store/pages/search-page/lineups/tracks/sagas.js +++ b/packages/web/src/common/store/pages/search-page/lineups/tracks/sagas.js @@ -1,10 +1,10 @@ import { cacheTracksSelectors, - searchResultsPageSelectors, - SearchKind, searchResultsPageTracksLineupActions as tracksActions, - trimToAlphaNumeric -} from '@audius/common' + searchResultsPageSelectors, + SearchKind +} from '@audius/common/store' +import { trimToAlphaNumeric } from '@audius/common/utils' import { select, all, call, getContext } from 'redux-saga/effects' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/common/store/pages/search-page/sagas.js b/packages/web/src/common/store/pages/search-page/sagas.js index 537e53e68e3..16af5940f8f 100644 --- a/packages/web/src/common/store/pages/search-page/sagas.js +++ b/packages/web/src/common/store/pages/search-page/sagas.js @@ -1,13 +1,12 @@ +import { FeatureFlags } from '@audius/common/services' import { - trimToAlphaNumeric, accountSelectors, - searchResultsPageActions as searchPageActions, - searchResultsPageTracksLineupActions as tracksLineupActions, - SearchKind, processAndCacheUsers, - removeNullable, - FeatureFlags -} from '@audius/common' + searchResultsPageTracksLineupActions as tracksLineupActions, + searchResultsPageActions as searchPageActions, + SearchKind +} from '@audius/common/store' +import { trimToAlphaNumeric, removeNullable } from '@audius/common/utils' import { flatMap, zip } from 'lodash' import { select, diff --git a/packages/web/src/common/store/pages/settings/errorSagas.ts b/packages/web/src/common/store/pages/settings/errorSagas.ts index dc8f5a78626..39ff1a34c35 100644 --- a/packages/web/src/common/store/pages/settings/errorSagas.ts +++ b/packages/web/src/common/store/pages/settings/errorSagas.ts @@ -1,4 +1,4 @@ -import { settingsPageActions as actions } from '@audius/common' +import { settingsPageActions as actions } from '@audius/common/store' import { createErrorSagas } from '../../../../utils/errorSagas' diff --git a/packages/web/src/common/store/pages/settings/sagas.ts b/packages/web/src/common/store/pages/settings/sagas.ts index 551ce7334c7..bd91208fe85 100644 --- a/packages/web/src/common/store/pages/settings/sagas.ts +++ b/packages/web/src/common/store/pages/settings/sagas.ts @@ -1,11 +1,11 @@ +import { Kind } from '@audius/common/models' import { - getErrorMessage, - settingsPageActions as actions, - getContext, accountSelectors, cacheActions, - Kind -} from '@audius/common' + settingsPageActions as actions, + getContext +} from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { call, put, takeEvery, select } from 'typed-redux-saga' import { waitForWrite } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/pages/signon/actions.ts b/packages/web/src/common/store/pages/signon/actions.ts index bfec6ffe998..0eaf23561c0 100644 --- a/packages/web/src/common/store/pages/signon/actions.ts +++ b/packages/web/src/common/store/pages/signon/actions.ts @@ -1,11 +1,10 @@ +import { ID, User } from '@audius/common/models' import { - ID, - User, InstagramProfile, TwitterProfile, TikTokProfile, Image -} from '@audius/common' +} from '@audius/common/store' import { createCustomAction } from 'typesafe-actions' import { UiErrorCode } from 'store/errors/actions' diff --git a/packages/web/src/common/store/pages/signon/sagas.js b/packages/web/src/common/store/pages/signon/sagas.js index b752fc060e3..6f2f0b713c4 100644 --- a/packages/web/src/common/store/pages/signon/sagas.js +++ b/packages/web/src/common/store/pages/signon/sagas.js @@ -1,28 +1,31 @@ +import { Name, FavoriteSource } from '@audius/common/models' import { - ELECTRONIC_SUBGENRES, - FavoriteSource, + IntKeys, FeatureFlags, - Genre, MAX_HANDLE_LENGTH, - Name, + getCityAndRegion +} from '@audius/common/services' +import { accountActions, accountSelectors, - cacheUsersSelectors, - collectionsSocialActions, - getCityAndRegion, - getContext, processAndCacheUsers, + cacheUsersSelectors, settingsPageActions, + collectionsSocialActions, usersSocialActions as socialActions, solanaSelectors, toastActions, + getContext, confirmerActions, - confirmTransaction, - IntKeys, + confirmTransaction +} from '@audius/common/store' +import { + Genre, + ELECTRONIC_SUBGENRES, + waitForAccount, parseHandleReservedStatusFromSocial, - isValidEmailString, - waitForAccount -} from '@audius/common' + isValidEmailString +} from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { isEmpty } from 'lodash' import { diff --git a/packages/web/src/common/store/pages/signon/selectors.ts b/packages/web/src/common/store/pages/signon/selectors.ts index 8dfe35cc934..192fa5c99a9 100644 --- a/packages/web/src/common/store/pages/signon/selectors.ts +++ b/packages/web/src/common/store/pages/signon/selectors.ts @@ -1,4 +1,4 @@ -import { accountSelectors, cacheUsersSelectors } from '@audius/common' +import { accountSelectors, cacheUsersSelectors } from '@audius/common/store' import { createSelector } from 'reselect' import { AppState } from 'store/types' diff --git a/packages/web/src/common/store/pages/signon/types.ts b/packages/web/src/common/store/pages/signon/types.ts index 708e9bd227b..369f098224a 100644 --- a/packages/web/src/common/store/pages/signon/types.ts +++ b/packages/web/src/common/store/pages/signon/types.ts @@ -1,4 +1,4 @@ -import { ID, User } from '@audius/common' +import { ID, User } from '@audius/common/models' import { ImageFieldValue } from 'pages/sign-up-page/components/ImageField' diff --git a/packages/web/src/common/store/pages/signon/verifiedChecker.ts b/packages/web/src/common/store/pages/signon/verifiedChecker.ts index 8eb2272798a..f7248c20f39 100644 --- a/packages/web/src/common/store/pages/signon/verifiedChecker.ts +++ b/packages/web/src/common/store/pages/signon/verifiedChecker.ts @@ -1,4 +1,4 @@ -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' type TwitterUser = { verified: boolean diff --git a/packages/web/src/common/store/pages/token-dashboard/addWalletToUser.ts b/packages/web/src/common/store/pages/token-dashboard/addWalletToUser.ts index 78c3deac6be..84d2dbc0a9f 100644 --- a/packages/web/src/common/store/pages/token-dashboard/addWalletToUser.ts +++ b/packages/web/src/common/store/pages/token-dashboard/addWalletToUser.ts @@ -1,14 +1,13 @@ +import { Kind, User } from '@audius/common/models' import { accountSelectors, cacheActions, - confirmerActions, - getContext, - Kind, tokenDashboardPageActions, - User, walletActions, + getContext, + confirmerActions, confirmTransaction -} from '@audius/common' +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { getAccountMetadataCID } from './getAccountMetadataCID' diff --git a/packages/web/src/common/store/pages/token-dashboard/associateNewWallet.ts b/packages/web/src/common/store/pages/token-dashboard/associateNewWallet.ts index 174a45acad9..3224b658d8f 100644 --- a/packages/web/src/common/store/pages/token-dashboard/associateNewWallet.ts +++ b/packages/web/src/common/store/pages/token-dashboard/associateNewWallet.ts @@ -1,12 +1,11 @@ +import { Name, Chain } from '@audius/common/models' +import { newUserMetadata } from '@audius/common/schemas' import { accountSelectors, - Chain, - getContext, - Name, - newUserMetadata, + tokenDashboardPageSelectors, tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + getContext +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' const { getAccountUser } = accountSelectors diff --git a/packages/web/src/common/store/pages/token-dashboard/checkIsNewWallet.ts b/packages/web/src/common/store/pages/token-dashboard/checkIsNewWallet.ts index 585de99f488..f2e89759dc5 100644 --- a/packages/web/src/common/store/pages/token-dashboard/checkIsNewWallet.ts +++ b/packages/web/src/common/store/pages/token-dashboard/checkIsNewWallet.ts @@ -1,10 +1,9 @@ +import { Name, Chain } from '@audius/common/models' import { - Chain, - getContext, - Name, + tokenDashboardPageSelectors, tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + getContext +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' const { getAssociatedWallets } = tokenDashboardPageSelectors diff --git a/packages/web/src/common/store/pages/token-dashboard/getAccountMetadataCID.ts b/packages/web/src/common/store/pages/token-dashboard/getAccountMetadataCID.ts index 71d05f4fa25..10d1f89a5b1 100644 --- a/packages/web/src/common/store/pages/token-dashboard/getAccountMetadataCID.ts +++ b/packages/web/src/common/store/pages/token-dashboard/getAccountMetadataCID.ts @@ -1,4 +1,4 @@ -import { accountSelectors, getContext } from '@audius/common' +import { accountSelectors, getContext } from '@audius/common/store' import { select, call } from 'typed-redux-saga' import { waitForRead } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/pages/token-dashboard/getWalletInfo.ts b/packages/web/src/common/store/pages/token-dashboard/getWalletInfo.ts index 709254ddb2c..20aad9b1d9d 100644 --- a/packages/web/src/common/store/pages/token-dashboard/getWalletInfo.ts +++ b/packages/web/src/common/store/pages/token-dashboard/getWalletInfo.ts @@ -1,4 +1,5 @@ -import { Chain, getContext } from '@audius/common' +import { Chain } from '@audius/common/models' +import { getContext } from '@audius/common/store' import { call } from 'typed-redux-saga' import { diff --git a/packages/web/src/common/store/pages/token-dashboard/removeWalletSaga.ts b/packages/web/src/common/store/pages/token-dashboard/removeWalletSaga.ts index 9b9bda5185b..8be59b4d4b1 100644 --- a/packages/web/src/common/store/pages/token-dashboard/removeWalletSaga.ts +++ b/packages/web/src/common/store/pages/token-dashboard/removeWalletSaga.ts @@ -1,16 +1,15 @@ +import { Chain, Kind } from '@audius/common/models' +import { newUserMetadata } from '@audius/common/schemas' import { accountSelectors, cacheActions, - Chain, - confirmerActions, - ConfirmRemoveWalletAction, - getContext, - Kind, - newUserMetadata, tokenDashboardPageActions, walletActions, - confirmTransaction -} from '@audius/common' + getContext, + confirmerActions, + confirmTransaction, + ConfirmRemoveWalletAction +} from '@audius/common/store' import { call, fork, put, select, takeLatest } from 'typed-redux-saga' import { diff --git a/packages/web/src/common/store/pages/token-dashboard/sagas.ts b/packages/web/src/common/store/pages/token-dashboard/sagas.ts index a8bca4b78d3..b555907d475 100644 --- a/packages/web/src/common/store/pages/token-dashboard/sagas.ts +++ b/packages/web/src/common/store/pages/token-dashboard/sagas.ts @@ -1,10 +1,9 @@ +import { Chain, CollectibleState } from '@audius/common/models' import { - Chain, accountSelectors, tokenDashboardPageActions, - getContext, - CollectibleState -} from '@audius/common' + getContext +} from '@audius/common/store' import { call, put, select, takeLatest } from 'typed-redux-saga' import { diff --git a/packages/web/src/common/store/pages/track/lineups/sagas.ts b/packages/web/src/common/store/pages/track/lineups/sagas.ts index 652e28d7bfc..2f78a29fb8d 100644 --- a/packages/web/src/common/store/pages/track/lineups/sagas.ts +++ b/packages/web/src/common/store/pages/track/lineups/sagas.ts @@ -1,11 +1,11 @@ +import { Track } from '@audius/common/models' import { - Track, accountSelectors, cacheTracksSelectors, trackPageLineupActions, - trackPageSelectors, - waitForValue -} from '@audius/common' + trackPageSelectors +} from '@audius/common/store' +import { waitForValue } from '@audius/common/utils' import { call, select } from 'typed-redux-saga' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/common/store/pages/track/sagas.js b/packages/web/src/common/store/pages/track/sagas.js index 049360ed972..0c1fb2ee8ab 100644 --- a/packages/web/src/common/store/pages/track/sagas.js +++ b/packages/web/src/common/store/pages/track/sagas.js @@ -1,15 +1,15 @@ +import { Kind } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - Kind, - StringKeys, - makeUid, cacheTracksActions as trackCacheActions, cacheTracksSelectors, cacheUsersSelectors, + trackPageLineupActions, trackPageActions, trackPageSelectors, - trackPageLineupActions, reachabilitySelectors -} from '@audius/common' +} from '@audius/common/store' +import { makeUid } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { keccak_256 } from 'js-sha3' import moment from 'moment' diff --git a/packages/web/src/common/store/pages/trending-playlists/lineups/sagas.ts b/packages/web/src/common/store/pages/trending-playlists/lineups/sagas.ts index 9374b5a432b..fab23cee10e 100644 --- a/packages/web/src/common/store/pages/trending-playlists/lineups/sagas.ts +++ b/packages/web/src/common/store/pages/trending-playlists/lineups/sagas.ts @@ -1,12 +1,11 @@ +import { UserCollectionMetadata, Collection } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - UserCollectionMetadata, - StringKeys, accountSelectors, trendingPlaylistsPageLineupSelectors, trendingPlaylistsPageLineupActions, - getContext, - Collection -} from '@audius/common' + getContext +} from '@audius/common/store' import { keccak_256 } from 'js-sha3' import { call, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/pages/trending-underground/lineups/sagas.ts b/packages/web/src/common/store/pages/trending-underground/lineups/sagas.ts index b3f9b414030..6ef70fe80f2 100644 --- a/packages/web/src/common/store/pages/trending-underground/lineups/sagas.ts +++ b/packages/web/src/common/store/pages/trending-underground/lineups/sagas.ts @@ -1,11 +1,11 @@ +import { Track } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - StringKeys, accountSelectors, trendingUndergroundPageLineupSelectors, trendingUndergroundPageLineupActions, - getContext, - Track -} from '@audius/common' + getContext +} from '@audius/common/store' import { keccak_256 } from 'js-sha3' import { call, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/pages/trending/lineups/trending/retrieveTrending.ts b/packages/web/src/common/store/pages/trending/lineups/trending/retrieveTrending.ts index d2e3019df46..33db220f560 100644 --- a/packages/web/src/common/store/pages/trending/lineups/trending/retrieveTrending.ts +++ b/packages/web/src/common/store/pages/trending/lineups/trending/retrieveTrending.ts @@ -1,17 +1,13 @@ +import { TimeRange, ID, Track, UserTrackMetadata } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - ID, - TimeRange, - Track, - UserTrackMetadata, - Nullable, - StringKeys, - Genre, cacheTracksSelectors, trendingPageLineupSelectors, trendingPageActions, trendingPageSelectors, getContext -} from '@audius/common' +} from '@audius/common/store' +import { Genre, Nullable } from '@audius/common/utils' import { keccak_256 } from 'js-sha3' import { call, put, select } from 'redux-saga/effects' diff --git a/packages/web/src/common/store/pages/trending/lineups/trending/sagas.js b/packages/web/src/common/store/pages/trending/lineups/trending/sagas.js index a9f5b5f483f..5f10073f86e 100644 --- a/packages/web/src/common/store/pages/trending/lineups/trending/sagas.js +++ b/packages/web/src/common/store/pages/trending/lineups/trending/sagas.js @@ -1,9 +1,9 @@ +import { TimeRange } from '@audius/common/models' import { - TimeRange, accountSelectors, trendingPageLineupActions, trendingPageSelectors -} from '@audius/common' +} from '@audius/common/store' import { select } from 'redux-saga/effects' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/common/store/player/errorSagas.ts b/packages/web/src/common/store/player/errorSagas.ts index 8fa37b0e483..d5f34a2cc8f 100644 --- a/packages/web/src/common/store/player/errorSagas.ts +++ b/packages/web/src/common/store/player/errorSagas.ts @@ -1,4 +1,4 @@ -import { playerActions } from '@audius/common' +import { playerActions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/common/store/player/sagas.ts b/packages/web/src/common/store/player/sagas.ts index e96452d9171..286a05146fd 100644 --- a/packages/web/src/common/store/player/sagas.ts +++ b/packages/web/src/common/store/player/sagas.ts @@ -1,26 +1,27 @@ +import { Kind } from '@audius/common/models' +import { FeatureFlags, QueryParams } from '@audius/common/services' import { - Kind, - encodeHashId, accountSelectors, cacheTracksSelectors, cacheActions, queueActions, + reachabilitySelectors, tracksSocialActions, getContext, - actionChannelDispatcher, playerActions, playerSelectors, playbackPositionActions, playbackPositionSelectors, - reachabilitySelectors, - Nullable, - FeatureFlags, - gatedContentSelectors, - QueryParams, + gatedContentSelectors +} from '@audius/common/store' +import { Genre, + encodeHashId, + actionChannelDispatcher, getQueryParams, - getTrackPreviewDuration -} from '@audius/common' + getTrackPreviewDuration, + Nullable +} from '@audius/common/utils' import { eventChannel } from 'redux-saga' import { select, diff --git a/packages/web/src/common/store/player/store.test.js b/packages/web/src/common/store/player/store.test.js index 611ff33f93a..55011142691 100644 --- a/packages/web/src/common/store/player/store.test.js +++ b/packages/web/src/common/store/player/store.test.js @@ -1,4 +1,4 @@ -import { playerReducer, playerActions } from '@audius/common' +import { playerReducer, playerActions } from '@audius/common/store' import { combineReducers } from 'redux' import { expectSaga } from 'redux-saga-test-plan' import { describe, it, expect, vitest } from 'vitest' diff --git a/packages/web/src/common/store/playlist-library/sagas.ts b/packages/web/src/common/store/playlist-library/sagas.ts index 75045d0617b..3f8803f3f64 100644 --- a/packages/web/src/common/store/playlist-library/sagas.ts +++ b/packages/web/src/common/store/playlist-library/sagas.ts @@ -1,13 +1,15 @@ import { Kind, - PlaylistIdentifier, + PlaylistLibraryID, + PlaylistIdentifier +} from '@audius/common/models' +import { accountSelectors, - AccountCollection, cacheActions, - playlistLibraryHelpers, playlistLibraryActions, - PlaylistLibraryID -} from '@audius/common' + playlistLibraryHelpers, + AccountCollection +} from '@audius/common/store' import { fork, put, select, takeEvery } from 'typed-redux-saga' import { updateProfileAsync } from 'common/store/profile/sagas' diff --git a/packages/web/src/common/store/playlist-library/watchAddToFolderSaga.ts b/packages/web/src/common/store/playlist-library/watchAddToFolderSaga.ts index a45b9197d9a..39740aac317 100644 --- a/packages/web/src/common/store/playlist-library/watchAddToFolderSaga.ts +++ b/packages/web/src/common/store/playlist-library/watchAddToFolderSaga.ts @@ -1,14 +1,13 @@ +import { Name, FavoriteSource } from '@audius/common/models' import { - Name, accountSelectors, playlistLibraryActions, playlistLibraryHelpers, - AddToFolderAction, - toastActions, - CommonState, collectionsSocialActions, - FavoriteSource -} from '@audius/common' + toastActions, + AddToFolderAction, + CommonState +} from '@audius/common/store' import { takeEvery, select, put } from 'typed-redux-saga' import { make } from '../analytics/actions' diff --git a/packages/web/src/common/store/playlist-library/watchReorderLibrarySaga.ts b/packages/web/src/common/store/playlist-library/watchReorderLibrarySaga.ts index dfa82b05f80..11a20f57bca 100644 --- a/packages/web/src/common/store/playlist-library/watchReorderLibrarySaga.ts +++ b/packages/web/src/common/store/playlist-library/watchReorderLibrarySaga.ts @@ -1,13 +1,12 @@ +import { Name, FavoriteSource } from '@audius/common/models' import { - CommonState, - FavoriteSource, - Name, - ReorderAction, accountSelectors, - collectionsSocialActions, playlistLibraryActions, - playlistLibraryHelpers -} from '@audius/common' + playlistLibraryHelpers, + collectionsSocialActions, + ReorderAction, + CommonState +} from '@audius/common/store' import { takeEvery, select, put } from 'typed-redux-saga' import { make } from '../analytics/actions' diff --git a/packages/web/src/common/store/playlist-updates/playlistUpdatesPollingDaemon.ts b/packages/web/src/common/store/playlist-updates/playlistUpdatesPollingDaemon.ts index e763cab86ac..bbef7b1396c 100644 --- a/packages/web/src/common/store/playlist-updates/playlistUpdatesPollingDaemon.ts +++ b/packages/web/src/common/store/playlist-updates/playlistUpdatesPollingDaemon.ts @@ -1,10 +1,9 @@ +import { IntKeys, remoteConfigIntDefaults } from '@audius/common/services' import { accountActions, getContext, - IntKeys, - playlistUpdatesActions, - remoteConfigIntDefaults -} from '@audius/common' + playlistUpdatesActions +} from '@audius/common/store' import { call, fork, take } from 'typed-redux-saga' import { diff --git a/packages/web/src/common/store/playlist-updates/sagas.ts b/packages/web/src/common/store/playlist-updates/sagas.ts index 52302cbe5c5..09209d94038 100644 --- a/packages/web/src/common/store/playlist-updates/sagas.ts +++ b/packages/web/src/common/store/playlist-updates/sagas.ts @@ -1,4 +1,4 @@ -import { playlistUpdatesSagas } from '@audius/common' +import { playlistUpdatesSagas } from '@audius/common/store' import { playlistUpdatesPollingDaemon } from './playlistUpdatesPollingDaemon' diff --git a/packages/web/src/common/store/profile/fetchProfileCollectionsSaga.ts b/packages/web/src/common/store/profile/fetchProfileCollectionsSaga.ts index 4452237752c..f8d91b5ffe6 100644 --- a/packages/web/src/common/store/profile/fetchProfileCollectionsSaga.ts +++ b/packages/web/src/common/store/profile/fetchProfileCollectionsSaga.ts @@ -1,10 +1,10 @@ +import { Kind } from '@audius/common/models' import { cacheActions, - getContext, - Kind, profilePageActions, - profilePageSelectors -} from '@audius/common' + profilePageSelectors, + getContext +} from '@audius/common/store' import { isEqual } from 'lodash' import { put, select, takeLatest, call } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/profile/fetchTopTagsSaga.ts b/packages/web/src/common/store/profile/fetchTopTagsSaga.ts index 67368ca5582..c055173ca00 100644 --- a/packages/web/src/common/store/profile/fetchTopTagsSaga.ts +++ b/packages/web/src/common/store/profile/fetchTopTagsSaga.ts @@ -1,4 +1,4 @@ -import { getContext, profilePageActions } from '@audius/common' +import { profilePageActions, getContext } from '@audius/common/store' import { takeLatest, call, put } from 'typed-redux-saga' const { FETCH_TOP_TAGS, diff --git a/packages/web/src/common/store/profile/sagas.js b/packages/web/src/common/store/profile/sagas.js index a973d5a9034..fbc15a702c3 100644 --- a/packages/web/src/common/store/profile/sagas.js +++ b/packages/web/src/common/store/profile/sagas.js @@ -1,30 +1,30 @@ +import { DefaultSizes, Kind } from '@audius/common/models' +import { DoubleKeys, FeatureFlags } from '@audius/common/services' import { - DefaultSizes, - Kind, - DoubleKeys, - makeUid, - makeKindId, - squashNewLines, accountSelectors, cacheActions, + processAndCacheUsers, + profilePageActions as profileActions, profilePageSelectors, FollowType, - profilePageActions as profileActions, + chatActions, reachabilitySelectors, tippingActions, relatedArtistsUIActions as relatedArtistsActions, - waitForAccount, - dataURLtoFile, - SUPPORTING_PAGINATION_SIZE, - MAX_PROFILE_SUPPORTING_TILES, - MAX_PROFILE_TOP_SUPPORTERS, collectiblesActions, - processAndCacheUsers, - chatActions, - FeatureFlags, confirmerActions, confirmTransaction -} from '@audius/common' +} from '@audius/common/store' +import { + squashNewLines, + makeUid, + makeKindId, + waitForAccount, + dataURLtoFile, + MAX_PROFILE_TOP_SUPPORTERS, + MAX_PROFILE_SUPPORTING_TILES, + SUPPORTING_PAGINATION_SIZE +} from '@audius/common/utils' import { merge } from 'lodash' import { all, diff --git a/packages/web/src/common/store/queue/sagas.ts b/packages/web/src/common/store/queue/sagas.ts index e472aa0c689..0a94fba87b4 100644 --- a/packages/web/src/common/store/queue/sagas.ts +++ b/packages/web/src/common/store/queue/sagas.ts @@ -5,30 +5,29 @@ import { PlaybackSource, LineupState, User, - Nullable, - makeUid, - Uid, + Collectible, + Track, + Collection, + UserTrackMetadata, + LineupEntry +} from '@audius/common/models' +import { accountSelectors, cacheCollectionsSelectors, cacheTracksSelectors, - cacheUsersSelectors, cacheActions, cacheSelectors, + cacheUsersSelectors, + lineupRegistry, queueActions, + queueSelectors, RepeatMode, QueueSource, - waitForAccount, - playerActions, - playerSelectors, - queueSelectors, getContext, - lineupRegistry, - Collectible, - UserTrackMetadata, - LineupEntry, - Track, - Collection -} from '@audius/common' + playerActions, + playerSelectors +} from '@audius/common/store' +import { Uid, makeUid, waitForAccount, Nullable } from '@audius/common/utils' import { all, call, put, select, takeEvery, takeLatest } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/queue/store.test.js b/packages/web/src/common/store/queue/store.test.js index 193006664a4..2764139ad6e 100644 --- a/packages/web/src/common/store/queue/store.test.js +++ b/packages/web/src/common/store/queue/store.test.js @@ -1,5 +1,5 @@ +import { Kind } from '@audius/common/models' import { - Kind, accountReducer, cacheActions, queueReducer as reducer, @@ -8,7 +8,7 @@ import { QueueSource, playerReducer, playerActions -} from '@audius/common' +} from '@audius/common/store' import { combineReducers } from 'redux' import { take } from 'redux-saga/effects' import { expectSaga } from 'redux-saga-test-plan' diff --git a/packages/web/src/common/store/recommendation/sagas.ts b/packages/web/src/common/store/recommendation/sagas.ts index 7e0992d6941..f86c5be6d80 100644 --- a/packages/web/src/common/store/recommendation/sagas.ts +++ b/packages/web/src/common/store/recommendation/sagas.ts @@ -1,4 +1,6 @@ -import { ID, Nullable, getContext } from '@audius/common' +import { ID } from '@audius/common/models' +import { getContext } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { call } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/recovery-email/sagas.ts b/packages/web/src/common/store/recovery-email/sagas.ts index d4101dd7a75..cd7724809e2 100644 --- a/packages/web/src/common/store/recovery-email/sagas.ts +++ b/packages/web/src/common/store/recovery-email/sagas.ts @@ -1,4 +1,5 @@ -import { Name, getContext, recoveryEmailActions } from '@audius/common' +import { Name } from '@audius/common/models' +import { recoveryEmailActions, getContext } from '@audius/common/store' import { takeLatest, put, call } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/remix-settings/sagas.ts b/packages/web/src/common/store/remix-settings/sagas.ts index 2ca8c9d4dc5..f264c076e88 100644 --- a/packages/web/src/common/store/remix-settings/sagas.ts +++ b/packages/web/src/common/store/remix-settings/sagas.ts @@ -1,9 +1,5 @@ -import { - TrackMetadata, - remixSettingsActions, - getContext, - Track -} from '@audius/common' +import { TrackMetadata, Track } from '@audius/common/models' +import { getContext, remixSettingsActions } from '@audius/common/store' import { takeLatest, call, put } from 'typed-redux-saga' import { parseTrackRoute } from 'utils/route/trackRouteParser' diff --git a/packages/web/src/common/store/saved-collections/sagas.ts b/packages/web/src/common/store/saved-collections/sagas.ts index 5f2e964c2dc..aceeb8ddb95 100644 --- a/packages/web/src/common/store/saved-collections/sagas.ts +++ b/packages/web/src/common/store/saved-collections/sagas.ts @@ -1,10 +1,10 @@ +import { ID } from '@audius/common/models' import { - CollectionType, - ID, savedCollectionsActions, savedCollectionsSelectors, - waitForRead -} from '@audius/common' + CollectionType +} from '@audius/common/store' +import { waitForRead } from '@audius/common/utils' import { all, call, select, put, takeEvery } from 'typed-redux-saga' import { retrieveCollections } from '../cache/collections/utils' diff --git a/packages/web/src/common/store/search-ai-bar/reducer.ts b/packages/web/src/common/store/search-ai-bar/reducer.ts index f8915efa241..4062247c6b7 100644 --- a/packages/web/src/common/store/search-ai-bar/reducer.ts +++ b/packages/web/src/common/store/search-ai-bar/reducer.ts @@ -1,4 +1,4 @@ -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import { ActionsMap } from 'utils/reducer' diff --git a/packages/web/src/common/store/search-ai-bar/sagas.ts b/packages/web/src/common/store/search-ai-bar/sagas.ts index 013934fcb99..a29a6c4a64e 100644 --- a/packages/web/src/common/store/search-ai-bar/sagas.ts +++ b/packages/web/src/common/store/search-ai-bar/sagas.ts @@ -1,10 +1,6 @@ -import { - Name, - SearchKind, - accountSelectors, - getContext, - removeNullable -} from '@audius/common' +import { Name } from '@audius/common/models' +import { accountSelectors, SearchKind, getContext } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { flatMap, zip } from 'lodash' import { call, diff --git a/packages/web/src/common/store/search-ai-bar/types.ts b/packages/web/src/common/store/search-ai-bar/types.ts index 60ee7790914..c0fc78fba8e 100644 --- a/packages/web/src/common/store/search-ai-bar/types.ts +++ b/packages/web/src/common/store/search-ai-bar/types.ts @@ -1,4 +1,4 @@ -import { SearchUser, Status } from '@audius/common' +import { Status, SearchUser } from '@audius/common/models' export type SearchResults = { users: SearchUser[] diff --git a/packages/web/src/common/store/search-bar/reducer.ts b/packages/web/src/common/store/search-bar/reducer.ts index 2ba3fd60daa..a467ab06897 100644 --- a/packages/web/src/common/store/search-bar/reducer.ts +++ b/packages/web/src/common/store/search-bar/reducer.ts @@ -1,4 +1,4 @@ -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import { ActionsMap } from 'utils/reducer' diff --git a/packages/web/src/common/store/search-bar/sagas.ts b/packages/web/src/common/store/search-bar/sagas.ts index 4dc594bbbd0..a24228a9f15 100644 --- a/packages/web/src/common/store/search-bar/sagas.ts +++ b/packages/web/src/common/store/search-bar/sagas.ts @@ -1,10 +1,7 @@ -import { - Name, - accountSelectors, - getContext, - removeNullable, - FeatureFlags -} from '@audius/common' +import { Name } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, getContext } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { flatMap, zip } from 'lodash' import { all, diff --git a/packages/web/src/common/store/search-bar/types.ts b/packages/web/src/common/store/search-bar/types.ts index 170e1302a97..612f24447b1 100644 --- a/packages/web/src/common/store/search-bar/types.ts +++ b/packages/web/src/common/store/search-bar/types.ts @@ -1,4 +1,9 @@ -import { SearchPlaylist, SearchTrack, SearchUser, Status } from '@audius/common' +import { + Status, + SearchUser, + SearchTrack, + SearchPlaylist +} from '@audius/common/models' type NewType = SearchPlaylist diff --git a/packages/web/src/common/store/smart-collection/sagas.ts b/packages/web/src/common/store/smart-collection/sagas.ts index 57749b20e5f..c1afbe04cb0 100644 --- a/packages/web/src/common/store/smart-collection/sagas.ts +++ b/packages/web/src/common/store/smart-collection/sagas.ts @@ -1,15 +1,17 @@ import { SmartCollectionVariant, Track, - UserTrack, UserTrackMetadata, + UserTrack +} from '@audius/common/models' +import { accountSelectors, smartCollectionPageActions, + collectionPageLineupActions, collectionPageActions, - getContext, - removeNullable, - collectionPageLineupActions -} from '@audius/common' + getContext +} from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { takeEvery, put, call, select } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' diff --git a/packages/web/src/common/store/smart-collection/smartCollections.ts b/packages/web/src/common/store/smart-collection/smartCollections.ts index 280509ea1aa..4344ead4aed 100644 --- a/packages/web/src/common/store/smart-collection/smartCollections.ts +++ b/packages/web/src/common/store/smart-collection/smartCollections.ts @@ -1,8 +1,8 @@ import { - SmartCollection, Variant, - SmartCollectionVariant -} from '@audius/common' + SmartCollectionVariant, + SmartCollection +} from '@audius/common/models' import IconExploreFeelingLucky from 'assets/img/iconExploreFeelingLucky.svg' import IconExploreMostLoved from 'assets/img/iconExploreMostLoved.svg' diff --git a/packages/web/src/common/store/social/collections/errorSagas.ts b/packages/web/src/common/store/social/collections/errorSagas.ts index 2931a9b280a..06345ed7987 100644 --- a/packages/web/src/common/store/social/collections/errorSagas.ts +++ b/packages/web/src/common/store/social/collections/errorSagas.ts @@ -1,4 +1,4 @@ -import { collectionsSocialActions as socialCollectionActions } from '@audius/common' +import { collectionsSocialActions as socialCollectionActions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/common/store/social/collections/sagas.ts b/packages/web/src/common/store/social/collections/sagas.ts index 36a88455b3f..ad6b2945847 100644 --- a/packages/web/src/common/store/social/collections/sagas.ts +++ b/packages/web/src/common/store/social/collections/sagas.ts @@ -1,28 +1,28 @@ import { + Name, Kind, + SmartCollectionVariant, ID, - Name, PlaylistLibrary, - SmartCollectionVariant, - User, - makeUid, - makeKindId, - formatShareText, - accountSelectors, + User +} from '@audius/common/models' +import { accountActions, + accountSelectors, cacheCollectionsSelectors, - cacheUsersSelectors, cacheActions, - getContext, - collectionsSocialActions as socialActions, + cacheUsersSelectors, + savedPageActions, + LibraryCategory, playlistLibraryActions, playlistLibraryHelpers, + collectionsSocialActions as socialActions, + getContext, playlistUpdatesActions, confirmerActions, - confirmTransaction, - savedPageActions, - LibraryCategory -} from '@audius/common' + confirmTransaction +} from '@audius/common/store' +import { formatShareText, makeUid, makeKindId } from '@audius/common/utils' import { call, select, takeEvery, put } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/social/collections/store.test.js b/packages/web/src/common/store/social/collections/store.test.js index c3297326e74..6c2142e96c7 100644 --- a/packages/web/src/common/store/social/collections/store.test.js +++ b/packages/web/src/common/store/social/collections/store.test.js @@ -1,8 +1,8 @@ +import { Kind } from '@audius/common/models' import { - Kind, cacheActions, collectionsSocialActions as actions -} from '@audius/common' +} from '@audius/common/store' import { combineReducers } from 'redux' import { expectSaga } from 'redux-saga-test-plan' import * as matchers from 'redux-saga-test-plan/matchers' diff --git a/packages/web/src/common/store/social/tracks/errorSagas.ts b/packages/web/src/common/store/social/tracks/errorSagas.ts index dcd73e6544a..c21a0b89838 100644 --- a/packages/web/src/common/store/social/tracks/errorSagas.ts +++ b/packages/web/src/common/store/social/tracks/errorSagas.ts @@ -1,4 +1,4 @@ -import { tracksSocialActions as socialTrackActions } from '@audius/common' +import { tracksSocialActions as socialTrackActions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/common/store/social/tracks/recordListen.ts b/packages/web/src/common/store/social/tracks/recordListen.ts index e042b1e36c3..aab0ac780a1 100644 --- a/packages/web/src/common/store/social/tracks/recordListen.ts +++ b/packages/web/src/common/store/social/tracks/recordListen.ts @@ -1,11 +1,11 @@ +import { Name } from '@audius/common/models' import { accountSelectors, - audioRewardsPageActions, cacheTracksSelectors, - getContext, - Name, - tracksSocialActions -} from '@audius/common' + audioRewardsPageActions, + tracksSocialActions, + getContext +} from '@audius/common/store' import { call, put, select, takeEvery } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/social/tracks/sagas.ts b/packages/web/src/common/store/social/tracks/sagas.ts index b0f59730450..84abb657ea5 100644 --- a/packages/web/src/common/store/social/tracks/sagas.ts +++ b/packages/web/src/common/store/social/tracks/sagas.ts @@ -1,28 +1,25 @@ +import { Name, Kind, ID, Track, User } from '@audius/common/models' +import { FeatureFlags, QueryParams } from '@audius/common/services' import { - Kind, - ID, - Name, - Track, - User, - makeKindId, - formatShareText, accountSelectors, cacheTracksSelectors, - cacheUsersSelectors, cacheActions, - gatedContentSelectors, - getContext, + cacheUsersSelectors, tracksSocialActions as socialActions, - waitForValue, - QueryParams, - encodeHashId, - getQueryParams, + getContext, + gatedContentSelectors, confirmerActions, confirmTransaction, - modalsActions, - removeNullable, - FeatureFlags -} from '@audius/common' + modalsActions +} from '@audius/common/store' +import { + formatShareText, + encodeHashId, + makeKindId, + waitForValue, + getQueryParams, + removeNullable +} from '@audius/common/utils' import { capitalize } from 'lodash' import { call, select, takeEvery, put, fork } from 'typed-redux-saga' diff --git a/packages/web/src/common/store/social/tracks/store.test.js b/packages/web/src/common/store/social/tracks/store.test.js index 8d90fd991b6..286497f49a0 100644 --- a/packages/web/src/common/store/social/tracks/store.test.js +++ b/packages/web/src/common/store/social/tracks/store.test.js @@ -1,8 +1,8 @@ +import { Kind } from '@audius/common/models' import { - Kind, cacheActions, tracksSocialActions as actions -} from '@audius/common' +} from '@audius/common/store' import { combineReducers } from 'redux' import { expectSaga } from 'redux-saga-test-plan' import * as matchers from 'redux-saga-test-plan/matchers' diff --git a/packages/web/src/common/store/social/users/errorSagas.ts b/packages/web/src/common/store/social/users/errorSagas.ts index eaddf629386..ae21f2eb62c 100644 --- a/packages/web/src/common/store/social/users/errorSagas.ts +++ b/packages/web/src/common/store/social/users/errorSagas.ts @@ -1,4 +1,4 @@ -import { usersSocialActions as socialUserActions } from '@audius/common' +import { usersSocialActions as socialUserActions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/common/store/social/users/sagas.ts b/packages/web/src/common/store/social/users/sagas.ts index a05e86d6176..4dbefe9babc 100644 --- a/packages/web/src/common/store/social/users/sagas.ts +++ b/packages/web/src/common/store/social/users/sagas.ts @@ -1,17 +1,15 @@ +import { Name, Kind, ID } from '@audius/common/models' import { - Kind, - ID, - Name, - makeKindId, accountSelectors, cacheActions, cacheUsersSelectors, - getContext, - usersSocialActions as socialActions, profilePageActions, + usersSocialActions as socialActions, + getContext, confirmerActions, confirmTransaction -} from '@audius/common' +} from '@audius/common/store' +import { makeKindId } from '@audius/common/utils' import { call, select, takeEvery, put } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/store/social/users/store.test.js b/packages/web/src/common/store/social/users/store.test.js index 16361ad682a..407ac76240a 100644 --- a/packages/web/src/common/store/social/users/store.test.js +++ b/packages/web/src/common/store/social/users/store.test.js @@ -1,8 +1,8 @@ +import { Kind } from '@audius/common/models' import { - Kind, cacheActions, usersSocialActions as actions -} from '@audius/common' +} from '@audius/common/store' import { combineReducers } from 'redux' import { expectSaga } from 'redux-saga-test-plan' import * as matchers from 'redux-saga-test-plan/matchers' diff --git a/packages/web/src/common/store/tipping/sagas.ts b/packages/web/src/common/store/tipping/sagas.ts index 93acdb3cde4..998008b2cb4 100644 --- a/packages/web/src/common/store/tipping/sagas.ts +++ b/packages/web/src/common/store/tipping/sagas.ts @@ -1,40 +1,46 @@ import { + Name, Kind, ID, - Name, Supporter, Supporting, + LastDismissedTip, User, - BNWei, StringWei, - parseAudioInputToWei, - stringWeiToBN, - weiToAudioString, - weiToString, - decodeHashId, + BNWei, + SolanaWalletAddress +} from '@audius/common/models' +import { + createUserBankIfNeeded, + LocalStorage, + GetSupportingArgs, + GetSupportersArgs, + GetTipsArgs +} from '@audius/common/services' +import { accountSelectors, cacheActions, - RefreshSupportPayloadAction, + processAndCacheUsers, + chatActions, + solanaSelectors, tippingSelectors, tippingActions, walletSelectors, walletActions, getContext, + RefreshSupportPayloadAction +} from '@audius/common/store' +import { + decodeHashId, + isNullOrUndefined, + weiToAudioString, + stringWeiToBN, + weiToString, + parseAudioInputToWei, waitForValue, - GetTipsArgs, - GetSupportingArgs, - GetSupportersArgs, MAX_PROFILE_TOP_SUPPORTERS, - SUPPORTING_PAGINATION_SIZE, - LastDismissedTip, - LocalStorage, - processAndCacheUsers, - solanaSelectors, - createUserBankIfNeeded, - SolanaWalletAddress, - chatActions, - isNullOrUndefined -} from '@audius/common' + SUPPORTING_PAGINATION_SIZE +} from '@audius/common/utils' import { PayloadAction } from '@reduxjs/toolkit' import BN from 'bn.js' import { diff --git a/packages/web/src/common/store/ui/reactions/sagas.ts b/packages/web/src/common/store/ui/reactions/sagas.ts index 59b19adcc59..83e40c9f309 100644 --- a/packages/web/src/common/store/ui/reactions/sagas.ts +++ b/packages/web/src/common/store/ui/reactions/sagas.ts @@ -1,13 +1,12 @@ +import { AudiusBackend } from '@audius/common/services' import { - removeNullable, - getReactionFromRawValue, - reactionsMap, reactionsUIActions, reactionsUISelectors, - getContext, - AudiusBackend, - getErrorMessage -} from '@audius/common' + reactionsMap, + getReactionFromRawValue, + getContext +} from '@audius/common/store' +import { getErrorMessage, removeNullable } from '@audius/common/utils' import { call, takeEvery, all, put, select } from 'typed-redux-saga' const { fetchReactionValues, setLocalReactionValues, writeReactionValue } = diff --git a/packages/web/src/common/store/upload/errorSagas.ts b/packages/web/src/common/store/upload/errorSagas.ts index 3c8dbffa45b..0c2e3bc45bc 100644 --- a/packages/web/src/common/store/upload/errorSagas.ts +++ b/packages/web/src/common/store/upload/errorSagas.ts @@ -1,4 +1,4 @@ -import { uploadActions } from '@audius/common' +import { uploadActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/upload/sagaHelpers.ts b/packages/web/src/common/store/upload/sagaHelpers.ts index 36730080561..5bd730bbcc9 100644 --- a/packages/web/src/common/store/upload/sagaHelpers.ts +++ b/packages/web/src/common/store/upload/sagaHelpers.ts @@ -1,16 +1,18 @@ import { - BN_USDC_CENT_WEI, - FeatureFlags, Name, - accountSelectors, - getContext, - getUSDCUserBank, isContentCollectibleGated, isContentFollowGated, - isContentUSDCPurchaseGated, isContentTipGated, + isContentUSDCPurchaseGated, TrackMetadata -} from '@audius/common' +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { + accountSelectors, + getUSDCUserBank, + getContext +} from '@audius/common/store' +import { BN_USDC_CENT_WEI } from '@audius/common/utils' import { PublicKey } from '@solana/web3.js' import BN from 'bn.js' import { range } from 'lodash' diff --git a/packages/web/src/common/store/upload/sagas.js b/packages/web/src/common/store/upload/sagas.js index 607d5401308..4a047591d82 100644 --- a/packages/web/src/common/store/upload/sagas.js +++ b/packages/web/src/common/store/upload/sagas.js @@ -1,24 +1,25 @@ +import { Name, Kind } from '@audius/common/models' import { - Kind, - Name, - makeUid, - formatUrlName, - accountSelectors, accountActions, - cacheUsersSelectors, + accountSelectors, cacheActions, - waitForAccount, - actionChannelDispatcher, + reformatCollection, + cacheUsersSelectors, + savedPageActions, + LibraryCategory, uploadActions, + uploadSelectors, UploadType, ProgressStatus, - uploadSelectors, confirmerActions, - confirmTransaction, - LibraryCategory, - reformatCollection, - savedPageActions -} from '@audius/common' + confirmTransaction +} from '@audius/common/store' +import { + formatUrlName, + makeUid, + actionChannelDispatcher, + waitForAccount +} from '@audius/common/utils' import { range } from 'lodash' import { channel, buffers } from 'redux-saga' import { diff --git a/packages/web/src/common/store/user-list/favorites/errorSagas.ts b/packages/web/src/common/store/user-list/favorites/errorSagas.ts index ccc5bb55d8e..6e1cdc2b48c 100644 --- a/packages/web/src/common/store/user-list/favorites/errorSagas.ts +++ b/packages/web/src/common/store/user-list/favorites/errorSagas.ts @@ -1,4 +1,4 @@ -import { favoritesUserListActions } from '@audius/common' +import { favoritesUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/favorites/sagas.ts b/packages/web/src/common/store/user-list/favorites/sagas.ts index 03759a8841e..9edeecc5a3c 100644 --- a/packages/web/src/common/store/user-list/favorites/sagas.ts +++ b/packages/web/src/common/store/user-list/favorites/sagas.ts @@ -1,15 +1,12 @@ +import { FavoriteType, Collection, ID, Track } from '@audius/common/models' import { - ID, - Collection, - FavoriteType, - Track, cacheCollectionsSelectors, cacheTracksSelectors, UserListSagaFactory, favoritesUserListActions, favoritesUserListSelectors, FAVORITES_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { select, put } from 'typed-redux-saga' import { watchFavoriteError } from 'common/store/user-list/favorites/errorSagas' diff --git a/packages/web/src/common/store/user-list/followers/errorSagas.ts b/packages/web/src/common/store/user-list/followers/errorSagas.ts index fa65c785425..2ee27f2592e 100644 --- a/packages/web/src/common/store/user-list/followers/errorSagas.ts +++ b/packages/web/src/common/store/user-list/followers/errorSagas.ts @@ -1,4 +1,4 @@ -import { followersUserListActions } from '@audius/common' +import { followersUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/followers/sagas.ts b/packages/web/src/common/store/user-list/followers/sagas.ts index c8a1a1b3eba..bcf2099381a 100644 --- a/packages/web/src/common/store/user-list/followers/sagas.ts +++ b/packages/web/src/common/store/user-list/followers/sagas.ts @@ -1,12 +1,11 @@ +import { ID, User } from '@audius/common/models' import { - ID, - User, cacheUsersSelectors, - followersUserListSelectors, UserListSagaFactory, followersUserListActions, + followersUserListSelectors, FOLLOWERS_USER_LIST_TAG as USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { put, select } from 'typed-redux-saga' import { watchFollowersError } from 'common/store/user-list/followers/errorSagas' diff --git a/packages/web/src/common/store/user-list/following/errorSagas.ts b/packages/web/src/common/store/user-list/following/errorSagas.ts index 8e5e2a71b71..dc3243f9ce7 100644 --- a/packages/web/src/common/store/user-list/following/errorSagas.ts +++ b/packages/web/src/common/store/user-list/following/errorSagas.ts @@ -1,4 +1,4 @@ -import { followingUserListActions } from '@audius/common' +import { followingUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/following/sagas.ts b/packages/web/src/common/store/user-list/following/sagas.ts index fd38b85dc6d..e20e871dba1 100644 --- a/packages/web/src/common/store/user-list/following/sagas.ts +++ b/packages/web/src/common/store/user-list/following/sagas.ts @@ -1,12 +1,11 @@ +import { ID, User } from '@audius/common/models' import { - ID, - User, cacheUsersSelectors, UserListSagaFactory, followingUserListActions, followingUserListSelectors, FOLLOWING_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { put, select } from 'typed-redux-saga' import { watchFollowingError } from 'common/store/user-list/following/errorSagas' diff --git a/packages/web/src/common/store/user-list/mutuals/errorSagas.ts b/packages/web/src/common/store/user-list/mutuals/errorSagas.ts index 383d0fae67c..ad5218ff575 100644 --- a/packages/web/src/common/store/user-list/mutuals/errorSagas.ts +++ b/packages/web/src/common/store/user-list/mutuals/errorSagas.ts @@ -1,4 +1,4 @@ -import { mutualsUserListActions } from '@audius/common' +import { mutualsUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/mutuals/sagas.ts b/packages/web/src/common/store/user-list/mutuals/sagas.ts index 25f5133bc18..782fdc7bf0f 100644 --- a/packages/web/src/common/store/user-list/mutuals/sagas.ts +++ b/packages/web/src/common/store/user-list/mutuals/sagas.ts @@ -1,13 +1,12 @@ +import { ID, User } from '@audius/common/models' +import { AudiusBackend } from '@audius/common/services' import { - ID, - User, cacheUsersSelectors, UserListSagaFactory, mutualsUserListActions, mutualsUserListSelectors, - MUTUALS_USER_LIST_TAG, - AudiusBackend -} from '@audius/common' + MUTUALS_USER_LIST_TAG +} from '@audius/common/store' import { put, select } from 'typed-redux-saga' import { watchMutualsError } from 'common/store/user-list/mutuals/errorSagas' diff --git a/packages/web/src/common/store/user-list/notifications/errorSagas.ts b/packages/web/src/common/store/user-list/notifications/errorSagas.ts index 369aec9cdb0..e81ebb861f9 100644 --- a/packages/web/src/common/store/user-list/notifications/errorSagas.ts +++ b/packages/web/src/common/store/user-list/notifications/errorSagas.ts @@ -1,4 +1,4 @@ -import { notificationsUserListActions } from '@audius/common' +import { notificationsUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/notifications/sagas.ts b/packages/web/src/common/store/user-list/notifications/sagas.ts index 58d7ffeae9c..84160d406cc 100644 --- a/packages/web/src/common/store/user-list/notifications/sagas.ts +++ b/packages/web/src/common/store/user-list/notifications/sagas.ts @@ -4,7 +4,7 @@ import { notificationsUserListActions, notificationsUserListSelectors, NOTIFICATIONS_USER_LIST_TAG as USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { fetchUsers as retrieveUsers } from 'common/store/cache/users/sagas' diff --git a/packages/web/src/common/store/user-list/related-artists/errorSagas.ts b/packages/web/src/common/store/user-list/related-artists/errorSagas.ts index 539be17418c..94967d0105f 100644 --- a/packages/web/src/common/store/user-list/related-artists/errorSagas.ts +++ b/packages/web/src/common/store/user-list/related-artists/errorSagas.ts @@ -1,4 +1,4 @@ -import { relatedArtistsUserListActions } from '@audius/common' +import { relatedArtistsUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/related-artists/sagas.ts b/packages/web/src/common/store/user-list/related-artists/sagas.ts index 2606df859fc..c68e3e67a3e 100644 --- a/packages/web/src/common/store/user-list/related-artists/sagas.ts +++ b/packages/web/src/common/store/user-list/related-artists/sagas.ts @@ -1,11 +1,11 @@ +import { ID } from '@audius/common/models' import { - ID, UserListSagaFactory, - relatedArtistsUserListSelectors, relatedArtistsUserListActions, + relatedArtistsUserListSelectors, RELATED_ARTISTS_USER_LIST_TAG, getContext -} from '@audius/common' +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { watchRelatedArtistsError } from './errorSagas' diff --git a/packages/web/src/common/store/user-list/reposts/errorSagas.ts b/packages/web/src/common/store/user-list/reposts/errorSagas.ts index 71e34813d40..4522f35efd5 100644 --- a/packages/web/src/common/store/user-list/reposts/errorSagas.ts +++ b/packages/web/src/common/store/user-list/reposts/errorSagas.ts @@ -1,4 +1,4 @@ -import { repostsUserListActions } from '@audius/common' +import { repostsUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/reposts/sagas.ts b/packages/web/src/common/store/user-list/reposts/sagas.ts index 185dd390f71..0df2232aeb2 100644 --- a/packages/web/src/common/store/user-list/reposts/sagas.ts +++ b/packages/web/src/common/store/user-list/reposts/sagas.ts @@ -1,15 +1,13 @@ +import { Collection, ID, Track } from '@audius/common/models' import { - ID, - Collection, - Track, cacheCollectionsSelectors, cacheTracksSelectors, - RepostType, UserListSagaFactory, repostsUserListActions, repostsUserListSelectors, + RepostType, REPOSTS_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { put, select } from 'typed-redux-saga' import { watchRepostsError } from 'common/store/user-list/reposts/errorSagas' diff --git a/packages/web/src/common/store/user-list/supporting/errorSagas.ts b/packages/web/src/common/store/user-list/supporting/errorSagas.ts index 4a4a08af543..7dd1c8f96ab 100644 --- a/packages/web/src/common/store/user-list/supporting/errorSagas.ts +++ b/packages/web/src/common/store/user-list/supporting/errorSagas.ts @@ -1,4 +1,4 @@ -import { supportingUserListActions } from '@audius/common' +import { supportingUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/supporting/sagas.ts b/packages/web/src/common/store/user-list/supporting/sagas.ts index 85e74a9eabc..48b04005d1d 100644 --- a/packages/web/src/common/store/user-list/supporting/sagas.ts +++ b/packages/web/src/common/store/user-list/supporting/sagas.ts @@ -1,19 +1,18 @@ +import { ID, UserMetadata, User } from '@audius/common/models' +import { + responseAdapter as adapter, + SupportingResponse +} from '@audius/common/services' import { - ID, - User, - UserMetadata, - stringWeiToBN, - decodeHashId, cacheUsersSelectors, tippingActions, - SupportingMapForUser, UserListSagaFactory, supportingUserListActions, supportingUserListSelectors, SUPPORTING_USER_LIST_TAG, - responseAdapter as adapter, - SupportingResponse -} from '@audius/common' + SupportingMapForUser +} from '@audius/common/store' +import { decodeHashId, stringWeiToBN } from '@audius/common/utils' import { put, select } from 'typed-redux-saga' import { watchSupportingError } from 'common/store/user-list/supporting/errorSagas' diff --git a/packages/web/src/common/store/user-list/top-supporters/errorSagas.ts b/packages/web/src/common/store/user-list/top-supporters/errorSagas.ts index 90f50b6ebfa..95a61577738 100644 --- a/packages/web/src/common/store/user-list/top-supporters/errorSagas.ts +++ b/packages/web/src/common/store/user-list/top-supporters/errorSagas.ts @@ -1,4 +1,4 @@ -import { topSupportersUserListActions } from '@audius/common' +import { topSupportersUserListActions } from '@audius/common/store' import { put, takeEvery } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/common/store/user-list/top-supporters/sagas.ts b/packages/web/src/common/store/user-list/top-supporters/sagas.ts index 12aa468c72b..ac61d936a84 100644 --- a/packages/web/src/common/store/user-list/top-supporters/sagas.ts +++ b/packages/web/src/common/store/user-list/top-supporters/sagas.ts @@ -1,18 +1,18 @@ +import { ID, User } from '@audius/common/models' +import { + responseAdapter as adapter, + SupporterResponse +} from '@audius/common/services' import { - ID, - User, - removeNullable, - decodeHashId, cacheUsersSelectors, tippingActions, - SupportersMapForUser, UserListSagaFactory, - SupporterResponse, - topSupportersUserListSelectors, topSupportersUserListActions, + topSupportersUserListSelectors, TOP_SUPPORTERS_USER_LIST_TAG, - responseAdapter as adapter -} from '@audius/common' + SupportersMapForUser +} from '@audius/common/store' +import { decodeHashId, removeNullable } from '@audius/common/utils' import { put, select } from 'typed-redux-saga' import { watchTopSupportersError } from 'common/store/user-list/top-supporters/errorSagas' diff --git a/packages/web/src/common/store/user-list/utils.ts b/packages/web/src/common/store/user-list/utils.ts index fd1c92a23f7..02877b71f36 100644 --- a/packages/web/src/common/store/user-list/utils.ts +++ b/packages/web/src/common/store/user-list/utils.ts @@ -1,13 +1,10 @@ +import { ID, UserMetadata, User } from '@audius/common/models' +import { AudiusAPIClient, AudiusBackend } from '@audius/common/services' import { - ID, - User, - UserMetadata, accountSelectors, - getContext, - AudiusAPIClient, - AudiusBackend, - processAndCacheUsers -} from '@audius/common' + processAndCacheUsers, + getContext +} from '@audius/common/store' import { call, select } from 'typed-redux-saga' import { AppState } from 'store/types' diff --git a/packages/web/src/common/store/wallet/sagas.ts b/packages/web/src/common/store/wallet/sagas.ts index 54fb6cb56d8..7cfee438dc2 100644 --- a/packages/web/src/common/store/wallet/sagas.ts +++ b/packages/web/src/common/store/wallet/sagas.ts @@ -1,24 +1,27 @@ import { Name, Chain, + ErrorLevel, BNWei, - FeatureFlags, - stringWeiToBN, - weiToString, - getErrorMessage, - accountSelectors, + SolanaWalletAddress +} from '@audius/common/models' +import { FeatureFlags, createUserBankIfNeeded } from '@audius/common/services' +import { accountActions, + accountSelectors, tokenDashboardPageActions, + solanaSelectors, walletSelectors, - InputSendDataAction, walletActions, getContext, - ErrorLevel, - createUserBankIfNeeded, - solanaSelectors, - SolanaWalletAddress, - isNullOrUndefined -} from '@audius/common' + InputSendDataAction +} from '@audius/common/store' +import { + getErrorMessage, + isNullOrUndefined, + stringWeiToBN, + weiToString +} from '@audius/common/utils' import type { AudiusLibs } from '@audius/sdk' import BN from 'bn.js' import { all, call, put, take, takeEvery, select } from 'typed-redux-saga' diff --git a/packages/web/src/common/utils/ensureLoggedIn.ts b/packages/web/src/common/utils/ensureLoggedIn.ts index 347a4cb1462..f5463994fbd 100644 --- a/packages/web/src/common/utils/ensureLoggedIn.ts +++ b/packages/web/src/common/utils/ensureLoggedIn.ts @@ -1,4 +1,5 @@ -import { CreateAccountOpen, Name, accountSelectors } from '@audius/common' +import { Name, CreateAccountOpen } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { put, select, cancel } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/common/utils/isPreview.ts b/packages/web/src/common/utils/isPreview.ts index 64be4372c4d..0efbfeb4032 100644 --- a/packages/web/src/common/utils/isPreview.ts +++ b/packages/web/src/common/utils/isPreview.ts @@ -1,4 +1,4 @@ -import { ID, Track } from '@audius/common' +import { ID, Track } from '@audius/common/models' export const isPreview = (track: Track, currentUserId: ID | null) => { return !!track.preview_cid && track.owner_id !== currentUserId diff --git a/packages/web/src/common/utils/requiresAccount.ts b/packages/web/src/common/utils/requiresAccount.ts index c6710ef9cfb..b8c208d5759 100644 --- a/packages/web/src/common/utils/requiresAccount.ts +++ b/packages/web/src/common/utils/requiresAccount.ts @@ -1,4 +1,5 @@ -import { accountSelectors, getContext, waitForAccount } from '@audius/common' +import { accountSelectors, getContext } from '@audius/common/store' +import { waitForAccount } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { call, put, select } from 'typed-redux-saga' diff --git a/packages/web/src/components/actions-tab/ActionsTab.jsx b/packages/web/src/components/actions-tab/ActionsTab.jsx index 385f4c3139a..578adc44a0f 100644 --- a/packages/web/src/components/actions-tab/ActionsTab.jsx +++ b/packages/web/src/components/actions-tab/ActionsTab.jsx @@ -1,13 +1,12 @@ import { PureComponent } from 'react' +import { ShareSource, RepostSource } from '@audius/common/models' import { - ShareSource, - RepostSource, accountSelectors, collectionsSocialActions, tracksSocialActions, shareModalUIActions -} from '@audius/common' +} from '@audius/common/store' import cn from 'classnames' import PropTypes from 'prop-types' import { connect } from 'react-redux' diff --git a/packages/web/src/components/add-funds-modal/AddFundsModal.tsx b/packages/web/src/components/add-funds-modal/AddFundsModal.tsx index 98ede56d9ea..38c63ed6777 100644 --- a/packages/web/src/components/add-funds-modal/AddFundsModal.tsx +++ b/packages/web/src/components/add-funds-modal/AddFundsModal.tsx @@ -1,14 +1,13 @@ import { useCallback, useEffect, useState } from 'react' +import { DEFAULT_PURCHASE_AMOUNT_CENTS } from '@audius/common/hooks' +import { PurchaseMethod, PurchaseVendor } from '@audius/common/models' import { - useAddFundsModal, buyUSDCActions, - PurchaseMethod, - DEFAULT_PURCHASE_AMOUNT_CENTS, - PurchaseVendor, buyUSDCSelectors, - BuyUSDCStage -} from '@audius/common' + BuyUSDCStage, + useAddFundsModal +} from '@audius/common/store' import { ModalContent, ModalHeader } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/add-funds/AddFunds.tsx b/packages/web/src/components/add-funds/AddFunds.tsx index c2cf2491d6a..5b3617a5d16 100644 --- a/packages/web/src/components/add-funds/AddFunds.tsx +++ b/packages/web/src/components/add-funds/AddFunds.tsx @@ -1,11 +1,7 @@ import { useState } from 'react' -import { - PurchaseMethod, - PurchaseVendor, - useCreateUserbankIfNeeded, - useUSDCBalance -} from '@audius/common' +import { useUSDCBalance, useCreateUserbankIfNeeded } from '@audius/common/hooks' +import { PurchaseMethod, PurchaseVendor } from '@audius/common/models' import { USDC } from '@audius/fixed-decimal' import { Box, Button, Flex, Text, IconLogoCircleUSDC } from '@audius/harmony' import { BN } from 'bn.js' diff --git a/packages/web/src/components/add-to-collection/desktop/AddToCollectionModal.tsx b/packages/web/src/components/add-to-collection/desktop/AddToCollectionModal.tsx index c2c17215ca6..bd487caf7c3 100644 --- a/packages/web/src/components/add-to-collection/desktop/AddToCollectionModal.tsx +++ b/packages/web/src/components/add-to-collection/desktop/AddToCollectionModal.tsx @@ -2,15 +2,17 @@ import { useMemo, useState } from 'react' import { CreatePlaylistSource, - Collection, SquareSizes, + Collection +} from '@audius/common/models' +import { accountSelectors, cacheCollectionsActions, collectionPageSelectors, addToCollectionUISelectors, duplicateAddConfirmationModalUIActions, toastActions -} from '@audius/common' +} from '@audius/common/store' import { Modal, Scrollbar } from '@audius/stems' import cn from 'classnames' import { capitalize } from 'lodash' diff --git a/packages/web/src/components/add-to-collection/mobile/AddToCollection.tsx b/packages/web/src/components/add-to-collection/mobile/AddToCollection.tsx index a40231bfc30..c21abd74f01 100644 --- a/packages/web/src/components/add-to-collection/mobile/AddToCollection.tsx +++ b/packages/web/src/components/add-to-collection/mobile/AddToCollection.tsx @@ -1,14 +1,12 @@ import { useCallback, useContext } from 'react' +import { CreatePlaylistSource, Collection, ID } from '@audius/common/models' import { - ID, - CreatePlaylistSource, - Collection, accountSelectors, cacheCollectionsActions, - addToCollectionUIActions, - addToCollectionUISelectors -} from '@audius/common' + addToCollectionUISelectors, + addToCollectionUIActions +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { capitalize } from 'lodash' import { connect } from 'react-redux' diff --git a/packages/web/src/components/address-tile/AddressTile.tsx b/packages/web/src/components/address-tile/AddressTile.tsx index 07d4231accb..5334ca15b42 100644 --- a/packages/web/src/components/address-tile/AddressTile.tsx +++ b/packages/web/src/components/address-tile/AddressTile.tsx @@ -1,6 +1,7 @@ import { useCallback, useContext } from 'react' -import { shortenSPLAddress, useUSDCBalance } from '@audius/common' +import { useUSDCBalance } from '@audius/common/hooks' +import { shortenSPLAddress } from '@audius/common/utils' import { USDC } from '@audius/fixed-decimal' import { Text, diff --git a/packages/web/src/components/ai-attribution-modal/AiAttributionDropdown.tsx b/packages/web/src/components/ai-attribution-modal/AiAttributionDropdown.tsx index 8675dbba7d2..67d1da63573 100644 --- a/packages/web/src/components/ai-attribution-modal/AiAttributionDropdown.tsx +++ b/packages/web/src/components/ai-attribution-modal/AiAttributionDropdown.tsx @@ -1,11 +1,8 @@ import { useCallback, useState } from 'react' -import { - Kind, - SquareSizes, - getTierForUser, - imageProfilePicEmpty -} from '@audius/common' +import { imageProfilePicEmpty } from '@audius/common/assets' +import { SquareSizes, Kind } from '@audius/common/models' +import { getTierForUser } from '@audius/common/store' import { SelectProps } from 'antd' import { useDispatch } from 'react-redux' import { createSelector } from 'reselect' diff --git a/packages/web/src/components/ai-attribution-modal/AiAttributionModal.tsx b/packages/web/src/components/ai-attribution-modal/AiAttributionModal.tsx index 711c7028448..a21eb491ac1 100644 --- a/packages/web/src/components/ai-attribution-modal/AiAttributionModal.tsx +++ b/packages/web/src/components/ai-attribution-modal/AiAttributionModal.tsx @@ -1,6 +1,7 @@ import { useCallback, useState } from 'react' -import { ID, Nullable } from '@audius/common' +import { ID } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { Button, ButtonSize, diff --git a/packages/web/src/components/ai-attribution-modal/SearchBarResult.jsx b/packages/web/src/components/ai-attribution-modal/SearchBarResult.jsx index 0753139b2dc..14197f504e5 100644 --- a/packages/web/src/components/ai-attribution-modal/SearchBarResult.jsx +++ b/packages/web/src/components/ai-attribution-modal/SearchBarResult.jsx @@ -1,10 +1,8 @@ import { useState, useEffect, memo, useCallback } from 'react' -import { - Kind, - imageBlank as placeholderArt, - cacheUsersActions -} from '@audius/common' +import { imageBlank as placeholderArt } from '@audius/common/assets' +import { Kind } from '@audius/common/models' +import { cacheUsersActions } from '@audius/common/store' import { Tag } from '@audius/stems' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/ai-attribution-settings-modal/AiAttributionSettingsModal.tsx b/packages/web/src/components/ai-attribution-settings-modal/AiAttributionSettingsModal.tsx index 885c1580228..bb633bed9b5 100644 --- a/packages/web/src/components/ai-attribution-settings-modal/AiAttributionSettingsModal.tsx +++ b/packages/web/src/components/ai-attribution-settings-modal/AiAttributionSettingsModal.tsx @@ -1,6 +1,9 @@ import { useCallback } from 'react' -import { settingsPageActions, settingsPageSelectors } from '@audius/common' +import { + settingsPageSelectors, + settingsPageActions +} from '@audius/common/store' import { Button, ButtonSize, diff --git a/packages/web/src/components/animated-button/AnimatedButtonProvider.tsx b/packages/web/src/components/animated-button/AnimatedButtonProvider.tsx index 807d22d0db5..8b569be428f 100644 --- a/packages/web/src/components/animated-button/AnimatedButtonProvider.tsx +++ b/packages/web/src/components/animated-button/AnimatedButtonProvider.tsx @@ -7,7 +7,7 @@ import { MouseEvent } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import cn from 'classnames' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/animated-button/AnimatedIconButton.tsx b/packages/web/src/components/animated-button/AnimatedIconButton.tsx index e697711ce5c..275c3710889 100644 --- a/packages/web/src/components/animated-button/AnimatedIconButton.tsx +++ b/packages/web/src/components/animated-button/AnimatedIconButton.tsx @@ -1,6 +1,6 @@ import { useState, MouseEvent } from 'react' -import { uuid } from '@audius/common' +import { uuid } from '@audius/common/utils' import AnimatedButtonProvider from './AnimatedButtonProvider' diff --git a/packages/web/src/components/animated-switch/AnimatedSwitch.tsx b/packages/web/src/components/animated-switch/AnimatedSwitch.tsx index fdadc820f47..615f4a5d602 100644 --- a/packages/web/src/components/animated-switch/AnimatedSwitch.tsx +++ b/packages/web/src/components/animated-switch/AnimatedSwitch.tsx @@ -7,7 +7,7 @@ import { CSSProperties } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { Switch, useHistory } from 'react-router-dom' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useTransition, animated } from 'react-spring' diff --git a/packages/web/src/components/app-cta-modal/AppCTAModal.tsx b/packages/web/src/components/app-cta-modal/AppCTAModal.tsx index a28289712b7..6256f392e87 100644 --- a/packages/web/src/components/app-cta-modal/AppCTAModal.tsx +++ b/packages/web/src/components/app-cta-modal/AppCTAModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { Modal, Button, IconDownload, ButtonType } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx b/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx index 7ee75790c06..463eb7ccc45 100644 --- a/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx +++ b/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { MobileOS } from '@audius/common' +import { MobileOS } from '@audius/common/models' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { useHistory } from 'react-router-dom' diff --git a/packages/web/src/components/artist-recommendations/ArtistRecommendations.tsx b/packages/web/src/components/artist-recommendations/ArtistRecommendations.tsx index b4c69a3fcf4..652c61a8af7 100644 --- a/packages/web/src/components/artist-recommendations/ArtistRecommendations.tsx +++ b/packages/web/src/components/artist-recommendations/ArtistRecommendations.tsx @@ -1,18 +1,20 @@ import { forwardRef, ReactNode, useCallback, useEffect, useState } from 'react' import { - ID, - FollowSource, Name, - ProfilePictureSizes, + FollowSource, SquareSizes, - User, + ID, + ProfilePictureSizes, + User +} from '@audius/common/models' +import { + cacheUsersSelectors, + usersSocialActions as socialActions, relatedArtistsUISelectors, relatedArtistsUIActions, - usersSocialActions as socialActions, - cacheUsersSelectors, CommonState -} from '@audius/common' +} from '@audius/common/store' import cn from 'classnames' import { push } from 'connected-react-router' import { isEmpty } from 'lodash' diff --git a/packages/web/src/components/artist-recommendations/ArtistRecommendationsPopup.tsx b/packages/web/src/components/artist-recommendations/ArtistRecommendationsPopup.tsx index 442827e8a34..b2c770be08c 100644 --- a/packages/web/src/components/artist-recommendations/ArtistRecommendationsPopup.tsx +++ b/packages/web/src/components/artist-recommendations/ArtistRecommendationsPopup.tsx @@ -1,6 +1,7 @@ import { RefObject, useContext } from 'react' -import { ID, User, cacheUsersSelectors } from '@audius/common' +import { ID, User } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import { Popup, PopupPosition } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/artist/ArtistCard.tsx b/packages/web/src/components/artist/ArtistCard.tsx index 1187ce754fb..3cc0452fe22 100644 --- a/packages/web/src/components/artist/ArtistCard.tsx +++ b/packages/web/src/components/artist/ArtistCard.tsx @@ -1,11 +1,7 @@ import { MouseEventHandler, useCallback, useMemo } from 'react' -import { - FollowSource, - User, - profilePageActions, - usersSocialActions -} from '@audius/common' +import { FollowSource, User } from '@audius/common/models' +import { profilePageActions, usersSocialActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import { FollowButton } from 'components/follow-button/FollowButton' diff --git a/packages/web/src/components/artist/ArtistCardCover.tsx b/packages/web/src/components/artist/ArtistCardCover.tsx index d16948cdef7..3fba2307e36 100644 --- a/packages/web/src/components/artist/ArtistCardCover.tsx +++ b/packages/web/src/components/artist/ArtistCardCover.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { SquareSizes, WidthSizes, User } from '@audius/common' +import { SquareSizes, WidthSizes, User } from '@audius/common/models' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/artist/ArtistChip.tsx b/packages/web/src/components/artist/ArtistChip.tsx index 05c2f7a010a..b118a1e77ff 100644 --- a/packages/web/src/components/artist/ArtistChip.tsx +++ b/packages/web/src/components/artist/ArtistChip.tsx @@ -1,6 +1,6 @@ import { ComponentPropsWithoutRef } from 'react' -import { ID, SquareSizes, User } from '@audius/common' +import { SquareSizes, ID, User } from '@audius/common/models' import cn from 'classnames' import { ArtistPopover } from 'components/artist/ArtistPopover' diff --git a/packages/web/src/components/artist/ArtistChipFollowers.tsx b/packages/web/src/components/artist/ArtistChipFollowers.tsx index 5f24fa7ea72..aeaaf54db79 100644 --- a/packages/web/src/components/artist/ArtistChipFollowers.tsx +++ b/packages/web/src/components/artist/ArtistChipFollowers.tsx @@ -1,4 +1,5 @@ -import { ID, formatCount } from '@audius/common' +import { ID } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import IconUser from 'assets/img/iconUser.svg' diff --git a/packages/web/src/components/artist/ArtistChipSupportFor.tsx b/packages/web/src/components/artist/ArtistChipSupportFor.tsx index 0d6a1a6d7cf..32409c8bf36 100644 --- a/packages/web/src/components/artist/ArtistChipSupportFor.tsx +++ b/packages/web/src/components/artist/ArtistChipSupportFor.tsx @@ -1,13 +1,8 @@ import { useEffect, useState } from 'react' -import { - ID, - StringWei, - Nullable, - formatWei, - stringWeiToBN, - tippingSelectors -} from '@audius/common' +import { ID, StringWei } from '@audius/common/models' +import { tippingSelectors } from '@audius/common/store' +import { stringWeiToBN, formatWei, Nullable } from '@audius/common/utils' import { IconTrophy, IconTrending } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/artist/ArtistChipSupportFrom.tsx b/packages/web/src/components/artist/ArtistChipSupportFrom.tsx index 635fa6d2f04..e73ffbf89bc 100644 --- a/packages/web/src/components/artist/ArtistChipSupportFrom.tsx +++ b/packages/web/src/components/artist/ArtistChipSupportFrom.tsx @@ -1,13 +1,8 @@ import { useEffect, useState } from 'react' -import { - ID, - StringWei, - Nullable, - formatWei, - stringWeiToBN, - tippingSelectors -} from '@audius/common' +import { ID, StringWei } from '@audius/common/models' +import { tippingSelectors } from '@audius/common/store' +import { stringWeiToBN, formatWei, Nullable } from '@audius/common/utils' import cn from 'classnames' import IconTip from 'assets/img/iconTip.svg' diff --git a/packages/web/src/components/artist/ArtistCover.tsx b/packages/web/src/components/artist/ArtistCover.tsx index 26bf9faff8d..98f4a67a49f 100644 --- a/packages/web/src/components/artist/ArtistCover.tsx +++ b/packages/web/src/components/artist/ArtistCover.tsx @@ -1,10 +1,10 @@ import { + SquareSizes, + WidthSizes, ID, - CoverPhotoSizes, ProfilePictureSizes, - SquareSizes, - WidthSizes -} from '@audius/common' + CoverPhotoSizes +} from '@audius/common/models' import BadgeArtist from 'assets/img/badgeArtist.svg' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/components/artist/ArtistPopover.tsx b/packages/web/src/components/artist/ArtistPopover.tsx index 23614740a9f..1d43c85d92d 100644 --- a/packages/web/src/components/artist/ArtistPopover.tsx +++ b/packages/web/src/components/artist/ArtistPopover.tsx @@ -1,12 +1,11 @@ import { useCallback, ReactNode, useState } from 'react' +import { SquareSizes, WidthSizes } from '@audius/common/models' import { - WidthSizes, - SquareSizes, accountSelectors, - CommonState, - cacheUsersSelectors -} from '@audius/common' + cacheUsersSelectors, + CommonState +} from '@audius/common/store' import Popover from 'antd/lib/popover' import cn from 'classnames' diff --git a/packages/web/src/components/artist/ArtistSupporting.tsx b/packages/web/src/components/artist/ArtistSupporting.tsx index 6d87fc3e404..ae24655e892 100644 --- a/packages/web/src/components/artist/ArtistSupporting.tsx +++ b/packages/web/src/components/artist/ArtistSupporting.tsx @@ -1,16 +1,17 @@ import { useCallback, useEffect } from 'react' +import { ID, User } from '@audius/common/models' import { - ID, - User, - stringWeiToBN, cacheUsersSelectors, tippingSelectors, tippingActions, userListActions, - SUPPORTING_USER_LIST_TAG as SUPPORTING_TAG, + SUPPORTING_USER_LIST_TAG as SUPPORTING_TAG +} from '@audius/common/store' +import { + stringWeiToBN, MAX_ARTIST_HOVER_TOP_SUPPORTING -} from '@audius/common' +} from '@audius/common/utils' import { useDispatch } from 'react-redux' import IconTip from 'assets/img/iconTip.svg' diff --git a/packages/web/src/components/audio-balance-pill/AUDIOBalancePill.tsx b/packages/web/src/components/audio-balance-pill/AUDIOBalancePill.tsx index 23d5eb348aa..904c3f99110 100644 --- a/packages/web/src/components/audio-balance-pill/AUDIOBalancePill.tsx +++ b/packages/web/src/components/audio-balance-pill/AUDIOBalancePill.tsx @@ -1,12 +1,11 @@ import { cloneElement } from 'react' import { - accountSelectors, - formatWei, - isNullOrUndefined, useSelectTierInfo, useTotalBalanceWithFallback -} from '@audius/common' +} from '@audius/common/hooks' +import { accountSelectors } from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import BN from 'bn.js' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/audio-transaction-icon/AudioTransactionIcon.tsx b/packages/web/src/components/audio-transaction-icon/AudioTransactionIcon.tsx index ead6f596849..a90bc647d74 100644 --- a/packages/web/src/components/audio-transaction-icon/AudioTransactionIcon.tsx +++ b/packages/web/src/components/audio-transaction-icon/AudioTransactionIcon.tsx @@ -1,6 +1,6 @@ import React, { ReactNode } from 'react' -import { TransactionMethod, TransactionType } from '@audius/common' +import { TransactionType, TransactionMethod } from '@audius/common/store' import cn from 'classnames' import AppIcon from 'assets/img/appIcon.png' diff --git a/packages/web/src/components/audio-transactions-table/AudioTransactionsTable.tsx b/packages/web/src/components/audio-transactions-table/AudioTransactionsTable.tsx index 1508ae98d08..0890f27df79 100644 --- a/packages/web/src/components/audio-transactions-table/AudioTransactionsTable.tsx +++ b/packages/web/src/components/audio-transactions-table/AudioTransactionsTable.tsx @@ -1,12 +1,12 @@ import { MouseEvent, useCallback, useMemo } from 'react' +import { Kind } from '@audius/common/models' import { - formatAudio, - TransactionMethod, TransactionType, - Kind, + TransactionMethod, TransactionDetails -} from '@audius/common' +} from '@audius/common/store' +import { formatAudio } from '@audius/common/utils' import cn from 'classnames' import moment from 'moment' import { Cell, Row } from 'react-table' diff --git a/packages/web/src/components/avatar/Avatar.tsx b/packages/web/src/components/avatar/Avatar.tsx index cbf40598e42..f103c139dd3 100644 --- a/packages/web/src/components/avatar/Avatar.tsx +++ b/packages/web/src/components/avatar/Avatar.tsx @@ -1,11 +1,7 @@ -import { - ID, - Maybe, - SquareSizes, - accountSelectors, - cacheUsersSelectors, - imageProfilePicEmpty -} from '@audius/common' +import { imageProfilePicEmpty } from '@audius/common/assets' +import { SquareSizes, ID } from '@audius/common/models' +import { accountSelectors, cacheUsersSelectors } from '@audius/common/store' +import { Maybe } from '@audius/common/utils' import { Box, Avatar as HarmonyAvatar, diff --git a/packages/web/src/components/avatar/AvatarLegacy.tsx b/packages/web/src/components/avatar/AvatarLegacy.tsx index 41dbf5b724d..d8f268bc1f1 100644 --- a/packages/web/src/components/avatar/AvatarLegacy.tsx +++ b/packages/web/src/components/avatar/AvatarLegacy.tsx @@ -1,11 +1,7 @@ -import { - ID, - Maybe, - SquareSizes, - accountSelectors, - cacheUsersSelectors, - imageProfilePicEmpty -} from '@audius/common' +import { imageProfilePicEmpty } from '@audius/common/assets' +import { SquareSizes, ID } from '@audius/common/models' +import { accountSelectors, cacheUsersSelectors } from '@audius/common/store' +import { Maybe } from '@audius/common/utils' import { Link } from 'react-router-dom' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/components/background-animations/MusicConfetti.tsx b/packages/web/src/components/background-animations/MusicConfetti.tsx index 99ee36b5ac8..e8b6aab8268 100644 --- a/packages/web/src/components/background-animations/MusicConfetti.tsx +++ b/packages/web/src/components/background-animations/MusicConfetti.tsx @@ -1,6 +1,6 @@ import { useRef, useCallback, useEffect, useState, useMemo } from 'react' -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import Confetti from 'utils/animations/music-confetti' import { getCurrentThemeColors } from 'utils/theme/theme' diff --git a/packages/web/src/components/banner/CallToActionBanner.tsx b/packages/web/src/components/banner/CallToActionBanner.tsx index 4b3efcaf329..02f14793632 100644 --- a/packages/web/src/components/banner/CallToActionBanner.tsx +++ b/packages/web/src/components/banner/CallToActionBanner.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react' -import { Client } from '@audius/common' +import { Client } from '@audius/common/models' import { IconArrowWhite } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/banner/DirectMessagesBanner.tsx b/packages/web/src/components/banner/DirectMessagesBanner.tsx index efda0bb5d9b..dba3855bd5b 100644 --- a/packages/web/src/components/banner/DirectMessagesBanner.tsx +++ b/packages/web/src/components/banner/DirectMessagesBanner.tsx @@ -1,6 +1,7 @@ import { useCallback, useState } from 'react' -import { Name, accountSelectors } from '@audius/common' +import { Name } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/banner/DownloadAppBanner.tsx b/packages/web/src/components/banner/DownloadAppBanner.tsx index 425165ece68..14f206d4c6e 100644 --- a/packages/web/src/components/banner/DownloadAppBanner.tsx +++ b/packages/web/src/components/banner/DownloadAppBanner.tsx @@ -1,6 +1,7 @@ import { useCallback, useState } from 'react' -import { Client, accountSelectors } from '@audius/common' +import { Client } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'common/hooks/useSelector' diff --git a/packages/web/src/components/banner/TermsOfServiceUpdateBanner.tsx b/packages/web/src/components/banner/TermsOfServiceUpdateBanner.tsx index 1708440a58b..8790ab2f10a 100644 --- a/packages/web/src/components/banner/TermsOfServiceUpdateBanner.tsx +++ b/packages/web/src/components/banner/TermsOfServiceUpdateBanner.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { useDispatch } from 'react-redux' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/browser-push-confirmation-modal/BrowserPushConfirmationModal.tsx b/packages/web/src/components/browser-push-confirmation-modal/BrowserPushConfirmationModal.tsx index 5549a036486..8c815730f32 100644 --- a/packages/web/src/components/browser-push-confirmation-modal/BrowserPushConfirmationModal.tsx +++ b/packages/web/src/components/browser-push-confirmation-modal/BrowserPushConfirmationModal.tsx @@ -4,9 +4,9 @@ import { accountActions, settingsPageSelectors, settingsPageActions as settingPageActions, - modalsActions, - modalsSelectors -} from '@audius/common' + modalsSelectors, + modalsActions +} from '@audius/common/store' import { Modal, Anchor, Button, ButtonType, ButtonSize } from '@audius/stems' import cn from 'classnames' import { connect } from 'react-redux' diff --git a/packages/web/src/components/buy-audio-modal/BuyAudioModal.tsx b/packages/web/src/components/buy-audio-modal/BuyAudioModal.tsx index e934dce0059..e26728c786f 100644 --- a/packages/web/src/components/buy-audio-modal/BuyAudioModal.tsx +++ b/packages/web/src/components/buy-audio-modal/BuyAudioModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { buyAudioSelectors, BuyAudioStage } from '@audius/common' +import { buyAudioSelectors, BuyAudioStage } from '@audius/common/store' import { Modal, ModalContentPages, diff --git a/packages/web/src/components/buy-audio-modal/components/AmountInputPage.tsx b/packages/web/src/components/buy-audio-modal/components/AmountInputPage.tsx index 717aab2fa4d..83333bee213 100644 --- a/packages/web/src/components/buy-audio-modal/components/AmountInputPage.tsx +++ b/packages/web/src/components/buy-audio-modal/components/AmountInputPage.tsx @@ -1,11 +1,11 @@ import { useCallback, useMemo } from 'react' +import { StringKeys } from '@audius/common/services' import { buyAudioActions, buyAudioSelectors, - OnRampProvider, - StringKeys -} from '@audius/common' + OnRampProvider +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useRemoteVar } from 'hooks/useRemoteConfig' diff --git a/packages/web/src/components/buy-audio-modal/components/CoinbaseBuyAudioButton.tsx b/packages/web/src/components/buy-audio-modal/components/CoinbaseBuyAudioButton.tsx index b388f2b0628..9b633eb08e2 100644 --- a/packages/web/src/components/buy-audio-modal/components/CoinbaseBuyAudioButton.tsx +++ b/packages/web/src/components/buy-audio-modal/components/CoinbaseBuyAudioButton.tsx @@ -1,11 +1,11 @@ import { useCallback, useContext } from 'react' +import { Status } from '@audius/common/models' import { buyAudioActions, buyAudioSelectors, - OnRampProvider, - Status -} from '@audius/common' + OnRampProvider +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { useAsync } from 'react-use' diff --git a/packages/web/src/components/buy-audio-modal/components/InProgressPage.tsx b/packages/web/src/components/buy-audio-modal/components/InProgressPage.tsx index 3fcdaa79095..8fb275b2537 100644 --- a/packages/web/src/components/buy-audio-modal/components/InProgressPage.tsx +++ b/packages/web/src/components/buy-audio-modal/components/InProgressPage.tsx @@ -2,10 +2,10 @@ import { ReactNode } from 'react' import { buyAudioSelectors, - BuyAudioStage, - formatNumberString, - OnRampProvider -} from '@audius/common' + OnRampProvider, + BuyAudioStage +} from '@audius/common/store' +import { formatNumberString } from '@audius/common/utils' import { IconCaretDown, IconMultiselectRemove } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/buy-audio-modal/components/PurchaseQuote.tsx b/packages/web/src/components/buy-audio-modal/components/PurchaseQuote.tsx index a4bd5732590..5a6e4cdd5f2 100644 --- a/packages/web/src/components/buy-audio-modal/components/PurchaseQuote.tsx +++ b/packages/web/src/components/buy-audio-modal/components/PurchaseQuote.tsx @@ -1,9 +1,6 @@ -import { - Status, - PurchaseInfoErrorType, - buyAudioSelectors, - formatNumberString -} from '@audius/common' +import { Status } from '@audius/common/models' +import { buyAudioSelectors, PurchaseInfoErrorType } from '@audius/common/store' +import { formatNumberString } from '@audius/common/utils' import { IconCaretDown } from '@audius/stems' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/buy-audio-modal/components/StripeBuyAudioButton.tsx b/packages/web/src/components/buy-audio-modal/components/StripeBuyAudioButton.tsx index c3326635045..c6c6c1ceed5 100644 --- a/packages/web/src/components/buy-audio-modal/components/StripeBuyAudioButton.tsx +++ b/packages/web/src/components/buy-audio-modal/components/StripeBuyAudioButton.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' import { + stripeModalUIActions, buyAudioActions, buyAudioSelectors, - stripeModalUIActions, - OnRampProvider, - modalsActions -} from '@audius/common' + modalsActions, + OnRampProvider +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { OnRampButton } from 'components/on-ramp-button' diff --git a/packages/web/src/components/buy-audio-modal/components/SuccessPage.tsx b/packages/web/src/components/buy-audio-modal/components/SuccessPage.tsx index 47762a82947..c08097a213e 100644 --- a/packages/web/src/components/buy-audio-modal/components/SuccessPage.tsx +++ b/packages/web/src/components/buy-audio-modal/components/SuccessPage.tsx @@ -1,14 +1,13 @@ import { useCallback } from 'react' +import { Status } from '@audius/common/models' import { - Status, - transactionDetailsSelectors, - transactionDetailsActions, - modalsActions, buyAudioSelectors, - formatAudio, - isNullOrUndefined -} from '@audius/common' + transactionDetailsActions, + transactionDetailsSelectors, + modalsActions +} from '@audius/common/store' +import { formatAudio, isNullOrUndefined } from '@audius/common/utils' import { Button, ButtonSize, ButtonType, IconInfo } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/card/UserCard.jsx b/packages/web/src/components/card/UserCard.jsx index 44fd842d70f..658a26f89ec 100644 --- a/packages/web/src/components/card/UserCard.jsx +++ b/packages/web/src/components/card/UserCard.jsx @@ -1,4 +1,5 @@ -import { SquareSizes, formatCount } from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/card/desktop/Card.tsx b/packages/web/src/components/card/desktop/Card.tsx index 950a03d5c38..dfbbb357681 100644 --- a/packages/web/src/components/card/desktop/Card.tsx +++ b/packages/web/src/components/card/desktop/Card.tsx @@ -8,15 +8,15 @@ import { MouseEventHandler } from 'react' +import { imageBlank as placeholderArt } from '@audius/common/assets' import { - ID, - ProfilePictureSizes, + DogEarType, SquareSizes, + ID, CoverArtSizes, - pluralize, - imageBlank as placeholderArt, - DogEarType -} from '@audius/common' + ProfilePictureSizes +} from '@audius/common/models' +import { pluralize } from '@audius/common/utils' import cn from 'classnames' import IconKebabHorizontal from 'assets/img/iconKebabHorizontal.svg' diff --git a/packages/web/src/components/card/desktop/CollectionArtCard.tsx b/packages/web/src/components/card/desktop/CollectionArtCard.tsx index dcdc175e4ae..ed5f06a8840 100644 --- a/packages/web/src/components/card/desktop/CollectionArtCard.tsx +++ b/packages/web/src/components/card/desktop/CollectionArtCard.tsx @@ -1,13 +1,12 @@ import { useCallback, useEffect, useState } from 'react' +import { imageBlank as placeholderArt } from '@audius/common/assets' +import { SquareSizes, ID } from '@audius/common/models' import { - ID, - SquareSizes, accountSelectors, cacheCollectionsSelectors, - cacheUsersSelectors, - imageBlank as placeholderArt -} from '@audius/common' + cacheUsersSelectors +} from '@audius/common/store' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' diff --git a/packages/web/src/components/card/desktop/UserArtCard.tsx b/packages/web/src/components/card/desktop/UserArtCard.tsx index d9232b579da..185f0e7cbca 100644 --- a/packages/web/src/components/card/desktop/UserArtCard.tsx +++ b/packages/web/src/components/card/desktop/UserArtCard.tsx @@ -1,12 +1,9 @@ import { useCallback, useEffect } from 'react' -import { - ID, - SquareSizes, - formatCount, - cacheUsersSelectors, - imageBlank as placeholderArt -} from '@audius/common' +import { imageBlank as placeholderArt } from '@audius/common/assets' +import { SquareSizes, ID } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' diff --git a/packages/web/src/components/card/mobile/Card.tsx b/packages/web/src/components/card/mobile/Card.tsx index ec9436d4c04..ea77089aefb 100644 --- a/packages/web/src/components/card/mobile/Card.tsx +++ b/packages/web/src/components/card/mobile/Card.tsx @@ -1,13 +1,13 @@ import React, { MouseEvent, ReactNode } from 'react' +import { imageBlank as placeholderArt } from '@audius/common/assets' import { - ID, - ProfilePictureSizes, SquareSizes, + ID, CoverArtSizes, - pluralize, - imageBlank as placeholderArt -} from '@audius/common' + ProfilePictureSizes +} from '@audius/common/models' +import { pluralize } from '@audius/common/utils' import cn from 'classnames' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/components/change-password/ChangePassword.tsx b/packages/web/src/components/change-password/ChangePassword.tsx index a8ebea3996f..787bb2cb045 100644 --- a/packages/web/src/components/change-password/ChangePassword.tsx +++ b/packages/web/src/components/change-password/ChangePassword.tsx @@ -1,11 +1,11 @@ import { useCallback, useEffect, useState } from 'react' +import { Status } from '@audius/common/models' import { - Status, - ChangePasswordPageStep, changePasswordSelectors, - changePasswordActions -} from '@audius/common' + changePasswordActions, + ChangePasswordPageStep +} from '@audius/common/store' import { Button, ButtonType, IconLock } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/change-password/ChangePasswordModal.tsx b/packages/web/src/components/change-password/ChangePasswordModal.tsx index 2a99391cb79..ecb12ff0c7f 100644 --- a/packages/web/src/components/change-password/ChangePasswordModal.tsx +++ b/packages/web/src/components/change-password/ChangePasswordModal.tsx @@ -1,11 +1,11 @@ import { useEffect } from 'react' +import { Name } from '@audius/common/models' import { - Name, - ChangePasswordPageStep, changePasswordSelectors, - changePasswordActions -} from '@audius/common' + changePasswordActions, + ChangePasswordPageStep +} from '@audius/common/store' import { Modal } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/change-password/ConfirmCredentials.tsx b/packages/web/src/components/change-password/ConfirmCredentials.tsx index 057d47bfaeb..3e197004e5e 100644 --- a/packages/web/src/components/change-password/ConfirmCredentials.tsx +++ b/packages/web/src/components/change-password/ConfirmCredentials.tsx @@ -1,10 +1,10 @@ import { FormEvent, useEffect, useState } from 'react' +import { Status } from '@audius/common/models' import { - Status, changePasswordSelectors, changePasswordActions -} from '@audius/common' +} from '@audius/common/store' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/chat-listener/ChatListener.tsx b/packages/web/src/components/chat-listener/ChatListener.tsx index 153e009e7af..5c69939f800 100644 --- a/packages/web/src/components/chat-listener/ChatListener.tsx +++ b/packages/web/src/components/chat-listener/ChatListener.tsx @@ -1,6 +1,7 @@ import { useEffect } from 'react' -import { Status, accountSelectors, chatActions } from '@audius/common' +import { Status } from '@audius/common/models' +import { accountSelectors, chatActions } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' const { connect, disconnect, fetchMoreChats, fetchUnreadMessagesCount } = diff --git a/packages/web/src/components/co-sign/CoSign.tsx b/packages/web/src/components/co-sign/CoSign.tsx index 5cb6866e5ee..18032087e81 100644 --- a/packages/web/src/components/co-sign/CoSign.tsx +++ b/packages/web/src/components/co-sign/CoSign.tsx @@ -1,6 +1,6 @@ import { useMemo, ReactNode, RefObject } from 'react' -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import cn from 'classnames' import Tooltip from 'components/tooltip/Tooltip' diff --git a/packages/web/src/components/co-sign/HoverInfo.tsx b/packages/web/src/components/co-sign/HoverInfo.tsx index 02fe11a9b50..35e5d5db153 100644 --- a/packages/web/src/components/co-sign/HoverInfo.tsx +++ b/packages/web/src/components/co-sign/HoverInfo.tsx @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import IconHeart from 'assets/img/iconHeart.svg' import IconRepost from 'assets/img/iconRepost.svg' diff --git a/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx b/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx index 9aee9472716..10af5769e8e 100644 --- a/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx +++ b/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx @@ -1,10 +1,10 @@ import { useCallback, useEffect, useState } from 'react' +import { useCoinflowAdapter } from '@audius/common/hooks' import { - useCoinflowOnrampModal, coinflowModalUIActions, - useCoinflowAdapter -} from '@audius/common' + useCoinflowOnrampModal +} from '@audius/common/store' import { CoinflowPurchase } from '@coinflowlabs/react' import { Transaction } from '@solana/web3.js' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/collectibles-playlist-table/CollectiblesPlaylistTable.tsx b/packages/web/src/components/collectibles-playlist-table/CollectiblesPlaylistTable.tsx index dff534c510d..eaa6d5eb367 100644 --- a/packages/web/src/components/collectibles-playlist-table/CollectiblesPlaylistTable.tsx +++ b/packages/web/src/components/collectibles-playlist-table/CollectiblesPlaylistTable.tsx @@ -1,6 +1,7 @@ import { useCallback, useMemo, MouseEvent } from 'react' -import { Chain, formatSeconds } from '@audius/common' +import { Chain } from '@audius/common/models' +import { formatSeconds } from '@audius/common/utils' import cn from 'classnames' import { Cell, Row } from 'react-table' diff --git a/packages/web/src/components/collectibles/components/CollectibleDetails.tsx b/packages/web/src/components/collectibles/components/CollectibleDetails.tsx index 18dc9f8c302..750e94bcd46 100644 --- a/packages/web/src/components/collectibles/components/CollectibleDetails.tsx +++ b/packages/web/src/components/collectibles/components/CollectibleDetails.tsx @@ -1,13 +1,11 @@ import { useCallback, useEffect, useState } from 'react' +import { Chain, CollectibleMediaType, Collectible } from '@audius/common/models' import { - Chain, - Collectible, - CollectibleMediaType, profilePageSelectors, - collectibleDetailsUIActions, - getHash -} from '@audius/common' + collectibleDetailsUIActions +} from '@audius/common/store' +import { getHash } from '@audius/common/utils' import { LogoEth, LogoSol } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx b/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx index e543666c315..b5694bae575 100644 --- a/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx +++ b/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx @@ -7,17 +7,15 @@ import { useState } from 'react' +import { useSelectTierInfo } from '@audius/common/hooks' +import { Chain, CollectibleMediaType, Collectible } from '@audius/common/models' import { - Chain, - Collectible, - CollectibleMediaType, - formatDateWithTimezoneOffset, accountSelectors, badgeTiers, collectibleDetailsUISelectors, - collectibleDetailsUIActions, - useSelectTierInfo -} from '@audius/common' + collectibleDetailsUIActions +} from '@audius/common/store' +import { formatDateWithTimezoneOffset } from '@audius/common/utils' import { Button, ButtonSize, diff --git a/packages/web/src/components/collectibles/components/CollectibleRow.tsx b/packages/web/src/components/collectibles/components/CollectibleRow.tsx index e01b6535f45..3226fd4984b 100644 --- a/packages/web/src/components/collectibles/components/CollectibleRow.tsx +++ b/packages/web/src/components/collectibles/components/CollectibleRow.tsx @@ -1,10 +1,7 @@ import { useEffect, useRef, useState } from 'react' -import { - Collectible, - CollectibleMediaType, - formatDateWithTimezoneOffset -} from '@audius/common' +import { CollectibleMediaType, Collectible } from '@audius/common/models' +import { formatDateWithTimezoneOffset } from '@audius/common/utils' import cn from 'classnames' import IconDrag from 'assets/img/iconDrag.svg' diff --git a/packages/web/src/components/collectibles/components/CollectiblesPage.tsx b/packages/web/src/components/collectibles/components/CollectiblesPage.tsx index 2fe8b41a8bb..b76a9417cb7 100644 --- a/packages/web/src/components/collectibles/components/CollectiblesPage.tsx +++ b/packages/web/src/components/collectibles/components/CollectiblesPage.tsx @@ -7,15 +7,14 @@ import { useState } from 'react' +import { useInstanceVar } from '@audius/common/hooks' +import { CollectiblesMetadata, Collectible } from '@audius/common/models' import { - Collectible, - CollectiblesMetadata, - useInstanceVar, - ProfileUser, collectibleDetailsUISelectors, collectibleDetailsUIActions, - getHash -} from '@audius/common' + ProfileUser +} from '@audius/common/store' +import { getHash } from '@audius/common/utils' import { Button, ButtonSize, diff --git a/packages/web/src/components/collection/desktop/Artwork.tsx b/packages/web/src/components/collection/desktop/Artwork.tsx index b84747e9a68..dad502a59c1 100644 --- a/packages/web/src/components/collection/desktop/Artwork.tsx +++ b/packages/web/src/components/collection/desktop/Artwork.tsx @@ -1,12 +1,11 @@ import { ComponentType, SVGProps, useCallback, useEffect } from 'react' +import { imageBlank } from '@audius/common/assets' +import { SquareSizes, CoverArtSizes } from '@audius/common/models' import { - CoverArtSizes, - SquareSizes, cacheCollectionsSelectors, - imageBlank, useEditPlaylistModal -} from '@audius/common' +} from '@audius/common/store' import { Button, ButtonType, IconPencil } from '@audius/stems' import { useSelector } from 'common/hooks/useSelector' diff --git a/packages/web/src/components/collection/desktop/CollectionActionButtons.tsx b/packages/web/src/components/collection/desktop/CollectionActionButtons.tsx index 63a011035d6..d077dcdff8a 100644 --- a/packages/web/src/components/collection/desktop/CollectionActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/CollectionActionButtons.tsx @@ -1,4 +1,5 @@ -import { ID, Nullable, SmartCollectionVariant, Variant } from '@audius/common' +import { Variant, SmartCollectionVariant, ID } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import styles from './CollectionHeader.module.css' diff --git a/packages/web/src/components/collection/desktop/CollectionHeader.tsx b/packages/web/src/components/collection/desktop/CollectionHeader.tsx index 15eb95028bd..f5e4dc8b555 100644 --- a/packages/web/src/components/collection/desktop/CollectionHeader.tsx +++ b/packages/web/src/components/collection/desktop/CollectionHeader.tsx @@ -1,10 +1,7 @@ import { ChangeEvent, useCallback, useState } from 'react' -import { - formatSecondsAsText, - formatDate, - useEditPlaylistModal -} from '@audius/common' +import { useEditPlaylistModal } from '@audius/common/store' +import { formatSecondsAsText, formatDate } from '@audius/common/utils' import { IconHidden, IconPencil } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/collection/desktop/EditButton.tsx b/packages/web/src/components/collection/desktop/EditButton.tsx index 46dbe9cfa30..fa36c1a0b8c 100644 --- a/packages/web/src/components/collection/desktop/EditButton.tsx +++ b/packages/web/src/components/collection/desktop/EditButton.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { useEditPlaylistModal } from '@audius/common' +import { useEditPlaylistModal } from '@audius/common/store' import { ButtonProps, ButtonType, IconPencil } from '@audius/stems' import { EntityActionButton } from '../../entity-page/EntityActionButton' diff --git a/packages/web/src/components/collection/desktop/FavoriteButton.tsx b/packages/web/src/components/collection/desktop/FavoriteButton.tsx index fd3be2428fe..6696034f5a1 100644 --- a/packages/web/src/components/collection/desktop/FavoriteButton.tsx +++ b/packages/web/src/components/collection/desktop/FavoriteButton.tsx @@ -1,15 +1,17 @@ import { useCallback } from 'react' import { - accountSelectors, + FavoriteSource, Collection, - collectionPageSelectors, - CommonState, - ID, SmartCollection, + ID +} from '@audius/common/models' +import { + accountSelectors, + collectionPageSelectors, collectionsSocialActions, - FavoriteSource -} from '@audius/common' + CommonState +} from '@audius/common/store' import { ButtonProps, ButtonType, IconHeart } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/collection/desktop/OverflowMenuButton.tsx b/packages/web/src/components/collection/desktop/OverflowMenuButton.tsx index 7055f069d4a..fbe9258108e 100644 --- a/packages/web/src/components/collection/desktop/OverflowMenuButton.tsx +++ b/packages/web/src/components/collection/desktop/OverflowMenuButton.tsx @@ -1,13 +1,11 @@ import { useCallback } from 'react' +import { FollowSource, Collection, User } from '@audius/common/models' import { - Collection, collectionPageSelectors, - CommonState, - FollowSource, - User, - usersSocialActions -} from '@audius/common' + usersSocialActions, + CommonState +} from '@audius/common/store' import { Button, ButtonType, IconKebabHorizontal } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx index cfa3bd3c895..8c1b73284cb 100644 --- a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx @@ -1,8 +1,5 @@ -import { - Collection, - collectionPageSelectors, - CommonState -} from '@audius/common' +import { Collection } from '@audius/common/models' +import { collectionPageSelectors, CommonState } from '@audius/common/store' import { useSelector } from 'react-redux' import { EditButton } from './EditButton' diff --git a/packages/web/src/components/collection/desktop/PublishButton.tsx b/packages/web/src/components/collection/desktop/PublishButton.tsx index 324d5d73444..b1dec900fa8 100644 --- a/packages/web/src/components/collection/desktop/PublishButton.tsx +++ b/packages/web/src/components/collection/desktop/PublishButton.tsx @@ -1,9 +1,9 @@ +import { Collection } from '@audius/common/models' import { cacheCollectionsSelectors, - Collection, collectionPageSelectors, CommonState -} from '@audius/common' +} from '@audius/common/store' import { ButtonProps, ButtonType, IconRocket } from '@audius/stems' import { useSelector } from 'react-redux' import { useToggle } from 'react-use' diff --git a/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx b/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx index 73f2dcd9eb1..30cda75085b 100644 --- a/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx +++ b/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { Collection } from '@audius/common/models' import { - Collection, - CommonState, cacheCollectionsActions, - collectionPageSelectors -} from '@audius/common' + collectionPageSelectors, + CommonState +} from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/components/collection/desktop/RepostButton.tsx b/packages/web/src/components/collection/desktop/RepostButton.tsx index 87331a73338..fe261c4fa48 100644 --- a/packages/web/src/components/collection/desktop/RepostButton.tsx +++ b/packages/web/src/components/collection/desktop/RepostButton.tsx @@ -1,13 +1,11 @@ import { useCallback } from 'react' +import { RepostSource, Collection, ID } from '@audius/common/models' import { - Collection, collectionPageSelectors, - CommonState, - ID, collectionsSocialActions, - RepostSource -} from '@audius/common' + CommonState +} from '@audius/common/store' import { ButtonProps, ButtonType, IconRepost } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/collection/desktop/ShareButton.tsx b/packages/web/src/components/collection/desktop/ShareButton.tsx index aada3e2b171..f14aeb55856 100644 --- a/packages/web/src/components/collection/desktop/ShareButton.tsx +++ b/packages/web/src/components/collection/desktop/ShareButton.tsx @@ -1,11 +1,7 @@ import { useCallback } from 'react' -import { - ID, - shareModalUIActions, - ShareSource, - SmartCollectionVariant -} from '@audius/common' +import { ShareSource, SmartCollectionVariant, ID } from '@audius/common/models' +import { shareModalUIActions } from '@audius/common/store' import { ButtonProps, ButtonType, IconShare } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx b/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx index f809756ba77..4a44e1ffe3a 100644 --- a/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx @@ -1,4 +1,4 @@ -import { ID, SmartCollectionVariant } from '@audius/common' +import { SmartCollectionVariant, ID } from '@audius/common/models' import { FavoriteButton } from './FavoriteButton' import { ShareButton } from './ShareButton' diff --git a/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx b/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx index 609d2281d78..7191fb658c4 100644 --- a/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx @@ -1,9 +1,5 @@ -import { - Collection, - collectionPageSelectors, - CommonState, - ID -} from '@audius/common' +import { Collection, ID } from '@audius/common/models' +import { collectionPageSelectors, CommonState } from '@audius/common/store' import { useSelector } from 'react-redux' import { FavoriteButton } from './FavoriteButton' diff --git a/packages/web/src/components/collection/mobile/CollectionHeader.jsx b/packages/web/src/components/collection/mobile/CollectionHeader.jsx index c88ccf9dbee..4e2e55ab7fe 100644 --- a/packages/web/src/components/collection/mobile/CollectionHeader.jsx +++ b/packages/web/src/components/collection/mobile/CollectionHeader.jsx @@ -1,14 +1,13 @@ import { memo } from 'react' +import { Variant, SquareSizes } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { OverflowAction } from '@audius/common/store' import { - Variant, - SquareSizes, formatCount, formatSecondsAsText, - formatDate, - OverflowAction, - FeatureFlags -} from '@audius/common' + formatDate +} from '@audius/common/utils' import { Button, ButtonType, IconPause, IconPlay } from '@audius/stems' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/confirmer-preview/ConfirmerPreview.tsx b/packages/web/src/components/confirmer-preview/ConfirmerPreview.tsx index 6726937b07d..6fff38ab170 100644 --- a/packages/web/src/components/confirmer-preview/ConfirmerPreview.tsx +++ b/packages/web/src/components/confirmer-preview/ConfirmerPreview.tsx @@ -1,4 +1,4 @@ -import { CommonState } from '@audius/common' +import { CommonState } from '@audius/common/store' import { connect } from 'react-redux' import { useDevModeHotkey } from 'hooks/useHotkey' diff --git a/packages/web/src/components/cookie-banner/CookieBanner.tsx b/packages/web/src/components/cookie-banner/CookieBanner.tsx index 0de1b7edb1f..ae40cfc779d 100644 --- a/packages/web/src/components/cookie-banner/CookieBanner.tsx +++ b/packages/web/src/components/cookie-banner/CookieBanner.tsx @@ -1,6 +1,6 @@ import { memo } from 'react' -import { playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/cover-photo/CoverPhoto.tsx b/packages/web/src/components/cover-photo/CoverPhoto.tsx index 7676f8a7c34..43f397aa9bd 100644 --- a/packages/web/src/components/cover-photo/CoverPhoto.tsx +++ b/packages/web/src/components/cover-photo/CoverPhoto.tsx @@ -1,6 +1,8 @@ import { memo, useState } from 'react' -import { WidthSizes, Nullable, imageCoverPhotoBlank } from '@audius/common' +import { imageCoverPhotoBlank } from '@audius/common/assets' +import { WidthSizes } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import { FileWithPreview } from 'react-dropzone' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/create-playlist/PlaylistForm.tsx b/packages/web/src/components/create-playlist/PlaylistForm.tsx index 69ec1a42d96..da610142867 100644 --- a/packages/web/src/components/create-playlist/PlaylistForm.tsx +++ b/packages/web/src/components/create-playlist/PlaylistForm.tsx @@ -1,9 +1,9 @@ import { - Collection, + SquareSizes, CollectionMetadata, - Nullable, - SquareSizes -} from '@audius/common' + Collection +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { Flex } from '@audius/harmony' import { Form, Formik } from 'formik' import { toFormikValidationSchema } from 'zod-formik-adapter' diff --git a/packages/web/src/components/data-entry/AccessAndSaleTriggerLegacy.tsx b/packages/web/src/components/data-entry/AccessAndSaleTriggerLegacy.tsx index 9207173f64d..e1815d4756b 100644 --- a/packages/web/src/components/data-entry/AccessAndSaleTriggerLegacy.tsx +++ b/packages/web/src/components/data-entry/AccessAndSaleTriggerLegacy.tsx @@ -1,21 +1,21 @@ import { useMemo } from 'react' +import { useUSDCPurchaseConfig } from '@audius/common/hooks' import { - CollectibleGatedConditions, - FollowGatedConditions, - TipGatedConditions, - USDCPurchaseConditions, - Track, StreamTrackAvailabilityType, - accountSelectors, isContentCollectibleGated, isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated, - useUSDCPurchaseConfig, - Nullable, - AccessConditions -} from '@audius/common' + CollectibleGatedConditions, + FollowGatedConditions, + TipGatedConditions, + USDCPurchaseConditions, + AccessConditions, + Track +} from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Button, ButtonSize, diff --git a/packages/web/src/components/data-entry/ContextualMenu.tsx b/packages/web/src/components/data-entry/ContextualMenu.tsx index df6e9b87cca..13c109e023a 100644 --- a/packages/web/src/components/data-entry/ContextualMenu.tsx +++ b/packages/web/src/components/data-entry/ContextualMenu.tsx @@ -1,6 +1,6 @@ import { ReactNode, ReactElement, useCallback, useMemo, useEffect } from 'react' -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import { Box, Text as HarmonyText } from '@audius/harmony' import { Button, diff --git a/packages/web/src/components/data-entry/FormTile.jsx b/packages/web/src/components/data-entry/FormTile.jsx index 2874e7316d9..086d1769d51 100644 --- a/packages/web/src/components/data-entry/FormTile.jsx +++ b/packages/web/src/components/data-entry/FormTile.jsx @@ -1,13 +1,13 @@ import { Component, useState, useCallback } from 'react' +import { createRemixOfMetadata } from '@audius/common/schemas' +import { FeatureFlags } from '@audius/common/services' import { - GENRES, - convertGenreLabelToValue, - getCanonicalName, - createRemixOfMetadata, creativeCommons, - FeatureFlags -} from '@audius/common' + getCanonicalName, + GENRES, + convertGenreLabelToValue +} from '@audius/common/utils' import { Button, ButtonType, IconDownload, IconIndent } from '@audius/stems' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/data-entry/ReleaseDateTriggerLegacy.tsx b/packages/web/src/components/data-entry/ReleaseDateTriggerLegacy.tsx index 26db0dfa968..49dc67717dd 100644 --- a/packages/web/src/components/data-entry/ReleaseDateTriggerLegacy.tsx +++ b/packages/web/src/components/data-entry/ReleaseDateTriggerLegacy.tsx @@ -1,6 +1,7 @@ import { useMemo, useState } from 'react' -import { Track, dayjs } from '@audius/common' +import { Track } from '@audius/common/models' +import { dayjs } from '@audius/common/utils' import { Flex } from '@audius/harmony' import { Button, ButtonSize, ButtonType, IconCalendar } from '@audius/stems' import moment from 'moment' diff --git a/packages/web/src/components/data-entry/TagInput.jsx b/packages/web/src/components/data-entry/TagInput.jsx index 5df9cbb4c9d..f3150eb6c59 100644 --- a/packages/web/src/components/data-entry/TagInput.jsx +++ b/packages/web/src/components/data-entry/TagInput.jsx @@ -1,6 +1,6 @@ import { createRef, Component } from 'react' -import { trimToAlphaNumeric } from '@audius/common' +import { trimToAlphaNumeric } from '@audius/common/utils' import Tag from 'antd/lib/tag' import cn from 'classnames' diff --git a/packages/web/src/components/delete-confirmation/DeleteConfirmationModal.tsx b/packages/web/src/components/delete-confirmation/DeleteConfirmationModal.tsx index 764a54dfb8b..9ea6d2b47f1 100644 --- a/packages/web/src/components/delete-confirmation/DeleteConfirmationModal.tsx +++ b/packages/web/src/components/delete-confirmation/DeleteConfirmationModal.tsx @@ -1,4 +1,4 @@ -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import { Button } from '@audius/harmony' import { Modal, ModalHeader, ModalTitle, ModalContent } from '@audius/stems' diff --git a/packages/web/src/components/delete-playlist-confirmation-modal/DeletePlaylistConfirmationModal.tsx b/packages/web/src/components/delete-playlist-confirmation-modal/DeletePlaylistConfirmationModal.tsx index f63fbdf2dea..c77d7dfceb6 100644 --- a/packages/web/src/components/delete-playlist-confirmation-modal/DeletePlaylistConfirmationModal.tsx +++ b/packages/web/src/components/delete-playlist-confirmation-modal/DeletePlaylistConfirmationModal.tsx @@ -3,7 +3,7 @@ import { useCallback, useContext, useMemo } from 'react' import { cacheCollectionsActions, deletePlaylistConfirmationModalUISelectors -} from '@audius/common' +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/dog-ear/DogEar.tsx b/packages/web/src/components/dog-ear/DogEar.tsx index 9b5fa5d011e..d09d7afda96 100644 --- a/packages/web/src/components/dog-ear/DogEar.tsx +++ b/packages/web/src/components/dog-ear/DogEar.tsx @@ -1,4 +1,4 @@ -import { DogEarType } from '@audius/common' +import { DogEarType } from '@audius/common/models' import { IconCart, IconCollectible, diff --git a/packages/web/src/components/download-buttons/DownloadButtons.tsx b/packages/web/src/components/download-buttons/DownloadButtons.tsx index 1d8e117aa00..249f04a463b 100644 --- a/packages/web/src/components/download-buttons/DownloadButtons.tsx +++ b/packages/web/src/components/download-buttons/DownloadButtons.tsx @@ -1,12 +1,12 @@ import { memo, useCallback } from 'react' import { - ID, ButtonState, ButtonType, - useDownloadTrackButtons, - toastActions -} from '@audius/common' + useDownloadTrackButtons +} from '@audius/common/hooks' +import { ID } from '@audius/common/models' +import { toastActions } from '@audius/common/store' import { IconDownload, IconButton } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/download-mobile-app-drawer/DownloadMobileAppDrawer.tsx b/packages/web/src/components/download-mobile-app-drawer/DownloadMobileAppDrawer.tsx index a9fd1be9d51..45e6e46addf 100644 --- a/packages/web/src/components/download-mobile-app-drawer/DownloadMobileAppDrawer.tsx +++ b/packages/web/src/components/download-mobile-app-drawer/DownloadMobileAppDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { MobileOS } from '@audius/common' +import { MobileOS } from '@audius/common/models' import { AudiusLogoGlyph, Button, diff --git a/packages/web/src/components/dragndrop/Draggable.tsx b/packages/web/src/components/dragndrop/Draggable.tsx index 1169a4798b4..f9ece80dcb1 100644 --- a/packages/web/src/components/dragndrop/Draggable.tsx +++ b/packages/web/src/components/dragndrop/Draggable.tsx @@ -1,6 +1,6 @@ import { DragEvent, ReactNode, useCallback } from 'react' -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import { Slot } from '@radix-ui/react-slot' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/dragndrop/Droppable.tsx b/packages/web/src/components/dragndrop/Droppable.tsx index 28c4d0c88fd..2c124dec362 100644 --- a/packages/web/src/components/dragndrop/Droppable.tsx +++ b/packages/web/src/components/dragndrop/Droppable.tsx @@ -6,7 +6,8 @@ import { ReactNode } from 'react' -import { ID, useDebouncedCallback } from '@audius/common' +import { useDebouncedCallback } from '@audius/common/hooks' +import { ID } from '@audius/common/models' import { Slot } from '@radix-ui/react-slot' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/drawer/Drawer.tsx b/packages/web/src/components/drawer/Drawer.tsx index 0cd8cc4f76f..e5b65575a02 100644 --- a/packages/web/src/components/drawer/Drawer.tsx +++ b/packages/web/src/components/drawer/Drawer.tsx @@ -7,7 +7,7 @@ import { RefObject } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { IconRemove } from '@audius/stems' import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock' import cn from 'classnames' diff --git a/packages/web/src/components/duplicate-add-confirmation-modal/DuplicateAddConfirmationModal.tsx b/packages/web/src/components/duplicate-add-confirmation-modal/DuplicateAddConfirmationModal.tsx index 10b7fa51a39..21b4fbe89c9 100644 --- a/packages/web/src/components/duplicate-add-confirmation-modal/DuplicateAddConfirmationModal.tsx +++ b/packages/web/src/components/duplicate-add-confirmation-modal/DuplicateAddConfirmationModal.tsx @@ -4,9 +4,9 @@ import { accountSelectors, cacheCollectionsActions, cacheCollectionsSelectors, - duplicateAddConfirmationModalUISelectors, - fillString -} from '@audius/common' + duplicateAddConfirmationModalUISelectors +} from '@audius/common/store' +import { fillString } from '@audius/common/utils' import { Button, ButtonType, diff --git a/packages/web/src/components/dynamic-image/DynamicImage.tsx b/packages/web/src/components/dynamic-image/DynamicImage.tsx index e0e14a52c0e..6deaaa41d7f 100644 --- a/packages/web/src/components/dynamic-image/DynamicImage.tsx +++ b/packages/web/src/components/dynamic-image/DynamicImage.tsx @@ -6,7 +6,7 @@ import { ComponentPropsWithoutRef } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { Box } from '@audius/harmony' import cn from 'classnames' diff --git a/packages/web/src/components/edit-folder-modal/EditFolderModal.tsx b/packages/web/src/components/edit-folder-modal/EditFolderModal.tsx index 164bac75d8a..b2d25133917 100644 --- a/packages/web/src/components/edit-folder-modal/EditFolderModal.tsx +++ b/packages/web/src/components/edit-folder-modal/EditFolderModal.tsx @@ -1,12 +1,11 @@ import { useCallback, useState } from 'react' +import { Name, PlaylistLibraryFolder } from '@audius/common/models' import { - Name, - PlaylistLibraryFolder, accountSelectors, playlistLibraryActions, playlistLibraryHelpers -} from '@audius/common' +} from '@audius/common/store' import { IconFolder, Modal, diff --git a/packages/web/src/components/edit-playlist/desktop/EditPlaylistModal.tsx b/packages/web/src/components/edit-playlist/desktop/EditPlaylistModal.tsx index d435cbc246c..14d7af3e478 100644 --- a/packages/web/src/components/edit-playlist/desktop/EditPlaylistModal.tsx +++ b/packages/web/src/components/edit-playlist/desktop/EditPlaylistModal.tsx @@ -5,7 +5,7 @@ import { cacheCollectionsActions, cacheCollectionsSelectors, useEditPlaylistModal -} from '@audius/common' +} from '@audius/common/store' import { IconPlaylists, Modal, diff --git a/packages/web/src/components/edit-playlist/mobile/EditPlaylistPage.tsx b/packages/web/src/components/edit-playlist/mobile/EditPlaylistPage.tsx index eec1eab3cb3..059fdaac610 100644 --- a/packages/web/src/components/edit-playlist/mobile/EditPlaylistPage.tsx +++ b/packages/web/src/components/edit-playlist/mobile/EditPlaylistPage.tsx @@ -1,21 +1,19 @@ import { useEffect, useState, useCallback } from 'react' +import { imageBlank as placeholderCoverArt } from '@audius/common/assets' +import { useGatedContentAccessMap } from '@audius/common/hooks' +import { SquareSizes, Collection, ID } from '@audius/common/models' +import { newCollectionMetadata } from '@audius/common/schemas' +import { RandomImage } from '@audius/common/services' import { - ID, - Collection, - SquareSizes, - Nullable, - RandomImage, accountSelectors, cacheCollectionsActions, - collectionPageLineupActions as tracksActions, - imageBlank as placeholderCoverArt, - newCollectionMetadata, - useGatedContentAccessMap, - EditPlaylistValues, cacheCollectionsSelectors, - useEditPlaylistModal -} from '@audius/common' + collectionPageLineupActions as tracksActions, + useEditPlaylistModal, + EditPlaylistValues +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { capitalize } from 'lodash' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/edit-track/EditTrackModal.tsx b/packages/web/src/components/edit-track/EditTrackModal.tsx index d29ee91669d..3c8882b1cae 100644 --- a/packages/web/src/components/edit-track/EditTrackModal.tsx +++ b/packages/web/src/components/edit-track/EditTrackModal.tsx @@ -1,19 +1,20 @@ import { useEffect, useState } from 'react' import { - ID, StemCategory, + ID, StemUploadWithFile, - Track, - removeNullable, - uuid, + Track +} from '@audius/common/models' +import { cacheTracksActions as cacheTrackActions, - stemsUploadSelectors, stemsUploadActions, + stemsUploadSelectors, + publishTrackConfirmationModalUIActions, editTrackModalSelectors, - useEditTrackModal, - publishTrackConfirmationModalUIActions -} from '@audius/common' + useEditTrackModal +} from '@audius/common/store' +import { removeNullable, uuid } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { connect, useDispatch } from 'react-redux' import { matchPath } from 'react-router' diff --git a/packages/web/src/components/embed-modal/EmbedModal.tsx b/packages/web/src/components/embed-modal/EmbedModal.tsx index 1b5c8da260f..e2dd4ecd35c 100644 --- a/packages/web/src/components/embed-modal/EmbedModal.tsx +++ b/packages/web/src/components/embed-modal/EmbedModal.tsx @@ -1,6 +1,7 @@ import { useState, useMemo, useEffect, useCallback } from 'react' -import { PlayableType, ID, Name, Track, encodeHashId } from '@audius/common' +import { Name, PlayableType, ID, Track } from '@audius/common/models' +import { encodeHashId } from '@audius/common/utils' import { Modal, Button, ButtonType, SegmentedControl } from '@audius/stems' import cn from 'classnames' import { connect } from 'react-redux' diff --git a/packages/web/src/components/embed-modal/store/actions.ts b/packages/web/src/components/embed-modal/store/actions.ts index 9bbd81be327..8a975de834e 100644 --- a/packages/web/src/components/embed-modal/store/actions.ts +++ b/packages/web/src/components/embed-modal/store/actions.ts @@ -1,4 +1,4 @@ -import { ID, PlayableType } from '@audius/common' +import { PlayableType, ID } from '@audius/common/models' import { createCustomAction } from 'typesafe-actions' export const OPEN = 'EMBED_MODAL/OPEN' diff --git a/packages/web/src/components/embed-modal/store/selectors.ts b/packages/web/src/components/embed-modal/store/selectors.ts index 27ebbfdb393..b6141439f6a 100644 --- a/packages/web/src/components/embed-modal/store/selectors.ts +++ b/packages/web/src/components/embed-modal/store/selectors.ts @@ -1,8 +1,8 @@ +import { PlayableType } from '@audius/common/models' import { - PlayableType, cacheCollectionsSelectors, cacheTracksSelectors -} from '@audius/common' +} from '@audius/common/store' import { AppState } from 'store/types' const { getTrack } = cacheTracksSelectors diff --git a/packages/web/src/components/embed-modal/store/types.ts b/packages/web/src/components/embed-modal/store/types.ts index 8ccb9730157..d16b293ef08 100644 --- a/packages/web/src/components/embed-modal/store/types.ts +++ b/packages/web/src/components/embed-modal/store/types.ts @@ -1,4 +1,4 @@ -import { ID, PlayableType } from '@audius/common' +import { PlayableType, ID } from '@audius/common/models' export type EmbedModalState = { isOpen: boolean diff --git a/packages/web/src/components/feature-flag-override-modal/FeatureFlagOverrideModal.tsx b/packages/web/src/components/feature-flag-override-modal/FeatureFlagOverrideModal.tsx index a4ddeebed44..29e534b893e 100644 --- a/packages/web/src/components/feature-flag-override-modal/FeatureFlagOverrideModal.tsx +++ b/packages/web/src/components/feature-flag-override-modal/FeatureFlagOverrideModal.tsx @@ -1,11 +1,11 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { - FeatureFlags, - FEATURE_FLAG_OVERRIDE_KEY, OverrideSetting, - accountSelectors -} from '@audius/common' + FEATURE_FLAG_OVERRIDE_KEY +} from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors } from '@audius/common/store' import { Modal, ModalContent, diff --git a/packages/web/src/components/feature-flag/FeatureFlag.tsx b/packages/web/src/components/feature-flag/FeatureFlag.tsx index 46c4b57d07d..07c26f1e433 100644 --- a/packages/web/src/components/feature-flag/FeatureFlag.tsx +++ b/packages/web/src/components/feature-flag/FeatureFlag.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react' -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import { useFlag } from 'hooks/useRemoteConfig' diff --git a/packages/web/src/components/first-upload-modal/FirstUploadModal.tsx b/packages/web/src/components/first-upload-modal/FirstUploadModal.tsx index 527be372af6..d2991eb2c44 100644 --- a/packages/web/src/components/first-upload-modal/FirstUploadModal.tsx +++ b/packages/web/src/components/first-upload-modal/FirstUploadModal.tsx @@ -1,11 +1,7 @@ import { useCallback, useEffect } from 'react' -import { - Name, - SquareSizes, - accountSelectors, - musicConfettiActions -} from '@audius/common' +import { Name, SquareSizes } from '@audius/common/models' +import { accountSelectors, musicConfettiActions } from '@audius/common/store' import { Modal } from '@audius/stems' import { connect, useDispatch } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/form-fields/ArtworkField.tsx b/packages/web/src/components/form-fields/ArtworkField.tsx index ad43f825bd9..1fdcecc6806 100644 --- a/packages/web/src/components/form-fields/ArtworkField.tsx +++ b/packages/web/src/components/form-fields/ArtworkField.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' -import { getErrorMessage } from '@audius/common' +import { getErrorMessage } from '@audius/common/utils' import { useField, useFormikContext } from 'formik' import { HelperText } from 'components/data-entry/HelperText' diff --git a/packages/web/src/components/form-fields/HarmonyTextField.tsx b/packages/web/src/components/form-fields/HarmonyTextField.tsx index 176c8639180..9c7e2064a4d 100644 --- a/packages/web/src/components/form-fields/HarmonyTextField.tsx +++ b/packages/web/src/components/form-fields/HarmonyTextField.tsx @@ -1,6 +1,6 @@ import { Ref, forwardRef, useEffect } from 'react' -import { useDebouncedCallback } from '@audius/common' +import { useDebouncedCallback } from '@audius/common/hooks' import { TextInput, TextInputProps } from '@audius/harmony' import { useField, useFormikContext } from 'formik' diff --git a/packages/web/src/components/form-fields/PriceField.tsx b/packages/web/src/components/form-fields/PriceField.tsx index a69b85db8c7..8bea29ef8b8 100644 --- a/packages/web/src/components/form-fields/PriceField.tsx +++ b/packages/web/src/components/form-fields/PriceField.tsx @@ -7,11 +7,11 @@ import { } from 'react' import { - decimalIntegerFromHumanReadable, - decimalIntegerToHumanReadable, filterDecimalString, - padDecimalValue -} from '@audius/common' + padDecimalValue, + decimalIntegerToHumanReadable, + decimalIntegerFromHumanReadable +} from '@audius/common/utils' import { useField } from 'formik' import { TextField, TextFieldProps } from './TextField' diff --git a/packages/web/src/components/form-fields/TagField.tsx b/packages/web/src/components/form-fields/TagField.tsx index b0913492431..8fec72e6eba 100644 --- a/packages/web/src/components/form-fields/TagField.tsx +++ b/packages/web/src/components/form-fields/TagField.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import { removeNullable } from '@audius/common' +import { removeNullable } from '@audius/common/utils' import { useField } from 'formik' import TagInput, { TagInputProps } from 'components/data-entry/TagInput' diff --git a/packages/web/src/components/header/mobile/HeaderContextProvider.tsx b/packages/web/src/components/header/mobile/HeaderContextProvider.tsx index 431015c4f81..d417cb0431f 100644 --- a/packages/web/src/components/header/mobile/HeaderContextProvider.tsx +++ b/packages/web/src/components/header/mobile/HeaderContextProvider.tsx @@ -7,7 +7,7 @@ import { useContext } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { useHistory } from 'react-router-dom' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/components/image-selection/ImageSelectionPopup.jsx b/packages/web/src/components/image-selection/ImageSelectionPopup.jsx index 33dbecde066..df6b7449944 100644 --- a/packages/web/src/components/image-selection/ImageSelectionPopup.jsx +++ b/packages/web/src/components/image-selection/ImageSelectionPopup.jsx @@ -1,12 +1,9 @@ import { useState, useCallback, useRef, useContext } from 'react' -import { - RandomImage, - accountSelectors, - badgeTiers, - useSelectTierInfo, - removeNullable -} from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import { RandomImage } from '@audius/common/services' +import { accountSelectors, badgeTiers } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { Button, ButtonType, Popup, SegmentedControl } from '@audius/stems' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/inbox-settings-modal/InboxSettingsModal.tsx b/packages/web/src/components/inbox-settings-modal/InboxSettingsModal.tsx index 596d853c862..7a3afc50ca6 100644 --- a/packages/web/src/components/inbox-settings-modal/InboxSettingsModal.tsx +++ b/packages/web/src/components/inbox-settings-modal/InboxSettingsModal.tsx @@ -1,6 +1,7 @@ import { ChangeEvent, useCallback, useEffect } from 'react' -import { Status, useSetInboxPermissions } from '@audius/common' +import { useSetInboxPermissions } from '@audius/common/hooks' +import { Status } from '@audius/common/models' import { ChatPermission } from '@audius/sdk' import { Button, diff --git a/packages/web/src/components/inbox-unavailable-modal/InboxUnavailableModal.tsx b/packages/web/src/components/inbox-unavailable-modal/InboxUnavailableModal.tsx index 74683569771..13c654d2ed3 100644 --- a/packages/web/src/components/inbox-unavailable-modal/InboxUnavailableModal.tsx +++ b/packages/web/src/components/inbox-unavailable-modal/InboxUnavailableModal.tsx @@ -1,17 +1,17 @@ import { ReactNode, useCallback } from 'react' +import { User } from '@audius/common/models' import { - CHAT_BLOG_POST_URL, - ChatPermissionAction, - User, accountSelectors, cacheUsersSelectors, chatActions, chatSelectors, makeChatId, + ChatPermissionAction, tippingActions, useInboxUnavailableModal -} from '@audius/common' +} from '@audius/common/store' +import { CHAT_BLOG_POST_URL } from '@audius/common/utils' import { IconMessageLocked, IconTipping, diff --git a/packages/web/src/components/leaving-audius-modal/LeavingAudiusModal.tsx b/packages/web/src/components/leaving-audius-modal/LeavingAudiusModal.tsx index 51bb1ecdf7a..ae16bc96212 100644 --- a/packages/web/src/components/leaving-audius-modal/LeavingAudiusModal.tsx +++ b/packages/web/src/components/leaving-audius-modal/LeavingAudiusModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { useLeavingAudiusModal } from '@audius/common' +import { useLeavingAudiusModal } from '@audius/common/store' import { Button } from '@audius/harmony' import { IconExternalLink, diff --git a/packages/web/src/components/lineup/Lineup.tsx b/packages/web/src/components/lineup/Lineup.tsx index 7483742b9d7..ec8c7c0e7d4 100644 --- a/packages/web/src/components/lineup/Lineup.tsx +++ b/packages/web/src/components/lineup/Lineup.tsx @@ -1,4 +1,4 @@ -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import DesktopPlaylistTile from 'components/track/desktop/ConnectedPlaylistTile' import DesktopTrackTile from 'components/track/desktop/ConnectedTrackTile' diff --git a/packages/web/src/components/lineup/LineupProvider.tsx b/packages/web/src/components/lineup/LineupProvider.tsx index 9a9fd647615..ab041963ab8 100644 --- a/packages/web/src/components/lineup/LineupProvider.tsx +++ b/packages/web/src/components/lineup/LineupProvider.tsx @@ -1,17 +1,19 @@ import { ComponentType, createRef, PureComponent } from 'react' import { - Kind, - ID, - UID, Name, PlaybackSource, - Lineup, + Kind, Status, + ID, + UID, + Lineup +} from '@audius/common/models' +import { LineupBaseActions, tippingSelectors, playerSelectors -} from '@audius/common' +} from '@audius/common/store' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' import InfiniteScroll from 'react-infinite-scroller' diff --git a/packages/web/src/components/lineup/hooks.ts b/packages/web/src/components/lineup/hooks.ts index 66e48fe0f1b..cfc4ba8b8fb 100644 --- a/packages/web/src/components/lineup/hooks.ts +++ b/packages/web/src/components/lineup/hooks.ts @@ -1,11 +1,11 @@ import { useMemo } from 'react' +import { LineupState } from '@audius/common/models' import { - LineupState, lineupSelectors, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { LineupVariant } from 'components/lineup/types' diff --git a/packages/web/src/components/link/ExternalLink.tsx b/packages/web/src/components/link/ExternalLink.tsx index 6a0eaadcb7b..32dfefc779f 100644 --- a/packages/web/src/components/link/ExternalLink.tsx +++ b/packages/web/src/components/link/ExternalLink.tsx @@ -1,10 +1,8 @@ import { MouseEvent, useCallback } from 'react' -import { - Name, - isAllowedExternalLink, - useLeavingAudiusModal -} from '@audius/common' +import { Name } from '@audius/common/models' +import { useLeavingAudiusModal } from '@audius/common/store' +import { isAllowedExternalLink } from '@audius/common/utils' import { make, useRecord } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/link/UserLink.tsx b/packages/web/src/components/link/UserLink.tsx index 7ed2528826d..f88e6dc544c 100644 --- a/packages/web/src/components/link/UserLink.tsx +++ b/packages/web/src/components/link/UserLink.tsx @@ -1,4 +1,5 @@ -import { ID, cacheUsersSelectors } from '@audius/common' +import { ID } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import cn from 'classnames' import { ArtistPopover } from 'components/artist/ArtistPopover' diff --git a/packages/web/src/components/locked-content-modal/LockedContentModal.tsx b/packages/web/src/components/locked-content-modal/LockedContentModal.tsx index d74a31530f4..eabbe974623 100644 --- a/packages/web/src/components/locked-content-modal/LockedContentModal.tsx +++ b/packages/web/src/components/locked-content-modal/LockedContentModal.tsx @@ -1,10 +1,7 @@ import { useCallback } from 'react' -import { - gatedContentActions, - useLockedContent, - useGatedContentAccess -} from '@audius/common' +import { useGatedContentAccess, useLockedContent } from '@audius/common/hooks' +import { gatedContentActions } from '@audius/common/store' import { IconLock, ModalContent, ModalHeader, ModalTitle } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/menu/CollectionMenu.tsx b/packages/web/src/components/menu/CollectionMenu.tsx index 2dec906e9ac..ff795d03972 100644 --- a/packages/web/src/components/menu/CollectionMenu.tsx +++ b/packages/web/src/components/menu/CollectionMenu.tsx @@ -1,13 +1,15 @@ import { - PlayableType, - ID, ShareSource, - FavoriteSource, RepostSource, + FavoriteSource, + PlayableType, + ID +} from '@audius/common/models' +import { cacheUsersSelectors, collectionsSocialActions as socialActions, useEditPlaylistModal -} from '@audius/common' +} from '@audius/common/store' import { PopupMenuItem } from '@audius/stems' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' diff --git a/packages/web/src/components/menu/TrackMenu.tsx b/packages/web/src/components/menu/TrackMenu.tsx index 9101f27c08a..199ec321514 100644 --- a/packages/web/src/components/menu/TrackMenu.tsx +++ b/packages/web/src/components/menu/TrackMenu.tsx @@ -1,23 +1,25 @@ import { useContext } from 'react' import { - ID, - PlayableType, - FavoriteSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, + PlayableType, + ID +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, cacheCollectionsActions, collectionPageSelectors, - playbackPositionActions, - playbackPositionSelectors, tracksSocialActions, addToCollectionUIActions, - Genre, - FeatureFlags, - CommonState, - useEditTrackModal -} from '@audius/common' + useEditTrackModal, + playbackPositionActions, + playbackPositionSelectors, + CommonState +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { PopupMenuItem } from '@audius/stems' import { push as pushRoute } from 'connected-react-router' import { connect, useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/menu/UserMenu.tsx b/packages/web/src/components/menu/UserMenu.tsx index 3c80ecd5704..ae39358af5b 100644 --- a/packages/web/src/components/menu/UserMenu.tsx +++ b/packages/web/src/components/menu/UserMenu.tsx @@ -1,10 +1,8 @@ +import { ShareSource, FollowSource, ID } from '@audius/common/models' import { - ID, - FollowSource, - ShareSource, usersSocialActions as socialActions, shareModalUIActions -} from '@audius/common' +} from '@audius/common/store' import { PopupMenuItem } from '@audius/stems' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' diff --git a/packages/web/src/components/mobile-page-container/MobilePageContainer.tsx b/packages/web/src/components/mobile-page-container/MobilePageContainer.tsx index ce670aa2b2a..58e7ffb8fa4 100644 --- a/packages/web/src/components/mobile-page-container/MobilePageContainer.tsx +++ b/packages/web/src/components/mobile-page-container/MobilePageContainer.tsx @@ -1,6 +1,7 @@ import { ReactNode, useEffect, useContext } from 'react' -import { playerSelectors, useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' +import { playerSelectors } from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' diff --git a/packages/web/src/components/music-confetti/ConnectedMusicConfetti.tsx b/packages/web/src/components/music-confetti/ConnectedMusicConfetti.tsx index 151fa93fae6..de4dda41339 100644 --- a/packages/web/src/components/music-confetti/ConnectedMusicConfetti.tsx +++ b/packages/web/src/components/music-confetti/ConnectedMusicConfetti.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { Theme } from '@audius/common/models' import { - musicConfettiActions, - musicConfettiSelectors, themeSelectors, - Theme -} from '@audius/common' + musicConfettiSelectors, + musicConfettiActions +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { MusicConfetti } from 'components/background-animations/MusicConfetti' diff --git a/packages/web/src/components/nav/Navigator.tsx b/packages/web/src/components/nav/Navigator.tsx index 1c6bfd6e607..49bdf1bff27 100644 --- a/packages/web/src/components/nav/Navigator.tsx +++ b/packages/web/src/components/nav/Navigator.tsx @@ -1,4 +1,4 @@ -import { Client } from '@audius/common' +import { Client } from '@audius/common/models' import cn from 'classnames' import { RouteComponentProps, withRouter } from 'react-router-dom' diff --git a/packages/web/src/components/nav/desktop/AccountDetails.tsx b/packages/web/src/components/nav/desktop/AccountDetails.tsx index 12f0cc281bf..b0d0f112b6d 100644 --- a/packages/web/src/components/nav/desktop/AccountDetails.tsx +++ b/packages/web/src/components/nav/desktop/AccountDetails.tsx @@ -1,4 +1,4 @@ -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { AvatarLegacy } from 'components/avatar/AvatarLegacy' import { Link, UserLink } from 'components/link' diff --git a/packages/web/src/components/nav/desktop/LeftNav.tsx b/packages/web/src/components/nav/desktop/LeftNav.tsx index 85c3105df5f..8bb00568181 100644 --- a/packages/web/src/components/nav/desktop/LeftNav.tsx +++ b/packages/web/src/components/nav/desktop/LeftNav.tsx @@ -1,14 +1,16 @@ import { MouseEvent, useCallback, useRef, useState } from 'react' import { - FavoriteSource, Name, + FavoriteSource, Status, + CreateAccountOpen +} from '@audius/common/models' +import { accountSelectors, collectionsSocialActions, - tracksSocialActions, - CreateAccountOpen -} from '@audius/common' + tracksSocialActions +} from '@audius/common/store' import { Scrollbar } from '@audius/stems' import { ResizeObserver } from '@juggle/resize-observer' import cn from 'classnames' diff --git a/packages/web/src/components/nav/desktop/NavButton.tsx b/packages/web/src/components/nav/desktop/NavButton.tsx index 34c33169a07..9a1a53e7e3e 100644 --- a/packages/web/src/components/nav/desktop/NavButton.tsx +++ b/packages/web/src/components/nav/desktop/NavButton.tsx @@ -1,12 +1,11 @@ import { useCallback } from 'react' +import { Name, Status } from '@audius/common/models' import { - Name, - Status, accountSelectors, uploadActions, uploadSelectors -} from '@audius/common' +} from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/components/nav/desktop/NavHeader.tsx b/packages/web/src/components/nav/desktop/NavHeader.tsx index cce7fee6277..65dc17dd761 100644 --- a/packages/web/src/components/nav/desktop/NavHeader.tsx +++ b/packages/web/src/components/nav/desktop/NavHeader.tsx @@ -1,14 +1,13 @@ import { useCallback, useRef } from 'react' +import { Name, Theme } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - Theme, - FeatureFlags, - formatCount, accountSelectors, notificationsSelectors, - Name, themeSelectors -} from '@audius/common' +} from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import { useDispatch } from 'react-redux' import { Link } from 'react-router-dom' diff --git a/packages/web/src/components/nav/desktop/NavPopupMenu.tsx b/packages/web/src/components/nav/desktop/NavPopupMenu.tsx index b5a3c5eaf5e..2a5705b95ca 100644 --- a/packages/web/src/components/nav/desktop/NavPopupMenu.tsx +++ b/packages/web/src/components/nav/desktop/NavPopupMenu.tsx @@ -1,11 +1,8 @@ -import { - removeNullable, - FeatureFlags, - chatSelectors, - Name, - useAccountHasClaimableRewards, - StringKeys -} from '@audius/common' +import { useAccountHasClaimableRewards } from '@audius/common/hooks' +import { Name } from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { chatSelectors } from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { IconCrown, IconDashboard, diff --git a/packages/web/src/components/nav/desktop/NowPlayingArtworkTile.tsx b/packages/web/src/components/nav/desktop/NowPlayingArtworkTile.tsx index 1d5ca587b17..d33e673aae0 100644 --- a/packages/web/src/components/nav/desktop/NowPlayingArtworkTile.tsx +++ b/packages/web/src/components/nav/desktop/NowPlayingArtworkTile.tsx @@ -1,15 +1,14 @@ import { CSSProperties, MouseEvent, ReactNode, useCallback } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' +import { DogEarType, SquareSizes } from '@audius/common/models' import { - SquareSizes, - playerSelectors, - cacheTracksSelectors, - CommonState, accountSelectors, averageColorSelectors, - DogEarType, - useGatedContentAccess -} from '@audius/common' + cacheTracksSelectors, + playerSelectors, + CommonState +} from '@audius/common/store' import { IconButton } from '@audius/stems' import { animated, useSpring } from '@react-spring/web' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/AudioNftPlaylistNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/AudioNftPlaylistNavItem.tsx index ccd2834225b..55227b7e594 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/AudioNftPlaylistNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/AudioNftPlaylistNavItem.tsx @@ -1,4 +1,5 @@ -import { SmartCollectionVariant, accountSelectors } from '@audius/common' +import { SmartCollectionVariant } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { SMART_COLLECTION_MAP } from 'common/store/smart-collection/smartCollections' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/CollectionNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/CollectionNavItem.tsx index 6f52329e9cb..12c25c7f94f 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/CollectionNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/CollectionNavItem.tsx @@ -2,17 +2,19 @@ import { useCallback, useState } from 'react' import { Name, + ShareSource, ID, + PlaylistLibraryID, + PlaylistLibraryKind +} from '@audius/common/models' +import { cacheCollectionsActions, - cacheTracksSelectors, cacheCollectionsSelectors, + cacheTracksSelectors, playlistLibraryActions, - PlaylistLibraryKind, - PlaylistLibraryID, shareModalUIActions, - ShareSource, useEditPlaylistModal -} from '@audius/common' +} from '@audius/common/store' import { PopupMenuItem } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/CreatePlaylistLibraryItemButton.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/CreatePlaylistLibraryItemButton.tsx index 2b3d6a8de30..bf1b461a450 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/CreatePlaylistLibraryItemButton.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/CreatePlaylistLibraryItemButton.tsx @@ -1,12 +1,12 @@ import { MutableRefObject, useCallback, useMemo } from 'react' +import { CreatePlaylistSource } from '@audius/common/models' import { - CreatePlaylistSource, accountSelectors, cacheCollectionsActions, playlistLibraryActions, playlistLibraryHelpers -} from '@audius/common' +} from '@audius/common/store' import { PopupMenu, IconFolder, diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteCollectionConfirmationModal.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteCollectionConfirmationModal.tsx index b6cade30510..5c419fc6711 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteCollectionConfirmationModal.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteCollectionConfirmationModal.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { ID } from '@audius/common/models' import { - ID, cacheCollectionsActions, cacheCollectionsSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { SetRequired } from 'type-fest' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteFolderConfirmationModal.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteFolderConfirmationModal.tsx index 17fe9419545..cec629703f1 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteFolderConfirmationModal.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/DeleteFolderConfirmationModal.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, accountSelectors, playlistLibraryActions, playlistLibraryHelpers, playlistLibrarySelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { SetRequired } from 'type-fest' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/EmptyLibraryNavLink.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/EmptyLibraryNavLink.tsx index cb0cf034bc4..df9a7bc4078 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/EmptyLibraryNavLink.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/EmptyLibraryNavLink.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { CreatePlaylistSource, cacheCollectionsActions } from '@audius/common' +import { CreatePlaylistSource } from '@audius/common/models' +import { cacheCollectionsActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import { LeftNavLink } from '../LeftNavLink' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/ExplorePlaylistNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/ExplorePlaylistNavItem.tsx index 71c2a7c222a..4b018970016 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/ExplorePlaylistNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/ExplorePlaylistNavItem.tsx @@ -1,4 +1,4 @@ -import { SmartCollectionVariant } from '@audius/common' +import { SmartCollectionVariant } from '@audius/common/models' import { SMART_COLLECTION_MAP } from 'common/store/smart-collection/smartCollections' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistFolderNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistFolderNavItem.tsx index 942bb91491a..465562bec90 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistFolderNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistFolderNavItem.tsx @@ -1,14 +1,16 @@ import { useCallback, useState, MouseEvent, useEffect, useMemo } from 'react' import { - PlaylistLibraryFolder, Name, - modalsActions, PlaylistLibraryID, - playlistLibraryActions, PlaylistLibraryKind, + PlaylistLibraryFolder +} from '@audius/common/models' +import { + playlistLibraryActions, + modalsActions, playlistUpdatesSelectors -} from '@audius/common' +} from '@audius/common/store' import { IconFolder, IconFolderOutline, diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibrary.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibrary.tsx index 906b6091046..13a4d3509df 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibrary.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibrary.tsx @@ -1,10 +1,10 @@ import { MutableRefObject, useCallback } from 'react' +import { FavoriteSource } from '@audius/common/models' import { - FavoriteSource, accountSelectors, collectionsSocialActions -} from '@audius/common' +} from '@audius/common/store' import cn from 'classnames' import { isEmpty } from 'lodash' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibraryNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibraryNavItem.tsx index 57e637f8861..f7c5fd82bc4 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibraryNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistLibraryNavItem.tsx @@ -1,4 +1,7 @@ -import { PlaylistLibraryItem, SmartCollectionVariant } from '@audius/common' +import { + SmartCollectionVariant, + PlaylistLibraryItem +} from '@audius/common/models' import { AudioNftPlaylistNavItem } from './AudioNftPlaylistNavItem' import { ExplorePlaylistNavItem } from './ExplorePlaylistNavItem' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistNavItem.tsx b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistNavItem.tsx index a1f010c0f30..e65db1e92b7 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistNavItem.tsx +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/PlaylistNavItem.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { playlistUpdatesActions, playlistUpdatesSelectors -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/useAddAudioNftPlaylistToLibrary.ts b/packages/web/src/components/nav/desktop/PlaylistLibrary/useAddAudioNftPlaylistToLibrary.ts index 8af3f702145..1f054b3c482 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/useAddAudioNftPlaylistToLibrary.ts +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/useAddAudioNftPlaylistToLibrary.ts @@ -1,12 +1,11 @@ import { useEffect } from 'react' +import { FavoriteSource, SmartCollectionVariant } from '@audius/common/models' import { - FavoriteSource, - SmartCollectionVariant, accountSelectors, - collectionsSocialActions, - playlistLibraryHelpers -} from '@audius/common' + playlistLibraryHelpers, + collectionsSocialActions +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { AUDIO_NFT_PLAYLIST } from 'common/store/smart-collection/smartCollections' diff --git a/packages/web/src/components/nav/desktop/PlaylistLibrary/useSanitizePlaylistLibrary.ts b/packages/web/src/components/nav/desktop/PlaylistLibrary/useSanitizePlaylistLibrary.ts index bd1ef5d1714..fa797897748 100644 --- a/packages/web/src/components/nav/desktop/PlaylistLibrary/useSanitizePlaylistLibrary.ts +++ b/packages/web/src/components/nav/desktop/PlaylistLibrary/useSanitizePlaylistLibrary.ts @@ -1,10 +1,7 @@ import { useEffect } from 'react' -import { - PlaylistLibraryFolder, - accountSelectors, - playlistLibraryActions -} from '@audius/common' +import { PlaylistLibraryFolder } from '@audius/common/models' +import { accountSelectors, playlistLibraryActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx b/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx index 6558ba2ed90..8766bd181e4 100644 --- a/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx +++ b/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx @@ -4,7 +4,7 @@ import { accountSelectors, explorePageActions, ExplorePageTabs -} from '@audius/common' +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { withRouter, RouteComponentProps } from 'react-router-dom' diff --git a/packages/web/src/components/nav/mobile/ConnectedNavBar.tsx b/packages/web/src/components/nav/mobile/ConnectedNavBar.tsx index aeb92f42743..70db93b94b3 100644 --- a/packages/web/src/components/nav/mobile/ConnectedNavBar.tsx +++ b/packages/web/src/components/nav/mobile/ConnectedNavBar.tsx @@ -1,12 +1,11 @@ import { useCallback, useContext } from 'react' +import { Name, Status } from '@audius/common/models' import { - Name, - Status, accountSelectors, notificationsSelectors, searchResultsPageSelectors -} from '@audius/common' +} from '@audius/common/store' import { push as pushRoute, goBack } from 'connected-react-router' import { connect } from 'react-redux' import { withRouter, RouteComponentProps } from 'react-router-dom' diff --git a/packages/web/src/components/nav/mobile/NavBar.tsx b/packages/web/src/components/nav/mobile/NavBar.tsx index 24b1dcbf253..a0bdb87b7cc 100644 --- a/packages/web/src/components/nav/mobile/NavBar.tsx +++ b/packages/web/src/components/nav/mobile/NavBar.tsx @@ -1,6 +1,8 @@ import { useState, useContext, useCallback, useEffect } from 'react' -import { Status, FeatureFlags, formatCount } from '@audius/common' +import { Status } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { formatCount } from '@audius/common/utils' import { IconCaretRight, IconRemove, diff --git a/packages/web/src/components/nav/mobile/SignOut.tsx b/packages/web/src/components/nav/mobile/SignOut.tsx index 55287827b87..3d0368928ef 100644 --- a/packages/web/src/components/nav/mobile/SignOut.tsx +++ b/packages/web/src/components/nav/mobile/SignOut.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { Name, signOutActions } from '@audius/common' +import { Name } from '@audius/common/models' +import { signOutActions } from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/nav/mobile/TopLevelPage.tsx b/packages/web/src/components/nav/mobile/TopLevelPage.tsx index ff8565228cd..25b39a2ff55 100644 --- a/packages/web/src/components/nav/mobile/TopLevelPage.tsx +++ b/packages/web/src/components/nav/mobile/TopLevelPage.tsx @@ -1,4 +1,4 @@ -import { modalsSelectors, useEditPlaylistModal } from '@audius/common' +import { modalsSelectors, useEditPlaylistModal } from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/notice/Notice.tsx b/packages/web/src/components/notice/Notice.tsx index 53b4f1acca6..7268b28ff3a 100644 --- a/packages/web/src/components/notice/Notice.tsx +++ b/packages/web/src/components/notice/Notice.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { StringKeys } from '@audius/common' +import { StringKeys } from '@audius/common/services' import { IconRemove } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/notification/Notification/AddTrackToPlaylistNotification.tsx b/packages/web/src/components/notification/Notification/AddTrackToPlaylistNotification.tsx index d8ccc629d15..bde0aedb03e 100644 --- a/packages/web/src/components/notification/Notification/AddTrackToPlaylistNotification.tsx +++ b/packages/web/src/components/notification/Notification/AddTrackToPlaylistNotification.tsx @@ -1,13 +1,12 @@ import { useCallback } from 'react' +import { Name, Track } from '@audius/common/models' import { - Name, - Track, notificationsSelectors, - AddTrackToPlaylistNotification as AddTrackToPlaylistNotificationType, + Entity, CollectionEntity, - Entity -} from '@audius/common' + AddTrackToPlaylistNotification as AddTrackToPlaylistNotificationType +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/AnnouncementNotification.tsx b/packages/web/src/components/notification/Notification/AnnouncementNotification.tsx index ca6749d32d2..e0bed7cde77 100644 --- a/packages/web/src/components/notification/Notification/AnnouncementNotification.tsx +++ b/packages/web/src/components/notification/Notification/AnnouncementNotification.tsx @@ -1,9 +1,7 @@ import { useCallback } from 'react' -import { - Name, - AnnouncementNotification as AnnouncementNotificationType -} from '@audius/common' +import { Name } from '@audius/common/models' +import { AnnouncementNotification as AnnouncementNotificationType } from '@audius/common/store' import { MarkdownViewer } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/ChallengeRewardNotification.tsx b/packages/web/src/components/notification/Notification/ChallengeRewardNotification.tsx index fb13af93f33..79710c50aff 100644 --- a/packages/web/src/components/notification/Notification/ChallengeRewardNotification.tsx +++ b/packages/web/src/components/notification/Notification/ChallengeRewardNotification.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - ChallengeRewardNotification as ChallengeRewardNotificationType, - audioRewardsPageSelectors -} from '@audius/common' + audioRewardsPageSelectors, + ChallengeRewardNotification as ChallengeRewardNotificationType +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/FavoriteNotification.tsx b/packages/web/src/components/notification/Notification/FavoriteNotification.tsx index 4bfc66ae334..8b179082b77 100644 --- a/packages/web/src/components/notification/Notification/FavoriteNotification.tsx +++ b/packages/web/src/components/notification/Notification/FavoriteNotification.tsx @@ -2,9 +2,9 @@ import { MouseEventHandler, useCallback } from 'react' import { notificationsSelectors, - FavoriteNotification as FavoriteNotificationType, - Entity -} from '@audius/common' + Entity, + FavoriteNotification as FavoriteNotificationType +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/FavoriteOfRepostNotification.tsx b/packages/web/src/components/notification/Notification/FavoriteOfRepostNotification.tsx index ebd3ee4e304..5da9dcb33a0 100644 --- a/packages/web/src/components/notification/Notification/FavoriteOfRepostNotification.tsx +++ b/packages/web/src/components/notification/Notification/FavoriteOfRepostNotification.tsx @@ -1,8 +1,8 @@ import { notificationsSelectors, - FavoriteOfRepostNotification as FavoriteOfRepostNotificationType, - Entity -} from '@audius/common' + Entity, + FavoriteOfRepostNotification as FavoriteOfRepostNotificationType +} from '@audius/common/store' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/notification/Notification/FollowNotification.tsx b/packages/web/src/components/notification/Notification/FollowNotification.tsx index e04e28bcc08..0f5ba9a0cff 100644 --- a/packages/web/src/components/notification/Notification/FollowNotification.tsx +++ b/packages/web/src/components/notification/Notification/FollowNotification.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { notificationsSelectors, FollowNotification as FollowNotificationType -} from '@audius/common' +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/MilestoneNotification.tsx b/packages/web/src/components/notification/Notification/MilestoneNotification.tsx index 9dbdb5e1750..212db5da8b7 100644 --- a/packages/web/src/components/notification/Notification/MilestoneNotification.tsx +++ b/packages/web/src/components/notification/Notification/MilestoneNotification.tsx @@ -1,15 +1,13 @@ import { useCallback } from 'react' +import { Name, User } from '@audius/common/models' import { - Name, - User, - Nullable, - formatCount, notificationsSelectors, Achievement, EntityType, MilestoneNotification as MilestoneNotificationType -} from '@audius/common' +} from '@audius/common/store' +import { formatCount, Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/Notification.tsx b/packages/web/src/components/notification/Notification/Notification.tsx index 88108322b9a..856381f7e02 100644 --- a/packages/web/src/components/notification/Notification/Notification.tsx +++ b/packages/web/src/components/notification/Notification/Notification.tsx @@ -1,4 +1,7 @@ -import { Notification as Notifications, NotificationType } from '@audius/common' +import { + NotificationType, + Notification as Notifications +} from '@audius/common/store' import ErrorWrapper from 'components/error-wrapper/ErrorWrapper' diff --git a/packages/web/src/components/notification/Notification/RemixCosignNotification.tsx b/packages/web/src/components/notification/Notification/RemixCosignNotification.tsx index 0f660e92ee1..89cb7275032 100644 --- a/packages/web/src/components/notification/Notification/RemixCosignNotification.tsx +++ b/packages/web/src/components/notification/Notification/RemixCosignNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Nullable, - Name, notificationsSelectors, - RemixCosignNotification as RemixCosignNotificationType, - TrackEntity -} from '@audius/common' + TrackEntity, + RemixCosignNotification as RemixCosignNotificationType +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/RemixCreateNotification.tsx b/packages/web/src/components/notification/Notification/RemixCreateNotification.tsx index 8f6a571fb88..629da019620 100644 --- a/packages/web/src/components/notification/Notification/RemixCreateNotification.tsx +++ b/packages/web/src/components/notification/Notification/RemixCreateNotification.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, notificationsSelectors, - RemixCreateNotification as RemixCreateNotificationType, - TrackEntity -} from '@audius/common' + TrackEntity, + RemixCreateNotification as RemixCreateNotificationType +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/RepostNotification.tsx b/packages/web/src/components/notification/Notification/RepostNotification.tsx index 9643135530c..894d543e26b 100644 --- a/packages/web/src/components/notification/Notification/RepostNotification.tsx +++ b/packages/web/src/components/notification/Notification/RepostNotification.tsx @@ -1,10 +1,10 @@ import { MouseEventHandler, useCallback } from 'react' import { - Entity, notificationsSelectors, + Entity, RepostNotification as RepostNotificationType -} from '@audius/common' +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/RepostOfRepostNotification.tsx b/packages/web/src/components/notification/Notification/RepostOfRepostNotification.tsx index 4bfe8005786..566a39d0788 100644 --- a/packages/web/src/components/notification/Notification/RepostOfRepostNotification.tsx +++ b/packages/web/src/components/notification/Notification/RepostOfRepostNotification.tsx @@ -1,8 +1,8 @@ import { - Entity, notificationsSelectors, + Entity, RepostOfRepostNotification as RepostOfRepostNotificationType -} from '@audius/common' +} from '@audius/common/store' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/notification/Notification/SupporterDethronedNotification.tsx b/packages/web/src/components/notification/Notification/SupporterDethronedNotification.tsx index 7161594de06..af38a423090 100644 --- a/packages/web/src/components/notification/Notification/SupporterDethronedNotification.tsx +++ b/packages/web/src/components/notification/Notification/SupporterDethronedNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - Nullable, cacheUsersSelectors, notificationsSelectors, SupporterDethronedNotification as SupporterDethroned -} from '@audius/common' +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import crown from 'assets/img/crown2x.png' import { useSelector } from 'common/hooks/useSelector' diff --git a/packages/web/src/components/notification/Notification/TastemakerNotification.tsx b/packages/web/src/components/notification/Notification/TastemakerNotification.tsx index 9a41fdd908a..a2c822941b0 100644 --- a/packages/web/src/components/notification/Notification/TastemakerNotification.tsx +++ b/packages/web/src/components/notification/Notification/TastemakerNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - Nullable, notificationsSelectors, TrackEntity, TastemakerNotification as TastemakerNotificationType -} from '@audius/common' +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/TierChangeNotification.tsx b/packages/web/src/components/notification/Notification/TierChangeNotification.tsx index c8e107de2cf..0c9ad58a5da 100644 --- a/packages/web/src/components/notification/Notification/TierChangeNotification.tsx +++ b/packages/web/src/components/notification/Notification/TierChangeNotification.tsx @@ -1,9 +1,9 @@ import { notificationsSelectors, + badgeTiers, TierChangeNotification as TierChangeNotificationType, - BadgeTierInfo, - badgeTiers -} from '@audius/common' + BadgeTierInfo +} from '@audius/common/store' import { audioTierMapPng } from 'components/user-badges/UserBadges' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/notification/Notification/TipReactionNotification.tsx b/packages/web/src/components/notification/Notification/TipReactionNotification.tsx index 1671648447b..89212896cbb 100644 --- a/packages/web/src/components/notification/Notification/TipReactionNotification.tsx +++ b/packages/web/src/components/notification/Notification/TipReactionNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { useUIAudio } from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { - Name, - useUIAudio, notificationsSelectors, - ReactionNotification, - getReactionFromRawValue -} from '@audius/common' + getReactionFromRawValue, + ReactionNotification +} from '@audius/common/store' import { make } from 'common/store/analytics/actions' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/notification/Notification/TipReceivedNotification.tsx b/packages/web/src/components/notification/Notification/TipReceivedNotification.tsx index c9357a99e65..0bacd4b86c8 100644 --- a/packages/web/src/components/notification/Notification/TipReceivedNotification.tsx +++ b/packages/web/src/components/notification/Notification/TipReceivedNotification.tsx @@ -1,16 +1,16 @@ import { ComponentType, useCallback, useState } from 'react' +import { useUIAudio } from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { - Name, - Nullable, - useUIAudio, notificationsSelectors, - TipReceiveNotification, - reactionOrder, - ReactionTypes, reactionsUIActions, - reactionsUISelectors -} from '@audius/common' + reactionsUISelectors, + reactionOrder, + TipReceiveNotification, + ReactionTypes +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { useDispatch } from 'react-redux' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/notification/Notification/TipSentNotification.tsx b/packages/web/src/components/notification/Notification/TipSentNotification.tsx index c539dc26310..93cd206b4c5 100644 --- a/packages/web/src/components/notification/Notification/TipSentNotification.tsx +++ b/packages/web/src/components/notification/Notification/TipSentNotification.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { useUIAudio } from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { - Name, - useUIAudio, notificationsSelectors, TipSendNotification -} from '@audius/common' +} from '@audius/common/store' import { make } from 'common/store/analytics/actions' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/components/notification/Notification/TopSupporterNotification.tsx b/packages/web/src/components/notification/Notification/TopSupporterNotification.tsx index cd55f38f6fc..c0c8cd356ff 100644 --- a/packages/web/src/components/notification/Notification/TopSupporterNotification.tsx +++ b/packages/web/src/components/notification/Notification/TopSupporterNotification.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, notificationsSelectors, SupporterRankUpNotification -} from '@audius/common' +} from '@audius/common/store' import IconTrending from 'assets/img/iconTrending.svg' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/notification/Notification/TopSupportingNotification.tsx b/packages/web/src/components/notification/Notification/TopSupportingNotification.tsx index 05b001785ed..9a53bdd3a58 100644 --- a/packages/web/src/components/notification/Notification/TopSupportingNotification.tsx +++ b/packages/web/src/components/notification/Notification/TopSupportingNotification.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, notificationsSelectors, SupportingRankUpNotification -} from '@audius/common' +} from '@audius/common/store' import IconTrending from 'assets/img/iconTrending.svg' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/notification/Notification/TrendingPlaylistNotification.tsx b/packages/web/src/components/notification/Notification/TrendingPlaylistNotification.tsx index 586aaaea6d0..97c6185fa4f 100644 --- a/packages/web/src/components/notification/Notification/TrendingPlaylistNotification.tsx +++ b/packages/web/src/components/notification/Notification/TrendingPlaylistNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - Nullable, notificationsSelectors, - TrendingPlaylistNotification as TrendingPlaylistNotificationType, - CollectionEntity -} from '@audius/common' + CollectionEntity, + TrendingPlaylistNotification as TrendingPlaylistNotificationType +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/TrendingTrackNotification.tsx b/packages/web/src/components/notification/Notification/TrendingTrackNotification.tsx index a94bdbe7585..3a33d1bb081 100644 --- a/packages/web/src/components/notification/Notification/TrendingTrackNotification.tsx +++ b/packages/web/src/components/notification/Notification/TrendingTrackNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - Nullable, notificationsSelectors, TrackEntity, TrendingTrackNotification as TrendingTrackNotificationType -} from '@audius/common' +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/TrendingUndergroundNotification.tsx b/packages/web/src/components/notification/Notification/TrendingUndergroundNotification.tsx index 9a908fb8933..bfdc8398ae4 100644 --- a/packages/web/src/components/notification/Notification/TrendingUndergroundNotification.tsx +++ b/packages/web/src/components/notification/Notification/TrendingUndergroundNotification.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, - Nullable, notificationsSelectors, TrackEntity, TrendingUndergroundNotification as TrendingUndergroundNotificationType -} from '@audius/common' +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/USDCPurchaseBuyerNotification.tsx b/packages/web/src/components/notification/Notification/USDCPurchaseBuyerNotification.tsx index 14da73675a5..a8151b3d79e 100644 --- a/packages/web/src/components/notification/Notification/USDCPurchaseBuyerNotification.tsx +++ b/packages/web/src/components/notification/Notification/USDCPurchaseBuyerNotification.tsx @@ -1,13 +1,13 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Nullable, - Name, - USDCPurchaseBuyerNotification as USDCPurchaseBuyerNotificationType, - TrackEntity, + notificationsSelectors, Entity, - notificationsSelectors -} from '@audius/common' + TrackEntity, + USDCPurchaseBuyerNotification as USDCPurchaseBuyerNotificationType +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/USDCPurchaseSellerNotification.tsx b/packages/web/src/components/notification/Notification/USDCPurchaseSellerNotification.tsx index bb181a6985c..31d73a6377d 100644 --- a/packages/web/src/components/notification/Notification/USDCPurchaseSellerNotification.tsx +++ b/packages/web/src/components/notification/Notification/USDCPurchaseSellerNotification.tsx @@ -1,15 +1,17 @@ import { useCallback } from 'react' +import { StringUSDC } from '@audius/common/models' import { - Entity, - formatUSDCWeiToUSDString, notificationsSelectors, - Nullable, - StringUSDC, - stringUSDCToBN, + Entity, TrackEntity, USDCPurchaseSellerNotification as USDCPurchaseSellerNotificationType -} from '@audius/common' +} from '@audius/common/store' +import { + stringUSDCToBN, + formatUSDCWeiToUSDString, + Nullable +} from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/UserSubscriptionNotification.tsx b/packages/web/src/components/notification/Notification/UserSubscriptionNotification.tsx index 29a36f31014..5e2a5cbbe85 100644 --- a/packages/web/src/components/notification/Notification/UserSubscriptionNotification.tsx +++ b/packages/web/src/components/notification/Notification/UserSubscriptionNotification.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { Name } from '@audius/common/models' import { - Name, notificationsSelectors, Entity, UserSubscriptionNotification as UserSubscriptionNotificationType -} from '@audius/common' +} from '@audius/common/store' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/EntityLink.tsx b/packages/web/src/components/notification/Notification/components/EntityLink.tsx index 8b3490f71c7..bbc283e8683 100644 --- a/packages/web/src/components/notification/Notification/components/EntityLink.tsx +++ b/packages/web/src/components/notification/Notification/components/EntityLink.tsx @@ -1,6 +1,8 @@ import { MouseEventHandler, useCallback } from 'react' -import { Name, Collection, Track, User, Nullable, Entity } from '@audius/common' +import { Name, Collection, Track, User } from '@audius/common/models' +import { Entity } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/NotificationTile.tsx b/packages/web/src/components/notification/Notification/components/NotificationTile.tsx index c822931f63c..b966b5b1805 100644 --- a/packages/web/src/components/notification/Notification/components/NotificationTile.tsx +++ b/packages/web/src/components/notification/Notification/components/NotificationTile.tsx @@ -5,7 +5,7 @@ import { useCallback } from 'react' -import { Notification } from '@audius/common' +import { Notification } from '@audius/common/store' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/OthersLink.tsx b/packages/web/src/components/notification/Notification/components/OthersLink.tsx index 443f33c66d7..cb580209446 100644 --- a/packages/web/src/components/notification/Notification/components/OthersLink.tsx +++ b/packages/web/src/components/notification/Notification/components/OthersLink.tsx @@ -1,6 +1,6 @@ import { MouseEventHandler } from 'react' -import { formatCount } from '@audius/common' +import { formatCount } from '@audius/common/utils' import styles from './OthersLink.module.css' diff --git a/packages/web/src/components/notification/Notification/components/ProfilePicture.tsx b/packages/web/src/components/notification/Notification/components/ProfilePicture.tsx index c226fce5e4d..80220f16846 100644 --- a/packages/web/src/components/notification/Notification/components/ProfilePicture.tsx +++ b/packages/web/src/components/notification/Notification/components/ProfilePicture.tsx @@ -1,6 +1,6 @@ import { MouseEventHandler, useCallback, useEffect, useState } from 'react' -import { SquareSizes, User } from '@audius/common' +import { SquareSizes, User } from '@audius/common/models' import cn from 'classnames' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/Reaction/index.tsx b/packages/web/src/components/notification/Notification/components/Reaction/index.tsx index 14d4a06638d..ccbd39fe712 100644 --- a/packages/web/src/components/notification/Notification/components/Reaction/index.tsx +++ b/packages/web/src/components/notification/Notification/components/Reaction/index.tsx @@ -1,6 +1,6 @@ import React, { ComponentType } from 'react' -import { ReactionTypes } from '@audius/common' +import { ReactionTypes } from '@audius/common/store' import { Reaction, ReactionProps as BaseReactionProps } from './Reaction' diff --git a/packages/web/src/components/notification/Notification/components/TrackContent.tsx b/packages/web/src/components/notification/Notification/components/TrackContent.tsx index 7eb1edb1f12..591bd2486df 100644 --- a/packages/web/src/components/notification/Notification/components/TrackContent.tsx +++ b/packages/web/src/components/notification/Notification/components/TrackContent.tsx @@ -1,4 +1,5 @@ -import { SquareSizes, TrackEntity } from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import { TrackEntity } from '@audius/common/store' import CoSign, { Size } from 'components/co-sign/CoSign' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/components/notification/Notification/components/TwitterShareButton.tsx b/packages/web/src/components/notification/Notification/components/TwitterShareButton.tsx index 0b5a26e898b..a339358fff3 100644 --- a/packages/web/src/components/notification/Notification/components/TwitterShareButton.tsx +++ b/packages/web/src/components/notification/Notification/components/TwitterShareButton.tsx @@ -1,12 +1,12 @@ import { MouseEventHandler, useCallback } from 'react' +import { useTwitterButtonStatus } from '@audius/common/hooks' import { - Nullable, - useTwitterButtonStatus, - CommonState, cacheUsersActions, - cacheUsersSelectors -} from '@audius/common' + cacheUsersSelectors, + CommonState +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/UserNameLink.tsx b/packages/web/src/components/notification/Notification/components/UserNameLink.tsx index f76ce3dd009..63f0f359b09 100644 --- a/packages/web/src/components/notification/Notification/components/UserNameLink.tsx +++ b/packages/web/src/components/notification/Notification/components/UserNameLink.tsx @@ -1,6 +1,7 @@ import { MouseEventHandler, useCallback } from 'react' -import { Name, User, Notification } from '@audius/common' +import { Name, User } from '@audius/common/models' +import { Notification } from '@audius/common/store' import cn from 'classnames' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/components/UserProfilePictureList.tsx b/packages/web/src/components/notification/Notification/components/UserProfilePictureList.tsx index 2c2eab79c82..175914e9e3b 100644 --- a/packages/web/src/components/notification/Notification/components/UserProfilePictureList.tsx +++ b/packages/web/src/components/notification/Notification/components/UserProfilePictureList.tsx @@ -1,4 +1,5 @@ -import { User, formatCount } from '@audius/common' +import { User } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import Tooltip from 'components/tooltip/Tooltip' diff --git a/packages/web/src/components/notification/Notification/useGoToProfile.ts b/packages/web/src/components/notification/Notification/useGoToProfile.ts index eec196f1bd0..b765e910cb7 100644 --- a/packages/web/src/components/notification/Notification/useGoToProfile.ts +++ b/packages/web/src/components/notification/Notification/useGoToProfile.ts @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { User, Nullable } from '@audius/common' +import { User } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { push } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/notification/Notification/utils.ts b/packages/web/src/components/notification/Notification/utils.ts index c5465223f5d..5cfad5c31e4 100644 --- a/packages/web/src/components/notification/Notification/utils.ts +++ b/packages/web/src/components/notification/Notification/utils.ts @@ -1,4 +1,4 @@ -import { Entity, EntityType } from '@audius/common' +import { Entity, EntityType } from '@audius/common/store' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { UserListEntityType } from 'store/application/ui/userListModal/types' diff --git a/packages/web/src/components/notification/NotificationModal.tsx b/packages/web/src/components/notification/NotificationModal.tsx index 8aafb881e19..d09126508bb 100644 --- a/packages/web/src/components/notification/NotificationModal.tsx +++ b/packages/web/src/components/notification/NotificationModal.tsx @@ -1,4 +1,4 @@ -import { AnnouncementNotification } from '@audius/common' +import { AnnouncementNotification } from '@audius/common/store' import { Modal, Scrollbar, MarkdownViewer } from '@audius/stems' import IconRemove from 'assets/img/iconRemove.svg' diff --git a/packages/web/src/components/notification/NotificationPage.tsx b/packages/web/src/components/notification/NotificationPage.tsx index 314b5ef43ed..329728d437c 100644 --- a/packages/web/src/components/notification/NotificationPage.tsx +++ b/packages/web/src/components/notification/NotificationPage.tsx @@ -1,11 +1,11 @@ import { useEffect, useCallback, useContext } from 'react' +import { Status } from '@audius/common/models' import { - Status, + notificationsActions, notificationsSelectors, - Notification as Notifications, - notificationsActions -} from '@audius/common' + Notification as Notifications +} from '@audius/common/store' import InfiniteScroll from 'react-infinite-scroller' import Lottie from 'react-lottie' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/notification/NotificationPanel.tsx b/packages/web/src/components/notification/NotificationPanel.tsx index 437990669d4..b360d558d3b 100644 --- a/packages/web/src/components/notification/NotificationPanel.tsx +++ b/packages/web/src/components/notification/NotificationPanel.tsx @@ -1,12 +1,12 @@ import { useRef, useCallback, useEffect, RefObject } from 'react' +import { Status } from '@audius/common/models' import { - Status, - Nullable, + notificationsActions, notificationsSelectors, - Notification as Notifications, - notificationsActions -} from '@audius/common' + Notification as Notifications +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Popup, PopupPosition, Scrollbar } from '@audius/stems' import InfiniteScroll from 'react-infinite-scroller' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/now-playing/NowPlaying.tsx b/packages/web/src/components/now-playing/NowPlaying.tsx index 05d661320c7..a5dee08a670 100644 --- a/packages/web/src/components/now-playing/NowPlaying.tsx +++ b/packages/web/src/components/now-playing/NowPlaying.tsx @@ -1,35 +1,37 @@ import { useCallback, useEffect, useRef, useState } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - ID, - FavoriteSource, - RepostSource, - PlaybackSource, Name, ShareSource, + RepostSource, + FavoriteSource, + PlaybackSource, + ModalSource, + DogEarType, SquareSizes, - Genre, + ID +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, averageColorSelectors, queueActions, + queueSelectors, RepeatMode, tracksSocialActions, - OverflowAction, - OverflowActionCallbacks, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, + OverflowAction, + OverflowSource, + usePremiumContentPurchaseModal, playerActions, playerSelectors, - queueSelectors, playbackRateValueMap, - useGatedContentAccess, - DogEarType, gatedContentSelectors, - usePremiumContentPurchaseModal, - ModalSource, - FeatureFlags -} from '@audius/common' + OverflowActionCallbacks +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { Scrubber } from '@audius/stems' import { Location } from 'history' import { connect, useSelector } from 'react-redux' diff --git a/packages/web/src/components/now-playing/NowPlayingDrawer.tsx b/packages/web/src/components/now-playing/NowPlayingDrawer.tsx index fc609156a5c..5607bf6d418 100644 --- a/packages/web/src/components/now-playing/NowPlayingDrawer.tsx +++ b/packages/web/src/components/now-playing/NowPlayingDrawer.tsx @@ -1,6 +1,7 @@ import { useEffect, useCallback } from 'react' -import { useInstanceVar, nowPlayingUIActions } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' +import { nowPlayingUIActions } from '@audius/common/store' import { useDispatch } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useSpring, animated } from 'react-spring' diff --git a/packages/web/src/components/on-ramp-button/OnRampButton.tsx b/packages/web/src/components/on-ramp-button/OnRampButton.tsx index e5dc8573648..64d87c99975 100644 --- a/packages/web/src/components/on-ramp-button/OnRampButton.tsx +++ b/packages/web/src/components/on-ramp-button/OnRampButton.tsx @@ -1,4 +1,4 @@ -import { OnRampProvider } from '@audius/common' +import { OnRampProvider } from '@audius/common/store' import { Button, ButtonProps, ButtonType } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/page/Page.tsx b/packages/web/src/components/page/Page.tsx index 37b205d7850..b78da048123 100644 --- a/packages/web/src/components/page/Page.tsx +++ b/packages/web/src/components/page/Page.tsx @@ -8,7 +8,7 @@ import { MutableRefObject } from 'react' -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { Spring } from 'react-spring/renderprops.cjs' diff --git a/packages/web/src/components/password-reset/PasswordResetModal.tsx b/packages/web/src/components/password-reset/PasswordResetModal.tsx index dde07421f16..ca3891534a3 100644 --- a/packages/web/src/components/password-reset/PasswordResetModal.tsx +++ b/packages/web/src/components/password-reset/PasswordResetModal.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' -import { Status, accountSelectors } from '@audius/common' +import { Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Flex, Text } from '@audius/harmony' import { Modal } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/password-reset/store/reducer.ts b/packages/web/src/components/password-reset/store/reducer.ts index dc6c75fbc82..744a33418ed 100644 --- a/packages/web/src/components/password-reset/store/reducer.ts +++ b/packages/web/src/components/password-reset/store/reducer.ts @@ -1,4 +1,4 @@ -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import { ActionsMap } from 'utils/reducer' diff --git a/packages/web/src/components/password-reset/store/sagas.tsx b/packages/web/src/components/password-reset/store/sagas.tsx index bf69ab61fa4..e27f367a941 100644 --- a/packages/web/src/components/password-reset/store/sagas.tsx +++ b/packages/web/src/components/password-reset/store/sagas.tsx @@ -1,4 +1,4 @@ -import { getContext } from '@audius/common' +import { getContext } from '@audius/common/store' import { call, put, takeEvery } from 'redux-saga/effects' import * as actions from './actions' diff --git a/packages/web/src/components/password-reset/store/types.ts b/packages/web/src/components/password-reset/store/types.ts index c21ccd67998..ed0c11e1c83 100644 --- a/packages/web/src/components/password-reset/store/types.ts +++ b/packages/web/src/components/password-reset/store/types.ts @@ -1,4 +1,4 @@ -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' export type PasswordResetState = { status: Status diff --git a/packages/web/src/components/payment-method/PaymentMethod.tsx b/packages/web/src/components/payment-method/PaymentMethod.tsx index 62073bc4ee9..aed33313636 100644 --- a/packages/web/src/components/payment-method/PaymentMethod.tsx +++ b/packages/web/src/components/payment-method/PaymentMethod.tsx @@ -1,13 +1,11 @@ import { CSSProperties, ChangeEvent, useCallback } from 'react' +import { PurchaseMethod, PurchaseVendor, BNUSDC } from '@audius/common/models' import { - BNUSDC, - Nullable, - PurchaseMethod, - PurchaseVendor, formatCurrencyBalance, - formatUSDCWeiToFloorCentsNumber -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber, + Nullable +} from '@audius/common/utils' import { FilterButton, Flex, diff --git a/packages/web/src/components/pin-track-confirmation/PinTrackConfirmation.tsx b/packages/web/src/components/pin-track-confirmation/PinTrackConfirmation.tsx index 05220cf0fb7..2b6f26622d1 100644 --- a/packages/web/src/components/pin-track-confirmation/PinTrackConfirmation.tsx +++ b/packages/web/src/components/pin-track-confirmation/PinTrackConfirmation.tsx @@ -1,6 +1,7 @@ import { memo } from 'react' -import { ID, accountSelectors, tracksSocialActions } from '@audius/common' +import { ID } from '@audius/common/models' +import { accountSelectors, tracksSocialActions } from '@audius/common/store' import { Modal, Button, ButtonSize, ButtonType } from '@audius/stems' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/play-bar/PlayBarProvider.tsx b/packages/web/src/components/play-bar/PlayBarProvider.tsx index 91bcbd8d172..15a37c6bfcf 100644 --- a/packages/web/src/components/play-bar/PlayBarProvider.tsx +++ b/packages/web/src/components/play-bar/PlayBarProvider.tsx @@ -1,4 +1,4 @@ -import { modalsSelectors, playerSelectors } from '@audius/common' +import { modalsSelectors, playerSelectors } from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' import { RouteComponentProps, withRouter } from 'react-router-dom' diff --git a/packages/web/src/components/play-bar/desktop/PlayBar.jsx b/packages/web/src/components/play-bar/desktop/PlayBar.jsx index d2e663d0d5b..20e219ece44 100644 --- a/packages/web/src/components/play-bar/desktop/PlayBar.jsx +++ b/packages/web/src/components/play-bar/desktop/PlayBar.jsx @@ -1,25 +1,27 @@ import { Component } from 'react' import { + Name, RepostSource, FavoriteSource, - Name, PlaybackSource, - Genre, + Kind +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, + cacheTracksSelectors, lineupSelectors, queueActions, + queueSelectors, RepeatMode, tracksSocialActions, themeSelectors, playerActions, playerSelectors, - queueSelectors, - FeatureFlags, - playbackRateValueMap, - cacheTracksSelectors, - Kind -} from '@audius/common' + playbackRateValueMap +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { Scrubber } from '@audius/stems' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' diff --git a/packages/web/src/components/play-bar/desktop/components/PlayingTrackInfo.tsx b/packages/web/src/components/play-bar/desktop/components/PlayingTrackInfo.tsx index 496f5fa79d2..dcc3df068ab 100644 --- a/packages/web/src/components/play-bar/desktop/components/PlayingTrackInfo.tsx +++ b/packages/web/src/components/play-bar/desktop/components/PlayingTrackInfo.tsx @@ -1,15 +1,17 @@ import { memo, useEffect } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - ID, - Color, - ProfilePictureSizes, SquareSizes, - CommonState, + Color, + ID, + ProfilePictureSizes +} from '@audius/common/models' +import { cacheTracksSelectors, - useGatedContentAccess, - playerSelectors -} from '@audius/common' + playerSelectors, + CommonState +} from '@audius/common/store' import cn from 'classnames' import { useSelector } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web diff --git a/packages/web/src/components/play-bar/desktop/components/SocialActions.tsx b/packages/web/src/components/play-bar/desktop/components/SocialActions.tsx index f0f25dd4dd3..25e9cf49472 100644 --- a/packages/web/src/components/play-bar/desktop/components/SocialActions.tsx +++ b/packages/web/src/components/play-bar/desktop/components/SocialActions.tsx @@ -1,15 +1,12 @@ +import { useGatedContentAccess } from '@audius/common/hooks' +import { ModalSource, Theme, ID, UID } from '@audius/common/models' import { - ID, - UID, + cacheTracksSelectors, + themeSelectors, usePremiumContentPurchaseModal, gatedContentSelectors, - themeSelectors, - Theme, - useGatedContentAccess, - cacheTracksSelectors, - CommonState, - ModalSource -} from '@audius/common' + CommonState +} from '@audius/common/store' import { useSelector } from 'react-redux' import FavoriteButton from 'components/alt-button/FavoriteButton' diff --git a/packages/web/src/components/play-bar/mobile/PlayBar.tsx b/packages/web/src/components/play-bar/mobile/PlayBar.tsx index f839c9b90ad..75447704587 100644 --- a/packages/web/src/components/play-bar/mobile/PlayBar.tsx +++ b/packages/web/src/components/play-bar/mobile/PlayBar.tsx @@ -1,17 +1,19 @@ import { useEffect, useState } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - ID, - FavoriteSource, Name, + FavoriteSource, PlaybackSource, SquareSizes, + ID +} from '@audius/common/models' +import { queueActions, - tracksSocialActions, - playerSelectors, queueSelectors, - useGatedContentAccess -} from '@audius/common' + tracksSocialActions, + playerSelectors +} from '@audius/common/store' import { IconLock } from '@audius/stems' import cn from 'classnames' import { connect, useSelector } from 'react-redux' diff --git a/packages/web/src/components/play-bar/next-button/NextButtonProvider.tsx b/packages/web/src/components/play-bar/next-button/NextButtonProvider.tsx index 12893c646f1..bd6d96553a0 100644 --- a/packages/web/src/components/play-bar/next-button/NextButtonProvider.tsx +++ b/packages/web/src/components/play-bar/next-button/NextButtonProvider.tsx @@ -1,4 +1,5 @@ -import { Genre, playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { useSelector } from 'react-redux' import ForwardSkipButton, { ForwardSkipButtonProps } from './ForwardSkipButton' diff --git a/packages/web/src/components/play-bar/playback-rate-button/PlaybackRateButton.tsx b/packages/web/src/components/play-bar/playback-rate-button/PlaybackRateButton.tsx index 6eeee1d59db..edeceff1cd5 100644 --- a/packages/web/src/components/play-bar/playback-rate-button/PlaybackRateButton.tsx +++ b/packages/web/src/components/play-bar/playback-rate-button/PlaybackRateButton.tsx @@ -1,6 +1,10 @@ import { MutableRefObject, useCallback, useMemo } from 'react' -import { PlaybackRate, playerActions, playerSelectors } from '@audius/common' +import { + playerActions, + playerSelectors, + PlaybackRate +} from '@audius/common/store' import { PopupMenu, PopupMenuItem, PopupPosition } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/play-bar/previous-button/PreviousButtonProvider.tsx b/packages/web/src/components/play-bar/previous-button/PreviousButtonProvider.tsx index 74ee53ec518..245617ab0fe 100644 --- a/packages/web/src/components/play-bar/previous-button/PreviousButtonProvider.tsx +++ b/packages/web/src/components/play-bar/previous-button/PreviousButtonProvider.tsx @@ -1,4 +1,5 @@ -import { Genre, playerSelectors } from '@audius/common' +import { playerSelectors } from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { useSelector } from 'react-redux' import BackwardSkipButton, { diff --git a/packages/web/src/components/premium-content-purchase-modal/PremiumContentPurchaseModal.tsx b/packages/web/src/components/premium-content-purchase-modal/PremiumContentPurchaseModal.tsx index 92590a448f6..f0e9e763f63 100644 --- a/packages/web/src/components/premium-content-purchase-modal/PremiumContentPurchaseModal.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/PremiumContentPurchaseModal.tsx @@ -1,23 +1,24 @@ import { useCallback, useEffect } from 'react' +import { useGetTrackById } from '@audius/common/api' import { PurchaseableTrackMetadata, - PurchaseContentStage, - Track, - isTrackPurchaseable, - useGetTrackById, - usePremiumContentPurchaseModal, + useFeatureFlag, usePurchaseContentFormConfiguration, + usePayExtraPresets, + isTrackPurchaseable +} from '@audius/common/hooks' +import { PurchaseVendor, Track } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { buyUSDCActions, + usePremiumContentPurchaseModal, purchaseContentActions, purchaseContentSelectors, - isContentPurchaseInProgress, - usePayExtraPresets, + PurchaseContentStage, PurchaseContentPage, - useFeatureFlag, - FeatureFlags, - PurchaseVendor -} from '@audius/common' + isContentPurchaseInProgress +} from '@audius/common/store' import { USDC } from '@audius/fixed-decimal' import { Flex } from '@audius/harmony' import { diff --git a/packages/web/src/components/premium-content-purchase-modal/components/PayExtraFormSection.tsx b/packages/web/src/components/premium-content-purchase-modal/components/PayExtraFormSection.tsx index 0fc7e665b9e..d3b481d79d1 100644 --- a/packages/web/src/components/premium-content-purchase-modal/components/PayExtraFormSection.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/components/PayExtraFormSection.tsx @@ -1,9 +1,9 @@ import { - AMOUNT_PRESET, - CUSTOM_AMOUNT, PayExtraAmountPresetValues, - PayExtraPreset -} from '@audius/common' + PayExtraPreset, + CUSTOM_AMOUNT, + AMOUNT_PRESET +} from '@audius/common/hooks' import { Text, Flex, SelectablePill } from '@audius/harmony' import { useField } from 'formik' diff --git a/packages/web/src/components/premium-content-purchase-modal/components/PayToUnlockInfo.tsx b/packages/web/src/components/premium-content-purchase-modal/components/PayToUnlockInfo.tsx index 4847d60cb61..3e064397d54 100644 --- a/packages/web/src/components/premium-content-purchase-modal/components/PayToUnlockInfo.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/components/PayToUnlockInfo.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { Link } from 'react-router-dom' import { LockedStatusBadge } from 'components/track/LockedStatusBadge' diff --git a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFields.tsx b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFields.tsx index ccb0b0db3f2..747a321ce03 100644 --- a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFields.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFields.tsx @@ -1,19 +1,17 @@ import { useCallback, useEffect } from 'react' import { - PurchaseContentStage, - usePayExtraPresets, + useFeatureFlag, + useRemoteVar, useUSDCBalance, + usePayExtraPresets, PURCHASE_METHOD, - PurchaseVendor, PURCHASE_VENDOR, - usePurchaseMethod, - PurchaseMethod, - useFeatureFlag, - FeatureFlags, - useRemoteVar, - IntKeys -} from '@audius/common' + usePurchaseMethod +} from '@audius/common/hooks' +import { PurchaseMethod, PurchaseVendor } from '@audius/common/models' +import { IntKeys, FeatureFlags } from '@audius/common/services' +import { PurchaseContentStage } from '@audius/common/store' import { Flex } from '@audius/harmony' import { IconCheck } from '@audius/stems' import { useField } from 'formik' diff --git a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFooter.tsx b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFooter.tsx index 59aaa945c51..e8f544c1bca 100644 --- a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFooter.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseContentFormFooter.tsx @@ -1,13 +1,15 @@ import { useCallback } from 'react' import { - Name, PurchaseableTrackMetadata, - PurchaseContentError, - PurchaseContentStage, - formatPrice, usePurchaseContentErrorMessage -} from '@audius/common' +} from '@audius/common/hooks' +import { Name } from '@audius/common/models' +import { + PurchaseContentStage, + PurchaseContentError +} from '@audius/common/store' +import { formatPrice } from '@audius/common/utils' import { Button } from '@audius/harmony' import { HarmonyPlainButton, diff --git a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseSummaryTable.tsx b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseSummaryTable.tsx index 585ce007f80..65d9911a6f6 100644 --- a/packages/web/src/components/premium-content-purchase-modal/components/PurchaseSummaryTable.tsx +++ b/packages/web/src/components/premium-content-purchase-modal/components/PurchaseSummaryTable.tsx @@ -1,4 +1,4 @@ -import { formatPrice } from '@audius/common' +import { formatPrice } from '@audius/common/utils' import { SummaryTable, SummaryTableItem } from 'components/summary-table' import { Text } from 'components/typography' diff --git a/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseContentFormState.ts b/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseContentFormState.ts index 2e142df0c09..ba897bf63a8 100644 --- a/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseContentFormState.ts +++ b/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseContentFormState.ts @@ -1,8 +1,8 @@ +import { useUSDCBalance } from '@audius/common/hooks' import { purchaseContentSelectors, - isContentPurchaseInProgress, - useUSDCBalance -} from '@audius/common' + isContentPurchaseInProgress +} from '@audius/common/store' import { useSelector } from 'react-redux' import { usePurchaseSummaryValues } from './usePurchaseSummaryValues' diff --git a/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseSummaryValues.ts b/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseSummaryValues.ts index 04d275f50b9..af3d5898da3 100644 --- a/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseSummaryValues.ts +++ b/packages/web/src/components/premium-content-purchase-modal/hooks/usePurchaseSummaryValues.ts @@ -1,14 +1,14 @@ import { - Nullable, - BNUSDC, - CUSTOM_AMOUNT, - AMOUNT_PRESET, + useUSDCPurchaseConfig, + usePayExtraPresets, getExtraAmount, - getPurchaseSummaryValues, PayExtraPreset, - usePayExtraPresets, - useUSDCPurchaseConfig -} from '@audius/common' + CUSTOM_AMOUNT, + AMOUNT_PRESET +} from '@audius/common/hooks' +import { BNUSDC } from '@audius/common/models' +import { getPurchaseSummaryValues } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { useField } from 'formik' export const usePurchaseSummaryValues = ({ diff --git a/packages/web/src/components/profile-info/ProfileInfo.tsx b/packages/web/src/components/profile-info/ProfileInfo.tsx index 30b0fc21c19..29bf0685cc0 100644 --- a/packages/web/src/components/profile-info/ProfileInfo.tsx +++ b/packages/web/src/components/profile-info/ProfileInfo.tsx @@ -1,4 +1,5 @@ -import { SquareSizes, User, Nullable } from '@audius/common' +import { SquareSizes, User } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import UserBadges from 'components/user-badges/UserBadges' diff --git a/packages/web/src/components/profile-picture/ProfilePicture.jsx b/packages/web/src/components/profile-picture/ProfilePicture.jsx index eccf9d3b839..e4ad4c92ccb 100644 --- a/packages/web/src/components/profile-picture/ProfilePicture.jsx +++ b/packages/web/src/components/profile-picture/ProfilePicture.jsx @@ -1,6 +1,6 @@ import { memo, useState, useEffect } from 'react' -import { SquareSizes } from '@audius/common' +import { SquareSizes } from '@audius/common/models' import cn from 'classnames' import PropTypes from 'prop-types' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/profile-progress/ConnectedProfileCompletionHeroCard.jsx b/packages/web/src/components/profile-progress/ConnectedProfileCompletionHeroCard.jsx index b172b20f80a..82247045791 100644 --- a/packages/web/src/components/profile-progress/ConnectedProfileCompletionHeroCard.jsx +++ b/packages/web/src/components/profile-progress/ConnectedProfileCompletionHeroCard.jsx @@ -1,4 +1,4 @@ -import { challengesSelectors, profilePageActions } from '@audius/common' +import { challengesSelectors, profilePageActions } from '@audius/common/store' import { connect } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { animated } from 'react-spring' diff --git a/packages/web/src/components/profile-progress/ConnectedProfileCompletionPane.jsx b/packages/web/src/components/profile-progress/ConnectedProfileCompletionPane.jsx index 6168b06e42a..186bd1fa171 100644 --- a/packages/web/src/components/profile-progress/ConnectedProfileCompletionPane.jsx +++ b/packages/web/src/components/profile-progress/ConnectedProfileCompletionPane.jsx @@ -1,10 +1,10 @@ import { useState, useEffect } from 'react' import { - musicConfettiActions, accountSelectors, - challengesSelectors -} from '@audius/common' + challengesSelectors, + musicConfettiActions +} from '@audius/common/store' import { connect, useDispatch } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { animated } from 'react-spring' diff --git a/packages/web/src/components/profile-progress/hooks/index.js b/packages/web/src/components/profile-progress/hooks/index.js index 5b5df204a2f..fd668f49703 100644 --- a/packages/web/src/components/profile-progress/hooks/index.js +++ b/packages/web/src/components/profile-progress/hooks/index.js @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { useDispatch } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useTransition } from 'react-spring' diff --git a/packages/web/src/components/publish-track-confirmation-modal/PublishTrackConfirmationModal.tsx b/packages/web/src/components/publish-track-confirmation-modal/PublishTrackConfirmationModal.tsx index 4173ef74a5b..5da8fcfb1d9 100644 --- a/packages/web/src/components/publish-track-confirmation-modal/PublishTrackConfirmationModal.tsx +++ b/packages/web/src/components/publish-track-confirmation-modal/PublishTrackConfirmationModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { publishTrackConfirmationModalUISelectors } from '@audius/common' +import { publishTrackConfirmationModalUISelectors } from '@audius/common/store' import { IconRocket } from '@audius/harmony' import { Button, diff --git a/packages/web/src/components/related-artists/RelatedArtists.tsx b/packages/web/src/components/related-artists/RelatedArtists.tsx index 8cca21e5646..d3e0dcf83ff 100644 --- a/packages/web/src/components/related-artists/RelatedArtists.tsx +++ b/packages/web/src/components/related-artists/RelatedArtists.tsx @@ -1,12 +1,10 @@ import { useCallback } from 'react' -import type { User } from '@audius/common' -import { - profilePageSelectors, - MAX_PROFILE_RELATED_ARTISTS, - FeatureFlags, - useGetRelatedArtists -} from '@audius/common' +import { useGetRelatedArtists } from '@audius/common/api' +import { User } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { profilePageSelectors } from '@audius/common/store' +import { MAX_PROFILE_RELATED_ARTISTS } from '@audius/common/utils' import { IconUserGroup } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/remix-card/ConnectedRemixCard.tsx b/packages/web/src/components/remix-card/ConnectedRemixCard.tsx index 146277db25c..3971258101b 100644 --- a/packages/web/src/components/remix-card/ConnectedRemixCard.tsx +++ b/packages/web/src/components/remix-card/ConnectedRemixCard.tsx @@ -1,11 +1,7 @@ import { useCallback } from 'react' -import { - ID, - SquareSizes, - cacheTracksSelectors, - cacheUsersSelectors -} from '@audius/common' +import { SquareSizes, ID } from '@audius/common/models' +import { cacheTracksSelectors, cacheUsersSelectors } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/remix-card/RemixCard.tsx b/packages/web/src/components/remix-card/RemixCard.tsx index 7bfd2ada998..7938a91d6a3 100644 --- a/packages/web/src/components/remix-card/RemixCard.tsx +++ b/packages/web/src/components/remix-card/RemixCard.tsx @@ -1,4 +1,4 @@ -import { ID, Remix } from '@audius/common' +import { ID, Remix } from '@audius/common/models' import { ArtistPopover } from 'components/artist/ArtistPopover' import CoSign from 'components/co-sign/CoSign' diff --git a/packages/web/src/components/remix-settings-modal/ConnectedRemixSettingsModal.tsx b/packages/web/src/components/remix-settings-modal/ConnectedRemixSettingsModal.tsx index aea17192aa7..bca09c3486b 100644 --- a/packages/web/src/components/remix-settings-modal/ConnectedRemixSettingsModal.tsx +++ b/packages/web/src/components/remix-settings-modal/ConnectedRemixSettingsModal.tsx @@ -1,13 +1,11 @@ import { useEffect } from 'react' +import { Status, ID, AccessConditions } from '@audius/common/models' import { - ID, - Status, remixSettingsSelectors, - remixSettingsActions, - Nullable, - AccessConditions -} from '@audius/common' + remixSettingsActions +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/remix-settings-modal/RemixSettingsModal.tsx b/packages/web/src/components/remix-settings-modal/RemixSettingsModal.tsx index fbd5566aed5..7eb150b2ac1 100644 --- a/packages/web/src/components/remix-settings-modal/RemixSettingsModal.tsx +++ b/packages/web/src/components/remix-settings-modal/RemixSettingsModal.tsx @@ -1,15 +1,15 @@ import { useCallback, useState, useEffect, useRef } from 'react' import { + SquareSizes, + isContentCollectibleGated, + isContentUSDCPurchaseGated, ID, - Nullable, AccessConditions, - SquareSizes, Track, - User, - isContentCollectibleGated, - isContentUSDCPurchaseGated -} from '@audius/common' + User +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { Modal, Button, diff --git a/packages/web/src/components/repost-favorites-stats/RepostFavoritesStats.tsx b/packages/web/src/components/repost-favorites-stats/RepostFavoritesStats.tsx index c1d6b76be8e..c022e7b85a9 100644 --- a/packages/web/src/components/repost-favorites-stats/RepostFavoritesStats.tsx +++ b/packages/web/src/components/repost-favorites-stats/RepostFavoritesStats.tsx @@ -1,6 +1,6 @@ import { useCallback, MouseEvent } from 'react' -import { pluralize, formatCount } from '@audius/common' +import { formatCount, pluralize } from '@audius/common/utils' import cn from 'classnames' import IconFavorite from 'assets/img/iconHeart.svg' diff --git a/packages/web/src/components/reward-claimed-toast/RewardClaimedToast.tsx b/packages/web/src/components/reward-claimed-toast/RewardClaimedToast.tsx index 5ce22eafc10..2de0acea9ab 100644 --- a/packages/web/src/components/reward-claimed-toast/RewardClaimedToast.tsx +++ b/packages/web/src/components/reward-claimed-toast/RewardClaimedToast.tsx @@ -1,9 +1,9 @@ import { useContext, useEffect } from 'react' import { - audioRewardsPageActions, - audioRewardsPageSelectors -} from '@audius/common' + audioRewardsPageSelectors, + audioRewardsPageActions +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import IconCaretRight from 'assets/img/iconCaretRight.svg' diff --git a/packages/web/src/components/scheduled-release-label/ScheduledReleaseLabel.tsx b/packages/web/src/components/scheduled-release-label/ScheduledReleaseLabel.tsx index f7f25476560..c63e4437ca2 100644 --- a/packages/web/src/components/scheduled-release-label/ScheduledReleaseLabel.tsx +++ b/packages/web/src/components/scheduled-release-label/ScheduledReleaseLabel.tsx @@ -1,4 +1,4 @@ -import { getLocalTimezone } from '@audius/common' +import { getLocalTimezone } from '@audius/common/utils' import { Text, IconCalendarMonth } from '@audius/harmony' import cn from 'classnames' import moment from 'moment' diff --git a/packages/web/src/components/scroll-provider/ScrollProvider.tsx b/packages/web/src/components/scroll-provider/ScrollProvider.tsx index 87887df1606..4d80d5b8f5e 100644 --- a/packages/web/src/components/scroll-provider/ScrollProvider.tsx +++ b/packages/web/src/components/scroll-provider/ScrollProvider.tsx @@ -1,6 +1,6 @@ import { memo, createContext, useCallback } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { matchPath } from 'react-router-dom' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/components/search-bar/ConnectedSearchBar.jsx b/packages/web/src/components/search-bar/ConnectedSearchBar.jsx index 690bac79e5f..deefd0b4fda 100644 --- a/packages/web/src/components/search-bar/ConnectedSearchBar.jsx +++ b/packages/web/src/components/search-bar/ConnectedSearchBar.jsx @@ -1,12 +1,11 @@ import { Component } from 'react' import { - Name, - SquareSizes, - getTierForUser, imageBlank as placeholderArt, imageProfilePicEmpty as profilePicEmpty -} from '@audius/common' +} from '@audius/common/assets' +import { Name, SquareSizes } from '@audius/common/models' +import { getTierForUser } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { has } from 'lodash' import { connect } from 'react-redux' diff --git a/packages/web/src/components/search-bar/SearchBar.tsx b/packages/web/src/components/search-bar/SearchBar.tsx index 9b55a3510d8..5a7d9aff3ac 100644 --- a/packages/web/src/components/search-bar/SearchBar.tsx +++ b/packages/web/src/components/search-bar/SearchBar.tsx @@ -1,6 +1,6 @@ import { ChangeEvent, KeyboardEvent } from 'react' -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import cn from 'classnames' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/search-users-modal/SearchUsersModal.tsx b/packages/web/src/components/search-users-modal/SearchUsersModal.tsx index 663fcc9aac2..0296392e951 100644 --- a/packages/web/src/components/search-users-modal/SearchUsersModal.tsx +++ b/packages/web/src/components/search-users-modal/SearchUsersModal.tsx @@ -7,15 +7,13 @@ import { useState } from 'react' +import { useProxySelector } from '@audius/common/hooks' +import { Status, ID, User } from '@audius/common/models' import { cacheUsersSelectors, - searchUsersModalSelectors, searchUsersModalActions, - useProxySelector, - User, - ID, - Status -} from '@audius/common' + searchUsersModalSelectors +} from '@audius/common/store' import { IconButton, IconRemove, diff --git a/packages/web/src/components/search/SearchBar.jsx b/packages/web/src/components/search/SearchBar.jsx index 5735b022dfa..ad18d5aeb02 100644 --- a/packages/web/src/components/search/SearchBar.jsx +++ b/packages/web/src/components/search/SearchBar.jsx @@ -1,6 +1,6 @@ import { createRef, Component } from 'react' -import { Kind, Status } from '@audius/common' +import { Kind, Status } from '@audius/common/models' import AutoComplete from 'antd/lib/auto-complete' import Input from 'antd/lib/input' import cn from 'classnames' diff --git a/packages/web/src/components/search/SearchBarResult.jsx b/packages/web/src/components/search/SearchBarResult.jsx index 9b323653630..b2557c10652 100644 --- a/packages/web/src/components/search/SearchBarResult.jsx +++ b/packages/web/src/components/search/SearchBarResult.jsx @@ -1,6 +1,7 @@ import { useState, useEffect, memo } from 'react' -import { Kind, imageBlank as placeholderArt } from '@audius/common' +import { imageBlank as placeholderArt } from '@audius/common/assets' +import { Kind } from '@audius/common/models' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/search/SearchTag.tsx b/packages/web/src/components/search/SearchTag.tsx index ae732507e38..fca15f824ee 100644 --- a/packages/web/src/components/search/SearchTag.tsx +++ b/packages/web/src/components/search/SearchTag.tsx @@ -1,6 +1,6 @@ import { useCallback, MouseEvent } from 'react' -import { AllTrackingEvents, Name } from '@audius/common' +import { Name, AllTrackingEvents } from '@audius/common/models' import { Tag } from '@audius/stems' import type { TagProps } from '@audius/stems' import { Link } from 'react-router-dom' diff --git a/packages/web/src/components/share-modal/ShareModal.tsx b/packages/web/src/components/share-modal/ShareModal.tsx index 841175c6f2f..66191efb002 100644 --- a/packages/web/src/components/share-modal/ShareModal.tsx +++ b/packages/web/src/components/share-modal/ShareModal.tsx @@ -1,8 +1,8 @@ import { useCallback, useContext } from 'react' +import { Name, PlayableType } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - Name, - FeatureFlags, accountSelectors, collectionsSocialActions, tracksSocialActions, @@ -10,9 +10,8 @@ import { shareModalUISelectors, shareSoundToTiktokModalActions, modalsActions, - PlayableType, useCreateChatModal -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { make, useRecord } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/share-modal/messages.ts b/packages/web/src/components/share-modal/messages.ts index 6f81dfd60b7..f19831e7177 100644 --- a/packages/web/src/components/share-modal/messages.ts +++ b/packages/web/src/components/share-modal/messages.ts @@ -1,4 +1,4 @@ -import { ShareType } from '@audius/common' +import { ShareType } from '@audius/common/store' const shareTypeMap: Record = { track: 'Track', diff --git a/packages/web/src/components/share-modal/types.ts b/packages/web/src/components/share-modal/types.ts index 69a7a74a79c..c66890846cb 100644 --- a/packages/web/src/components/share-modal/types.ts +++ b/packages/web/src/components/share-modal/types.ts @@ -1,4 +1,4 @@ -import { ShareType } from '@audius/common' +import { ShareType } from '@audius/common/store' export type ShareProps = { onShareToDirectMessage: () => void diff --git a/packages/web/src/components/share-modal/utils.ts b/packages/web/src/components/share-modal/utils.ts index 94b9fcc1bb9..1f5af852a6f 100644 --- a/packages/web/src/components/share-modal/utils.ts +++ b/packages/web/src/components/share-modal/utils.ts @@ -1,4 +1,5 @@ -import { ShareToTwitter, ShareContent } from '@audius/common' +import { ShareToTwitter } from '@audius/common/models' +import { ShareContent } from '@audius/common/store' import { getTwitterHandleByUserHandle } from 'components/notification/Notification/utils' import { diff --git a/packages/web/src/components/share-sound-to-tiktok-modal/ShareSoundToTikTokModal.tsx b/packages/web/src/components/share-sound-to-tiktok-modal/ShareSoundToTikTokModal.tsx index 19674670596..2e795b5988e 100644 --- a/packages/web/src/components/share-sound-to-tiktok-modal/ShareSoundToTikTokModal.tsx +++ b/packages/web/src/components/share-sound-to-tiktok-modal/ShareSoundToTikTokModal.tsx @@ -1,11 +1,11 @@ import { useCallback, useMemo } from 'react' import { - Nullable, - ShareSoundToTiktokModalStatus, shareSoundToTiktokModalActions, - shareSoundToTiktokModalSelectors -} from '@audius/common' + shareSoundToTiktokModalSelectors, + ShareSoundToTiktokModalStatus +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Button, Modal, diff --git a/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts b/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts index 725cdd76986..17d10cdb254 100644 --- a/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts +++ b/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts @@ -1,15 +1,14 @@ +import { Name } from '@audius/common/models' import { - Name, - getContext, - getErrorMessage, - encodeHashId, cacheTracksSelectors, - modalsActions, - ShareSoundToTiktokModalStatus, shareSoundToTiktokModalActions, shareSoundToTiktokModalSelectors, + modalsActions, + ShareSoundToTiktokModalStatus, + getContext, musicConfettiActions -} from '@audius/common' +} from '@audius/common/store' +import { getErrorMessage, encodeHashId } from '@audius/common/utils' import { takeEvery, put, call, select } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/components/sign-on/EnterPassword.tsx b/packages/web/src/components/sign-on/EnterPassword.tsx index dc99b760166..885b88df408 100644 --- a/packages/web/src/components/sign-on/EnterPassword.tsx +++ b/packages/web/src/components/sign-on/EnterPassword.tsx @@ -1,4 +1,4 @@ -import { passwordSchema } from '@audius/common' +import { passwordSchema } from '@audius/common/schemas' import { Button, Flex, IconArrowRight, IconComponent } from '@audius/harmony' import { Form, Formik } from 'formik' import { toFormikValidationSchema } from 'zod-formik-adapter' diff --git a/packages/web/src/components/social-proof/SocialProof.tsx b/packages/web/src/components/social-proof/SocialProof.tsx index 92224dab112..e854b7cfc18 100644 --- a/packages/web/src/components/social-proof/SocialProof.tsx +++ b/packages/web/src/components/social-proof/SocialProof.tsx @@ -1,15 +1,14 @@ import { useCallback, useEffect, useState } from 'react' +import { Name, Status } from '@audius/common/models' +import { BooleanKeys } from '@audius/common/services' import { - Name, - Status, - BooleanKeys, + accountActions, accountSelectors, - TwitterProfile, InstagramProfile, - accountActions, + TwitterProfile, TikTokProfile -} from '@audius/common' +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import IconValidationX from 'assets/img/iconValidationX.svg' diff --git a/packages/web/src/components/stat-banner/StatBanner.tsx b/packages/web/src/components/stat-banner/StatBanner.tsx index 3c121e0de2c..a137a253e79 100644 --- a/packages/web/src/components/stat-banner/StatBanner.tsx +++ b/packages/web/src/components/stat-banner/StatBanner.tsx @@ -1,6 +1,7 @@ import { useRef } from 'react' -import { FeatureFlags, ID } from '@audius/common' +import { ID } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { Button, ButtonSize, diff --git a/packages/web/src/components/stats/Stats.tsx b/packages/web/src/components/stats/Stats.tsx index 87709b65fd7..9103e3ac010 100644 --- a/packages/web/src/components/stats/Stats.tsx +++ b/packages/web/src/components/stats/Stats.tsx @@ -1,4 +1,5 @@ -import { ID, formatCount } from '@audius/common' +import { ID } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/stem-files-modal/StemFilesModal.tsx b/packages/web/src/components/stem-files-modal/StemFilesModal.tsx index 5a4da24bca0..e51918750e2 100644 --- a/packages/web/src/components/stem-files-modal/StemFilesModal.tsx +++ b/packages/web/src/components/stem-files-modal/StemFilesModal.tsx @@ -4,9 +4,9 @@ import { StemCategory, stemCategoryFriendlyNames, StemUpload, - Download, - FeatureFlags -} from '@audius/common' + Download +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { Flex, Box, Text as HarmonyText } from '@audius/harmony' import { Button, diff --git a/packages/web/src/components/stripe-on-ramp-modal/StripeOnRampModal.tsx b/packages/web/src/components/stripe-on-ramp-modal/StripeOnRampModal.tsx index cb9f32ea7a0..b3326ff95bf 100644 --- a/packages/web/src/components/stripe-on-ramp-modal/StripeOnRampModal.tsx +++ b/packages/web/src/components/stripe-on-ramp-modal/StripeOnRampModal.tsx @@ -1,6 +1,9 @@ import { MouseEvent, useCallback, useEffect, useState, useRef } from 'react' -import { stripeModalUISelectors, stripeModalUIActions } from '@audius/common' +import { + stripeModalUIActions, + stripeModalUISelectors +} from '@audius/common/store' import { loadStripeOnramp, OnrampSession } from '@stripe/crypto' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/suggested-tracks/SuggestedCollectionTracks.tsx b/packages/web/src/components/suggested-tracks/SuggestedCollectionTracks.tsx index 71dcaae23a8..73f97b987af 100644 --- a/packages/web/src/components/suggested-tracks/SuggestedCollectionTracks.tsx +++ b/packages/web/src/components/suggested-tracks/SuggestedCollectionTracks.tsx @@ -1,11 +1,10 @@ import { - ID, - Status, - useGetCurrentUserId, useGetPlaylistById, useGetSuggestedAlbumTracks, - useGetSuggestedPlaylistTracks -} from '@audius/common' + useGetSuggestedPlaylistTracks, + useGetCurrentUserId +} from '@audius/common/api' +import { Status, ID } from '@audius/common/models' import { SuggestedTracks } from './components/SuggestedTracks' diff --git a/packages/web/src/components/suggested-tracks/components/SuggestedTracks.tsx b/packages/web/src/components/suggested-tracks/components/SuggestedTracks.tsx index a4ba9cf3f20..e56c756d41e 100644 --- a/packages/web/src/components/suggested-tracks/components/SuggestedTracks.tsx +++ b/packages/web/src/components/suggested-tracks/components/SuggestedTracks.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react' -import { ID, SquareSizes, Track, cacheUsersSelectors } from '@audius/common' -import type { SuggestedTrack } from '@audius/common' +import { SuggestedTrack } from '@audius/common/api' +import { SquareSizes, ID, Track } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import { Button, ButtonSize, diff --git a/packages/web/src/components/table/Table.tsx b/packages/web/src/components/table/Table.tsx index 2df2a073f90..eb9bca56c91 100644 --- a/packages/web/src/components/table/Table.tsx +++ b/packages/web/src/components/table/Table.tsx @@ -7,7 +7,7 @@ import { useState } from 'react' -import { ID, Kind, TrackMetadata } from '@audius/common' +import { Kind, ID, TrackMetadata } from '@audius/common/models' import cn from 'classnames' import { debounce, range } from 'lodash' import moment from 'moment' diff --git a/packages/web/src/components/tiktok-auth/TikTokAuthButton.tsx b/packages/web/src/components/tiktok-auth/TikTokAuthButton.tsx index cce9feb348a..1db3b0f3167 100644 --- a/packages/web/src/components/tiktok-auth/TikTokAuthButton.tsx +++ b/packages/web/src/components/tiktok-auth/TikTokAuthButton.tsx @@ -1,6 +1,6 @@ import { MouseEvent, ReactElement, cloneElement, useCallback } from 'react' -import { TikTokProfile } from '@audius/common' +import { TikTokProfile } from '@audius/common/store' import { TikTokButton, diff --git a/packages/web/src/components/tile/Tile.tsx b/packages/web/src/components/tile/Tile.tsx index ecb3db4710a..d71a9b00534 100644 --- a/packages/web/src/components/tile/Tile.tsx +++ b/packages/web/src/components/tile/Tile.tsx @@ -7,7 +7,7 @@ import { Ref } from 'react' -import { DogEarType } from '@audius/common' +import { DogEarType } from '@audius/common/models' import cn from 'classnames' import { DogEar } from 'components/dog-ear' diff --git a/packages/web/src/components/tipping/feed-tip-tile/FeedTipTile.tsx b/packages/web/src/components/tipping/feed-tip-tile/FeedTipTile.tsx index 21ffb08619a..02539ee49b2 100644 --- a/packages/web/src/components/tipping/feed-tip-tile/FeedTipTile.tsx +++ b/packages/web/src/components/tipping/feed-tip-tile/FeedTipTile.tsx @@ -1,13 +1,12 @@ import { useCallback, useEffect, useRef } from 'react' +import { Name, User } from '@audius/common/models' import { - Name, - User, accountSelectors, cacheUsersSelectors, tippingSelectors, tippingActions -} from '@audius/common' +} from '@audius/common/store' import { IconButton, PillButton } from '@audius/stems' import { ResizeObserver } from '@juggle/resize-observer' import { push as pushRoute } from 'connected-react-router' diff --git a/packages/web/src/components/tipping/support/SupportingList.tsx b/packages/web/src/components/tipping/support/SupportingList.tsx index 1b9af2eea8b..df02d4da8bb 100644 --- a/packages/web/src/components/tipping/support/SupportingList.tsx +++ b/packages/web/src/components/tipping/support/SupportingList.tsx @@ -1,12 +1,9 @@ import { useCallback } from 'react' -import { - profilePageSelectors, - MAX_PROFILE_SUPPORTING_TILES, - useRankedSupportingForUser, - User, - formatCount -} from '@audius/common' +import { useRankedSupportingForUser } from '@audius/common/hooks' +import { User } from '@audius/common/models' +import { profilePageSelectors } from '@audius/common/store' +import { formatCount, MAX_PROFILE_SUPPORTING_TILES } from '@audius/common/utils' import { IconArrow } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/tipping/support/SupportingTile.tsx b/packages/web/src/components/tipping/support/SupportingTile.tsx index 92ac5b2a4da..e0b38a8fc3a 100644 --- a/packages/web/src/components/tipping/support/SupportingTile.tsx +++ b/packages/web/src/components/tipping/support/SupportingTile.tsx @@ -1,15 +1,17 @@ import { useCallback } from 'react' +import { + imageProfilePicEmpty as profilePicEmpty, + imageCoverPhotoBlank +} from '@audius/common/assets' import { SquareSizes, WidthSizes, Supporting, - User, - Nullable, - cacheUsersSelectors, - imageCoverPhotoBlank, - imageProfilePicEmpty as profilePicEmpty -} from '@audius/common' + User +} from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { IconTrophy } from '@audius/stems' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' diff --git a/packages/web/src/components/tipping/support/TopSupporters.tsx b/packages/web/src/components/tipping/support/TopSupporters.tsx index bf109a29743..cff0713203e 100644 --- a/packages/web/src/components/tipping/support/TopSupporters.tsx +++ b/packages/web/src/components/tipping/support/TopSupporters.tsx @@ -1,13 +1,12 @@ import { useCallback } from 'react' +import { ID, User } from '@audius/common/models' import { - ID, - User, cacheUsersSelectors, profilePageSelectors, - tippingSelectors, - MAX_PROFILE_TOP_SUPPORTERS -} from '@audius/common' + tippingSelectors +} from '@audius/common/store' +import { MAX_PROFILE_TOP_SUPPORTERS } from '@audius/common/utils' import { IconTrophy } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/tipping/tip-audio/ConfirmSendTip.tsx b/packages/web/src/components/tipping/tip-audio/ConfirmSendTip.tsx index dac7463e94b..219ceb6a97b 100644 --- a/packages/web/src/components/tipping/tip-audio/ConfirmSendTip.tsx +++ b/packages/web/src/components/tipping/tip-audio/ConfirmSendTip.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { tippingSelectors, tippingActions } from '@audius/common' +import { tippingSelectors, tippingActions } from '@audius/common/store' import { Button, ButtonType, IconCheck } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/tipping/tip-audio/SendTip.tsx b/packages/web/src/components/tipping/tip-audio/SendTip.tsx index af1df5cba47..1d26243c75b 100644 --- a/packages/web/src/components/tipping/tip-audio/SendTip.tsx +++ b/packages/web/src/components/tipping/tip-audio/SendTip.tsx @@ -6,26 +6,24 @@ import { useState } from 'react' +import { useGetFirstOrTopSupporter } from '@audius/common/hooks' +import { BadgeTier, StringWei, StringAudio, BNWei } from '@audius/common/models' +import { StringKeys, FeatureFlags } from '@audius/common/services' import { - BadgeTier, - BNWei, - StringAudio, - StringWei, - formatWei, - stringWeiToBN, - weiToString, accountSelectors, tippingSelectors, tippingActions, walletSelectors, getTierAndNumberForBalance, - useGetFirstOrTopSupporter, - OnRampProvider, buyAudioActions, - FeatureFlags, - StringKeys, - isNullOrUndefined -} from '@audius/common' + OnRampProvider +} from '@audius/common/store' +import { + isNullOrUndefined, + stringWeiToBN, + weiToString, + formatWei +} from '@audius/common/utils' import { IconTrophy, TokenAmountInput, diff --git a/packages/web/src/components/tipping/tip-audio/TipAudioButton.tsx b/packages/web/src/components/tipping/tip-audio/TipAudioButton.tsx index 1d5ebfdd634..5f229e0415b 100644 --- a/packages/web/src/components/tipping/tip-audio/TipAudioButton.tsx +++ b/packages/web/src/components/tipping/tip-audio/TipAudioButton.tsx @@ -1,4 +1,4 @@ -import { profilePageSelectors, tippingActions } from '@audius/common' +import { profilePageSelectors, tippingActions } from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/tipping/tip-audio/TipAudioModal.tsx b/packages/web/src/components/tipping/tip-audio/TipAudioModal.tsx index 755fe2aeb2e..b82c8334ea3 100644 --- a/packages/web/src/components/tipping/tip-audio/TipAudioModal.tsx +++ b/packages/web/src/components/tipping/tip-audio/TipAudioModal.tsx @@ -1,14 +1,14 @@ import { useCallback, useEffect } from 'react' +import { StringKeys } from '@audius/common/services' import { - Nullable, + accountSelectors, tippingSelectors, tippingActions, - TippingSendStatus, walletActions, - StringKeys, - accountSelectors -} from '@audius/common' + TippingSendStatus +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Modal, ModalHeader, ModalTitle } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/tipping/tip-audio/TipSent.tsx b/packages/web/src/components/tipping/tip-audio/TipSent.tsx index b69ab965f72..14480352150 100644 --- a/packages/web/src/components/tipping/tip-audio/TipSent.tsx +++ b/packages/web/src/components/tipping/tip-audio/TipSent.tsx @@ -1,12 +1,9 @@ import { useCallback } from 'react' -import { - Name, - formatNumberCommas, - accountSelectors, - tippingSelectors, - deriveUserBankAddress -} from '@audius/common' +import { Name } from '@audius/common/models' +import { deriveUserBankAddress } from '@audius/common/services' +import { accountSelectors, tippingSelectors } from '@audius/common/store' +import { formatNumberCommas } from '@audius/common/utils' import { Button, ButtonType, IconTwitterBird, IconCheck } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/toast/Toast.tsx b/packages/web/src/components/toast/Toast.tsx index fb1461c3687..2d669e18d23 100644 --- a/packages/web/src/components/toast/Toast.tsx +++ b/packages/web/src/components/toast/Toast.tsx @@ -1,6 +1,6 @@ import { PureComponent } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import Tooltip from 'antd/lib/tooltip' import cn from 'classnames' import { connect } from 'react-redux' diff --git a/packages/web/src/components/toast/ToastContext.tsx b/packages/web/src/components/toast/ToastContext.tsx index f5ddc32e163..a27e9db6e3e 100644 --- a/packages/web/src/components/toast/ToastContext.tsx +++ b/packages/web/src/components/toast/ToastContext.tsx @@ -1,6 +1,6 @@ import { createContext, ReactNode, useCallback } from 'react' -import { CommonState, toastActions } from '@audius/common' +import { toastActions, CommonState } from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useTransition, animated } from 'react-spring' diff --git a/packages/web/src/components/tooltip/types.ts b/packages/web/src/components/tooltip/types.ts index 09ac2978f0a..4b736b4cec5 100644 --- a/packages/web/src/components/tooltip/types.ts +++ b/packages/web/src/components/tooltip/types.ts @@ -1,6 +1,6 @@ import React from 'react' -import { Maybe, Nullable } from '@audius/common' +import { Nullable, Maybe } from '@audius/common/utils' import { TooltipPlacement } from 'antd/lib/tooltip' import { ThemeColor } from 'utils/theme/theme' diff --git a/packages/web/src/components/track-overflow-modal/ConnectedMobileOverflowModal.tsx b/packages/web/src/components/track-overflow-modal/ConnectedMobileOverflowModal.tsx index 8bb07bb6b64..f04d2ff5119 100644 --- a/packages/web/src/components/track-overflow-modal/ConnectedMobileOverflowModal.tsx +++ b/packages/web/src/components/track-overflow-modal/ConnectedMobileOverflowModal.tsx @@ -1,28 +1,30 @@ import { + ShareSource, + RepostSource, FavoriteSource, FollowSource, - ID, - RepostSource, - ShareSource, + ID +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { cacheCollectionsActions, cacheCollectionsSelectors, cacheTracksSelectors, cacheUsersSelectors, - Notification, + queueSelectors, collectionsSocialActions, tracksSocialActions, usersSocialActions, addToCollectionUIActions, deletePlaylistConfirmationModalUIActions, - OverflowSource, mobileOverflowMenuUISelectors, - modalsActions, - modalsSelectors, - queueSelectors, shareModalUIActions, + OverflowSource, + modalsSelectors, + modalsActions, useEditPlaylistModal, - FeatureFlags -} from '@audius/common' + Notification +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track-overflow-modal/components/MobileOverflowModal.tsx b/packages/web/src/components/track-overflow-modal/components/MobileOverflowModal.tsx index 78bcc217cf4..9a8b44c204c 100644 --- a/packages/web/src/components/track-overflow-modal/components/MobileOverflowModal.tsx +++ b/packages/web/src/components/track-overflow-modal/components/MobileOverflowModal.tsx @@ -1,4 +1,4 @@ -import { OverflowAction, OverflowActionCallbacks } from '@audius/common' +import { OverflowAction, OverflowActionCallbacks } from '@audius/common/store' import ActionSheetModal from 'components/action-drawer/ActionDrawer' diff --git a/packages/web/src/components/track/AiTrackSection.tsx b/packages/web/src/components/track/AiTrackSection.tsx index d3f9b163bea..3e1eebed897 100644 --- a/packages/web/src/components/track/AiTrackSection.tsx +++ b/packages/web/src/components/track/AiTrackSection.tsx @@ -1,11 +1,7 @@ import { useCallback, useEffect } from 'react' -import { - ID, - User, - cacheUsersSelectors, - cacheUsersActions -} from '@audius/common' +import { ID, User } from '@audius/common/models' +import { cacheUsersActions, cacheUsersSelectors } from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' diff --git a/packages/web/src/components/track/Artwork.tsx b/packages/web/src/components/track/Artwork.tsx index 25c72e9707d..d698dbfbf31 100644 --- a/packages/web/src/components/track/Artwork.tsx +++ b/packages/web/src/components/track/Artwork.tsx @@ -1,11 +1,7 @@ import { memo } from 'react' -import { - ID, - SquareSizes, - CoverArtSizes, - useLoadImageWithTimeout -} from '@audius/common' +import { useLoadImageWithTimeout } from '@audius/common/hooks' +import { SquareSizes, ID, CoverArtSizes } from '@audius/common/models' import { PbIconPlay as IconPlay, PbIconPause as IconPause, diff --git a/packages/web/src/components/track/CardTitle.tsx b/packages/web/src/components/track/CardTitle.tsx index b55c37e1026..dde54163c49 100644 --- a/packages/web/src/components/track/CardTitle.tsx +++ b/packages/web/src/components/track/CardTitle.tsx @@ -1,10 +1,10 @@ import { - FeatureFlags, - Nullable, - AccessConditions, isContentCollectibleGated, - isContentUSDCPurchaseGated -} from '@audius/common' + isContentUSDCPurchaseGated, + AccessConditions +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { Nullable } from '@audius/common/utils' import { IconCart, IconCollectible, IconSpecialAccess } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/track/DownloadRow.tsx b/packages/web/src/components/track/DownloadRow.tsx index 7efba88ae07..ef4d00433ff 100644 --- a/packages/web/src/components/track/DownloadRow.tsx +++ b/packages/web/src/components/track/DownloadRow.tsx @@ -1,9 +1,6 @@ -import { - CommonState, - ID, - cacheTracksSelectors, - useDownloadableContentAccess -} from '@audius/common' +import { useDownloadableContentAccess } from '@audius/common/hooks' +import { ID } from '@audius/common/models' +import { cacheTracksSelectors, CommonState } from '@audius/common/store' import { Flex, IconReceive, PlainButton, Text } from '@audius/harmony' import { shallowEqual, useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/DownloadSection.tsx b/packages/web/src/components/track/DownloadSection.tsx index 834221bc9dc..fda4b7cce65 100644 --- a/packages/web/src/components/track/DownloadSection.tsx +++ b/packages/web/src/components/track/DownloadSection.tsx @@ -2,18 +2,17 @@ import { useCallback, useState } from 'react' import { useCurrentStems, - ID, - CommonState, + useDownloadableContentAccess +} from '@audius/common/hooks' +import { Name, ModalSource, DownloadQuality, ID } from '@audius/common/models' +import { cacheTracksSelectors, - DownloadQuality, - useDownloadableContentAccess, usePremiumContentPurchaseModal, + CommonState, useWaitForDownloadModal, - ModalSource, tracksSocialActions as socialTracksActions, - toastActions, - Name -} from '@audius/common' + toastActions +} from '@audius/common/store' import { USDC } from '@audius/fixed-decimal' import { Flex, diff --git a/packages/web/src/components/track/DynamicTrackArtwork.tsx b/packages/web/src/components/track/DynamicTrackArtwork.tsx index acb240ced40..38b80cb8770 100644 --- a/packages/web/src/components/track/DynamicTrackArtwork.tsx +++ b/packages/web/src/components/track/DynamicTrackArtwork.tsx @@ -1,9 +1,5 @@ -import { - useGetTrackById, - SquareSizes, - statusIsNotFinalized, - ID -} from '@audius/common' +import { useGetTrackById } from '@audius/common/api' +import { SquareSizes, statusIsNotFinalized, ID } from '@audius/common/models' import cn from 'classnames' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/components/track/EditTrackModal.jsx b/packages/web/src/components/track/EditTrackModal.jsx index aa2efe50930..65aa97c756d 100644 --- a/packages/web/src/components/track/EditTrackModal.jsx +++ b/packages/web/src/components/track/EditTrackModal.jsx @@ -1,6 +1,7 @@ import { useState, useEffect, useCallback } from 'react' -import { SquareSizes, newTrackMetadata } from '@audius/common' +import { SquareSizes } from '@audius/common/models' +import { newTrackMetadata } from '@audius/common/schemas' import { Modal, Button, ButtonSize, ButtonType } from '@audius/stems' import { mapValues } from 'lodash' import PropTypes from 'prop-types' diff --git a/packages/web/src/components/track/GatedConditionsPill.tsx b/packages/web/src/components/track/GatedConditionsPill.tsx index a76fce01d8e..3313421b493 100644 --- a/packages/web/src/components/track/GatedConditionsPill.tsx +++ b/packages/web/src/components/track/GatedConditionsPill.tsx @@ -1,10 +1,10 @@ import type { MouseEvent } from 'react' import { - formatPrice, isContentUSDCPurchaseGated, AccessConditions -} from '@audius/common' +} from '@audius/common/models' +import { formatPrice } from '@audius/common/utils' import { Button, ButtonSize, IconLock } from '@audius/harmony' import cn from 'classnames' diff --git a/packages/web/src/components/track/GatedContentLabel.tsx b/packages/web/src/components/track/GatedContentLabel.tsx index cebffe51ac1..87b4ce56008 100644 --- a/packages/web/src/components/track/GatedContentLabel.tsx +++ b/packages/web/src/components/track/GatedContentLabel.tsx @@ -1,9 +1,9 @@ import { - AccessConditions, - Nullable, isContentCollectibleGated, - isContentUSDCPurchaseGated -} from '@audius/common' + isContentUSDCPurchaseGated, + AccessConditions +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { IconCart, IconCollectible, IconSpecialAccess } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/track/GatedTrackSection.tsx b/packages/web/src/components/track/GatedTrackSection.tsx index 44270975703..bc62fbe6d13 100644 --- a/packages/web/src/components/track/GatedTrackSection.tsx +++ b/packages/web/src/components/track/GatedTrackSection.tsx @@ -1,25 +1,25 @@ import { useCallback } from 'react' import { - cacheUsersSelectors, - Chain, FollowSource, - formatPrice, - ID, + ModalSource, + Chain, isContentCollectibleGated, isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated, - Nullable, + ID, AccessConditions, - gatedContentSelectors, - removeNullable, - tippingActions, - User, + User +} from '@audius/common/models' +import { + cacheUsersSelectors, usersSocialActions as socialActions, + tippingActions, usePremiumContentPurchaseModal, - ModalSource -} from '@audius/common' + gatedContentSelectors +} from '@audius/common/store' +import { formatPrice, removeNullable, Nullable } from '@audius/common/utils' import { Button, ButtonType, diff --git a/packages/web/src/components/track/GiantArtwork.tsx b/packages/web/src/components/track/GiantArtwork.tsx index 9f3d04640bb..010962d50b8 100644 --- a/packages/web/src/components/track/GiantArtwork.tsx +++ b/packages/web/src/components/track/GiantArtwork.tsx @@ -1,6 +1,7 @@ import { memo, useEffect } from 'react' -import { CoverArtSizes, SquareSizes, Remix, Nullable } from '@audius/common' +import { SquareSizes, CoverArtSizes, Remix } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import CoSign from 'components/co-sign/CoSign' import { Size } from 'components/co-sign/types' diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index 78b98f4a7e1..07364b977ab 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -1,23 +1,27 @@ import { Suspense, lazy, useCallback, useState } from 'react' import { - getCanonicalName, - formatDate, - formatSeconds, - Genre, - FeatureFlags, - Nullable, - Remix, - CoverArtSizes, + isContentUSDCPurchaseGated, ID, - AccessConditions, + CoverArtSizes, FieldVisibility, - getDogEarType, - isContentUSDCPurchaseGated, + Remix, + AccessConditions +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { + cacheTracksSelectors, publishTrackConfirmationModalUIActions, - CommonState, - cacheTracksSelectors -} from '@audius/common' + CommonState +} from '@audius/common/store' +import { + Genre, + getCanonicalName, + formatSeconds, + formatDate, + getDogEarType, + Nullable +} from '@audius/common/utils' import { Box, Flex } from '@audius/harmony' import { Mood } from '@audius/sdk' import { diff --git a/packages/web/src/components/track/GiantTrackTileProgressInfo.tsx b/packages/web/src/components/track/GiantTrackTileProgressInfo.tsx index 118c24138a8..b891f20e177 100644 --- a/packages/web/src/components/track/GiantTrackTileProgressInfo.tsx +++ b/packages/web/src/components/track/GiantTrackTileProgressInfo.tsx @@ -1,10 +1,10 @@ +import { ID } from '@audius/common/models' import { - CommonState, - formatLineupTileDuration, - ID, accountSelectors, - playbackPositionSelectors -} from '@audius/common' + playbackPositionSelectors, + CommonState +} from '@audius/common/store' +import { formatLineupTileDuration } from '@audius/common/utils' import { IconCheck, ProgressBar } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/LockedTrackDetailsTile.tsx b/packages/web/src/components/track/LockedTrackDetailsTile.tsx index 742305a7a6b..8e229b380ae 100644 --- a/packages/web/src/components/track/LockedTrackDetailsTile.tsx +++ b/packages/web/src/components/track/LockedTrackDetailsTile.tsx @@ -1,12 +1,12 @@ import { - getDogEarType, - ID, + SquareSizes, isContentCollectibleGated, isContentUSDCPurchaseGated, - SquareSizes, + ID, Track, UserMetadata -} from '@audius/common' +} from '@audius/common/models' +import { getDogEarType } from '@audius/common/utils' import { IconCart, IconCollectible, IconSpecialAccess } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/track/PlayPauseButton.tsx b/packages/web/src/components/track/PlayPauseButton.tsx index 7ca16955714..f2bbf91782a 100644 --- a/packages/web/src/components/track/PlayPauseButton.tsx +++ b/packages/web/src/components/track/PlayPauseButton.tsx @@ -1,11 +1,11 @@ +import { ID } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - FeatureFlags, - ID, accountSelectors, playerSelectors, playbackPositionSelectors, CommonState -} from '@audius/common' +} from '@audius/common/store' import { Button } from '@audius/harmony' import { IconPause, IconPlay } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/desktop/BottomRow.tsx b/packages/web/src/components/track/desktop/BottomRow.tsx index 969aedc3ca6..0348d8d1428 100644 --- a/packages/web/src/components/track/desktop/BottomRow.tsx +++ b/packages/web/src/components/track/desktop/BottomRow.tsx @@ -1,12 +1,8 @@ import { MouseEvent, ReactNode, useCallback } from 'react' -import { - FieldVisibility, - gatedContentSelectors, - ID, - AccessConditions, - Nullable -} from '@audius/common' +import { ID, FieldVisibility, AccessConditions } from '@audius/common/models' +import { gatedContentSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/desktop/ConnectedPlaylistTile.tsx b/packages/web/src/components/track/desktop/ConnectedPlaylistTile.tsx index fec00e6c788..61b35b2d287 100644 --- a/packages/web/src/components/track/desktop/ConnectedPlaylistTile.tsx +++ b/packages/web/src/components/track/desktop/ConnectedPlaylistTile.tsx @@ -10,21 +10,23 @@ import { } from 'react' import { - UID, - ID, + Name, ShareSource, RepostSource, FavoriteSource, PlaybackSource, - Name, - Track, + ID, + UID, + Track +} from '@audius/common/models' +import { accountSelectors, cacheCollectionsSelectors, cacheUsersSelectors, collectionsSocialActions, shareModalUIActions, playerSelectors -} from '@audius/common' +} from '@audius/common/store' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' import { range } from 'lodash' diff --git a/packages/web/src/components/track/desktop/ConnectedTrackTile.tsx b/packages/web/src/components/track/desktop/ConnectedTrackTile.tsx index 3ddb00a02ac..4e34403fd58 100644 --- a/packages/web/src/components/track/desktop/ConnectedTrackTile.tsx +++ b/packages/web/src/components/track/desktop/ConnectedTrackTile.tsx @@ -7,22 +7,24 @@ import { useRef } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - UID, - ID, ShareSource, RepostSource, FavoriteSource, + ID, + UID +} from '@audius/common/models' +import { accountSelectors, cacheTracksSelectors, cacheUsersSelectors, tracksSocialActions, shareModalUIActions, playerSelectors, - useGatedContentAccess, - gatedContentActions, - Genre -} from '@audius/common' + gatedContentActions +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import cn from 'classnames' import { connect, useDispatch } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track/desktop/TrackListItem.tsx b/packages/web/src/components/track/desktop/TrackListItem.tsx index c97904f100d..b9b81752be1 100644 --- a/packages/web/src/components/track/desktop/TrackListItem.tsx +++ b/packages/web/src/components/track/desktop/TrackListItem.tsx @@ -1,12 +1,8 @@ import { memo, MouseEvent, useRef } from 'react' -import { - UID, - ID, - formatSeconds, - EnhancedCollectionTrack, - Genre -} from '@audius/common' +import { ID, UID } from '@audius/common/models' +import { EnhancedCollectionTrack } from '@audius/common/store' +import { Genre, formatSeconds } from '@audius/common/utils' import cn from 'classnames' import IconKebabHorizontal from 'assets/img/iconKebabHorizontal.svg' diff --git a/packages/web/src/components/track/desktop/TrackTile.tsx b/packages/web/src/components/track/desktop/TrackTile.tsx index ce27e8515fa..0cc3c24b187 100644 --- a/packages/web/src/components/track/desktop/TrackTile.tsx +++ b/packages/web/src/components/track/desktop/TrackTile.tsx @@ -1,18 +1,19 @@ import { memo } from 'react' +import { ModalSource, isContentUSDCPurchaseGated } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - formatCount, accountSelectors, + usePremiumContentPurchaseModal, playbackPositionSelectors, - FeatureFlags, - formatLineupTileDuration, + CommonState +} from '@audius/common/store' +import { + formatCount, Genre, - CommonState, - getDogEarType, - isContentUSDCPurchaseGated, - usePremiumContentPurchaseModal, - ModalSource -} from '@audius/common' + formatLineupTileDuration, + getDogEarType +} from '@audius/common/utils' import { IconCheck, IconCrown, IconHidden, ProgressBar } from '@audius/stems' import cn from 'classnames' import moment from 'moment' diff --git a/packages/web/src/components/track/desktop/stats/ProfileImage.tsx b/packages/web/src/components/track/desktop/stats/ProfileImage.tsx index 2ed5bf5b93c..65e4b8ff66d 100644 --- a/packages/web/src/components/track/desktop/stats/ProfileImage.tsx +++ b/packages/web/src/components/track/desktop/stats/ProfileImage.tsx @@ -1,6 +1,7 @@ import { memo } from 'react' -import { ID, SquareSizes, cacheUsersSelectors } from '@audius/common' +import { SquareSizes, ID } from '@audius/common/models' +import { cacheUsersSelectors } from '@audius/common/store' import cn from 'classnames' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track/desktop/stats/Stats.tsx b/packages/web/src/components/track/desktop/stats/Stats.tsx index c7ffa3bc0d4..573044e2ed1 100644 --- a/packages/web/src/components/track/desktop/stats/Stats.tsx +++ b/packages/web/src/components/track/desktop/stats/Stats.tsx @@ -1,13 +1,8 @@ import { memo, useMemo, MouseEvent, useCallback } from 'react' -import { - ID, - Favorite, - Repost, - createShallowSelector, - cacheUsersSelectors, - CommonState -} from '@audius/common' +import { Favorite, ID, Repost } from '@audius/common/models' +import { cacheUsersSelectors, CommonState } from '@audius/common/store' +import { createShallowSelector } from '@audius/common/utils' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/desktop/stats/StatsText.tsx b/packages/web/src/components/track/desktop/stats/StatsText.tsx index bbf31e8c4ef..852da859f44 100644 --- a/packages/web/src/components/track/desktop/stats/StatsText.tsx +++ b/packages/web/src/components/track/desktop/stats/StatsText.tsx @@ -1,4 +1,5 @@ -import { User, formatCount, pluralize } from '@audius/common' +import { User } from '@audius/common/models' +import { formatCount, pluralize } from '@audius/common/utils' import styles from './StatsText.module.css' diff --git a/packages/web/src/components/track/helpers.ts b/packages/web/src/components/track/helpers.ts index b8583b1dfed..d35c8642c92 100644 --- a/packages/web/src/components/track/helpers.ts +++ b/packages/web/src/components/track/helpers.ts @@ -1,4 +1,5 @@ -import { Collection, FieldVisibility, Genre, Track, User } from '@audius/common' +import { Collection, FieldVisibility, Track, User } from '@audius/common/models' +import { Genre } from '@audius/common/utils' const defaultFieldVisibility: FieldVisibility = { genre: true, diff --git a/packages/web/src/components/track/mobile/BottomButtons.tsx b/packages/web/src/components/track/mobile/BottomButtons.tsx index 5ae7fb91fc0..6d0f2ed0a76 100644 --- a/packages/web/src/components/track/mobile/BottomButtons.tsx +++ b/packages/web/src/components/track/mobile/BottomButtons.tsx @@ -1,11 +1,11 @@ import { MouseEvent, memo } from 'react' import { - Nullable, + isContentUSDCPurchaseGated, AccessConditions, - GatedTrackStatus, - isContentUSDCPurchaseGated -} from '@audius/common' + GatedTrackStatus +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import FavoriteButton from 'components/alt-button/FavoriteButton' diff --git a/packages/web/src/components/track/mobile/ConnectedPlaylistTile.tsx b/packages/web/src/components/track/mobile/ConnectedPlaylistTile.tsx index 870342d295d..f625d3666ee 100644 --- a/packages/web/src/components/track/mobile/ConnectedPlaylistTile.tsx +++ b/packages/web/src/components/track/mobile/ConnectedPlaylistTile.tsx @@ -1,29 +1,31 @@ import { memo, useCallback, useMemo, MouseEvent } from 'react' import { - ID, - FavoriteSource, - RepostSource, Name, - PlaybackSource, ShareSource, + RepostSource, + FavoriteSource, + PlaybackSource, FavoriteType, - Track, + ID, + Track +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, cacheCollectionsSelectors, cacheUsersSelectors, collectionsSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, themeSelectors, - RepostType, - favoritesUserListActions, + OverflowAction, + OverflowSource, repostsUserListActions, - playerSelectors, - FeatureFlags -} from '@audius/common' + favoritesUserListActions, + RepostType, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track/mobile/ConnectedTrackListItem.tsx b/packages/web/src/components/track/mobile/ConnectedTrackListItem.tsx index 888f02714f6..d8ac1aa75ba 100644 --- a/packages/web/src/components/track/mobile/ConnectedTrackListItem.tsx +++ b/packages/web/src/components/track/mobile/ConnectedTrackListItem.tsx @@ -1,17 +1,15 @@ import { memo } from 'react' +import { RepostSource, FavoriteSource, ID } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - ID, - FavoriteSource, - RepostSource, accountSelectors, cacheUsersSelectors, tracksSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, - FeatureFlags -} from '@audius/common' + OverflowAction, + OverflowSource +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track/mobile/ConnectedTrackTile.tsx b/packages/web/src/components/track/mobile/ConnectedTrackTile.tsx index 2c048465598..d8332caa9c4 100644 --- a/packages/web/src/components/track/mobile/ConnectedTrackTile.tsx +++ b/packages/web/src/components/track/mobile/ConnectedTrackTile.tsx @@ -1,28 +1,30 @@ import { memo, MouseEvent } from 'react' +import { useGatedContentAccess } from '@audius/common/hooks' import { - ID, - FavoriteSource, - RepostSource, ShareSource, + RepostSource, + FavoriteSource, FavoriteType, + ID +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors, cacheTracksSelectors, cacheUsersSelectors, tracksSocialActions, - OverflowAction, - OverflowSource, mobileOverflowMenuUIActions, shareModalUIActions, themeSelectors, - RepostType, + OverflowAction, + OverflowSource, repostsUserListActions, favoritesUserListActions, - playerSelectors, - useGatedContentAccess, - FeatureFlags, - Genre -} from '@audius/common' + RepostType, + playerSelectors +} from '@audius/common/store' +import { Genre } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/track/mobile/PlaylistTile.tsx b/packages/web/src/components/track/mobile/PlaylistTile.tsx index c4b437ce518..56a889fa776 100644 --- a/packages/web/src/components/track/mobile/PlaylistTile.tsx +++ b/packages/web/src/components/track/mobile/PlaylistTile.tsx @@ -1,12 +1,7 @@ import { useState, useEffect, MouseEvent } from 'react' -import { - UID, - ID, - LineupTrack, - formatCount, - formatLineupTileDuration -} from '@audius/common' +import { ID, UID, LineupTrack } from '@audius/common/models' +import { formatCount, formatLineupTileDuration } from '@audius/common/utils' import cn from 'classnames' import { range } from 'lodash' diff --git a/packages/web/src/components/track/mobile/TrackList.tsx b/packages/web/src/components/track/mobile/TrackList.tsx index 8832d555c3d..edeaedc559e 100644 --- a/packages/web/src/components/track/mobile/TrackList.tsx +++ b/packages/web/src/components/track/mobile/TrackList.tsx @@ -1,6 +1,6 @@ import { memo, useCallback } from 'react' -import { ID, CoverArtSizes } from '@audius/common' +import { ID, CoverArtSizes } from '@audius/common/models' import cn from 'classnames' import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd' diff --git a/packages/web/src/components/track/mobile/TrackListItem.tsx b/packages/web/src/components/track/mobile/TrackListItem.tsx index 594dd932eca..8c089993588 100644 --- a/packages/web/src/components/track/mobile/TrackListItem.tsx +++ b/packages/web/src/components/track/mobile/TrackListItem.tsx @@ -1,6 +1,6 @@ import { memo, MouseEvent } from 'react' -import { ID, CoverArtSizes, SquareSizes } from '@audius/common' +import { SquareSizes, ID, CoverArtSizes } from '@audius/common/models' import { IconKebabHorizontal, IconButton, IconLock } from '@audius/stems' import cn from 'classnames' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/track/mobile/TrackTile.tsx b/packages/web/src/components/track/mobile/TrackTile.tsx index 386166ae787..5b8c0a0ee3d 100644 --- a/packages/web/src/components/track/mobile/TrackTile.tsx +++ b/packages/web/src/components/track/mobile/TrackTile.tsx @@ -1,19 +1,23 @@ import { useCallback, useState, useEffect, MouseEvent } from 'react' import { + ModalSource, + isContentUSDCPurchaseGated, ID, - formatCount, - AccessConditions, - Nullable, - gatedContentSelectors, + AccessConditions +} from '@audius/common/models' +import { + usePremiumContentPurchaseModal, gatedContentActions, - formatLineupTileDuration, + gatedContentSelectors +} from '@audius/common/store' +import { + formatCount, Genre, + formatLineupTileDuration, getDogEarType, - isContentUSDCPurchaseGated, - usePremiumContentPurchaseModal, - ModalSource -} from '@audius/common' + Nullable +} from '@audius/common/utils' import { IconCrown, IconHidden, IconTrending } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/track/mobile/TrackTileArt.tsx b/packages/web/src/components/track/mobile/TrackTileArt.tsx index c91f78946af..369e45e8c54 100644 --- a/packages/web/src/components/track/mobile/TrackTileArt.tsx +++ b/packages/web/src/components/track/mobile/TrackTileArt.tsx @@ -1,12 +1,7 @@ import { memo } from 'react' -import { - ID, - CoverArtSizes, - SquareSizes, - Remix, - useLoadImageWithTimeout -} from '@audius/common' +import { useLoadImageWithTimeout } from '@audius/common/hooks' +import { SquareSizes, ID, CoverArtSizes, Remix } from '@audius/common/models' import cn from 'classnames' import CoSign from 'components/co-sign/CoSign' diff --git a/packages/web/src/components/track/trackTileMessages.ts b/packages/web/src/components/track/trackTileMessages.ts index 8720a112245..88a20d49049 100644 --- a/packages/web/src/components/track/trackTileMessages.ts +++ b/packages/web/src/components/track/trackTileMessages.ts @@ -1,4 +1,4 @@ -import { pluralize } from '@audius/common' +import { pluralize } from '@audius/common/utils' export const messages = { artistPick: 'Artist Pick', diff --git a/packages/web/src/components/track/types.ts b/packages/web/src/components/track/types.ts index 58cc75ffec5..6361f83e5e7 100644 --- a/packages/web/src/components/track/types.ts +++ b/packages/web/src/components/track/types.ts @@ -1,20 +1,19 @@ import { MouseEvent, ReactNode } from 'react' import { - ID, - UID, PlaybackSource, + Collection, Favorite, + ID, + UID, CoverArtSizes, Repost, FieldVisibility, - LineupTrack, Remix, AccessConditions, - Nullable, - Genre, - Collection -} from '@audius/common' + LineupTrack +} from '@audius/common/models' +import { Genre, Nullable } from '@audius/common/utils' export enum TrackTileSize { LARGE = 'LARGE', diff --git a/packages/web/src/components/tracks-table/TracksTable.tsx b/packages/web/src/components/tracks-table/TracksTable.tsx index fd20a646f20..a4656fb8e55 100644 --- a/packages/web/src/components/tracks-table/TracksTable.tsx +++ b/packages/web/src/components/tracks-table/TracksTable.tsx @@ -1,12 +1,8 @@ import { MouseEvent, useCallback, useMemo, useRef } from 'react' -import { - formatCount, - formatSeconds, - UID, - useGatedContentAccessMap, - UserTrack -} from '@audius/common' +import { useGatedContentAccessMap } from '@audius/common/hooks' +import { UID, UserTrack } from '@audius/common/models' +import { formatCount, formatSeconds } from '@audius/common/utils' import { IconHidden, IconLock } from '@audius/stems' import cn from 'classnames' import moment from 'moment' diff --git a/packages/web/src/components/transaction-details-modal/TransactionDetailsModal.tsx b/packages/web/src/components/transaction-details-modal/TransactionDetailsModal.tsx index bcf286b0475..18f31e90cdf 100644 --- a/packages/web/src/components/transaction-details-modal/TransactionDetailsModal.tsx +++ b/packages/web/src/components/transaction-details-modal/TransactionDetailsModal.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { Status } from '@audius/common/models' import { - Status, transactionDetailsActions, transactionDetailsSelectors -} from '@audius/common' +} from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/components/transaction-details-modal/components/TransactionDetailsContent.tsx b/packages/web/src/components/transaction-details-modal/components/TransactionDetailsContent.tsx index 22c67c2fb66..5dd6f133ed8 100644 --- a/packages/web/src/components/transaction-details-modal/components/TransactionDetailsContent.tsx +++ b/packages/web/src/components/transaction-details-modal/components/TransactionDetailsContent.tsx @@ -1,15 +1,16 @@ +import { ChallengeRewardID, User } from '@audius/common/models' import { - User, cacheUsersSelectors, - TransactionDetails, + TransactionType, TransactionMethod, + TransactionDetails +} from '@audius/common/store' +import { formatAudio, - TransactionType, formatCapitalizeString, - ChallengeRewardID, - makeSolanaTransactionLink, - isNullOrUndefined -} from '@audius/common' + isNullOrUndefined, + makeSolanaTransactionLink +} from '@audius/common/utils' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' import { useSelector, useDispatch } from 'react-redux' diff --git a/packages/web/src/components/transaction-details-modal/components/TransactionPurchaseMetadata.tsx b/packages/web/src/components/transaction-details-modal/components/TransactionPurchaseMetadata.tsx index c6eecb79bcb..494c9135510 100644 --- a/packages/web/src/components/transaction-details-modal/components/TransactionPurchaseMetadata.tsx +++ b/packages/web/src/components/transaction-details-modal/components/TransactionPurchaseMetadata.tsx @@ -1,9 +1,9 @@ +import { InAppAudioPurchaseMetadata } from '@audius/common/store' import { - InAppAudioPurchaseMetadata, formatNumberString, - Nullable, - makeSolanaTransactionLink -} from '@audius/common' + makeSolanaTransactionLink, + Nullable +} from '@audius/common/utils' import IconExternalLink from 'assets/img/iconExternalLink.svg' import { diff --git a/packages/web/src/components/trending-genre-selection/TrendingGenreSelectionPage.tsx b/packages/web/src/components/trending-genre-selection/TrendingGenreSelectionPage.tsx index 5a6bfb9cf05..6aa821c1473 100644 --- a/packages/web/src/components/trending-genre-selection/TrendingGenreSelectionPage.tsx +++ b/packages/web/src/components/trending-genre-selection/TrendingGenreSelectionPage.tsx @@ -1,12 +1,10 @@ +import { TimeRange } from '@audius/common/models' import { - TimeRange, - TRENDING_GENRES, - ELECTRONIC_PREFIX, - Genre, trendingPageLineupActions, trendingPageActions, trendingPageSelectors -} from '@audius/common' +} from '@audius/common/store' +import { Genre, ELECTRONIC_PREFIX, TRENDING_GENRES } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/twitter-auth/TwitterAuth.tsx b/packages/web/src/components/twitter-auth/TwitterAuth.tsx index c447f9e570c..77062493e5b 100644 --- a/packages/web/src/components/twitter-auth/TwitterAuth.tsx +++ b/packages/web/src/components/twitter-auth/TwitterAuth.tsx @@ -1,8 +1,9 @@ import { CSSProperties, MouseEventHandler, ReactNode } from 'react' + import 'whatwg-fetch' import 'url-search-params-polyfill' -import { TwitterProfile } from '@audius/common' +import { TwitterProfile } from '@audius/common/store' import { captureException } from '@sentry/browser' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' diff --git a/packages/web/src/components/twitter-share-button/TwitterShareButton.tsx b/packages/web/src/components/twitter-share-button/TwitterShareButton.tsx index 40ed9dd100f..8df82af5e01 100644 --- a/packages/web/src/components/twitter-share-button/TwitterShareButton.tsx +++ b/packages/web/src/components/twitter-share-button/TwitterShareButton.tsx @@ -1,12 +1,12 @@ import { MouseEventHandler, useCallback } from 'react' +import { useTwitterButtonStatus } from '@audius/common/hooks' import { - Nullable, - useTwitterButtonStatus, - CommonState, cacheUsersActions, - cacheUsersSelectors -} from '@audius/common' + cacheUsersSelectors, + CommonState +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Button, ButtonProps } from '@audius/harmony' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/components/unfollow-confirmation-modal/UnfollowConfirmationModal.tsx b/packages/web/src/components/unfollow-confirmation-modal/UnfollowConfirmationModal.tsx index 4e741e7799d..624805b18b7 100644 --- a/packages/web/src/components/unfollow-confirmation-modal/UnfollowConfirmationModal.tsx +++ b/packages/web/src/components/unfollow-confirmation-modal/UnfollowConfirmationModal.tsx @@ -1,9 +1,8 @@ +import { FollowSource, ID } from '@audius/common/models' import { - ID, - FollowSource, profilePageActions, usersSocialActions as socialActions -} from '@audius/common' +} from '@audius/common/store' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/unfollow-confirmation-modal/components/UnfollowConfirmationModal.tsx b/packages/web/src/components/unfollow-confirmation-modal/components/UnfollowConfirmationModal.tsx index 7b014320c07..4684874e94d 100644 --- a/packages/web/src/components/unfollow-confirmation-modal/components/UnfollowConfirmationModal.tsx +++ b/packages/web/src/components/unfollow-confirmation-modal/components/UnfollowConfirmationModal.tsx @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import ActionSheetModal from 'components/action-drawer/ActionDrawer' diff --git a/packages/web/src/components/unfollow-confirmation-modal/store/actions.ts b/packages/web/src/components/unfollow-confirmation-modal/store/actions.ts index 9c1836ae75c..b3b76c0cf49 100644 --- a/packages/web/src/components/unfollow-confirmation-modal/store/actions.ts +++ b/packages/web/src/components/unfollow-confirmation-modal/store/actions.ts @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import { createCustomAction } from 'typesafe-actions' export const SET_OPEN = 'UNFOLLOW_CONFIRMATION/SET_OPEN' diff --git a/packages/web/src/components/unfollow-confirmation-modal/store/types.ts b/packages/web/src/components/unfollow-confirmation-modal/store/types.ts index 8ed33dd67d2..62ae4422dc6 100644 --- a/packages/web/src/components/unfollow-confirmation-modal/store/types.ts +++ b/packages/web/src/components/unfollow-confirmation-modal/store/types.ts @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' export type UnfollowConfirmationModalState = { isOpen: boolean diff --git a/packages/web/src/components/unload-dialog/UnloadDialog.jsx b/packages/web/src/components/unload-dialog/UnloadDialog.jsx index 085dcdd403a..56c6590f023 100644 --- a/packages/web/src/components/unload-dialog/UnloadDialog.jsx +++ b/packages/web/src/components/unload-dialog/UnloadDialog.jsx @@ -1,6 +1,6 @@ import { useState, useEffect, useRef } from 'react' -import { confirmerSelectors } from '@audius/common' +import { confirmerSelectors } from '@audius/common/store' import { Modal } from '@audius/stems' import { connect } from 'react-redux' diff --git a/packages/web/src/components/upload-confirmation-modal/UploadConfirmationModal.tsx b/packages/web/src/components/upload-confirmation-modal/UploadConfirmationModal.tsx index 13cf393b79c..75c0bcc63e7 100644 --- a/packages/web/src/components/upload-confirmation-modal/UploadConfirmationModal.tsx +++ b/packages/web/src/components/upload-confirmation-modal/UploadConfirmationModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { uploadConfirmationModalUISelectors } from '@audius/common' +import { uploadConfirmationModalUISelectors } from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/components/upload/TrackPreviewNew.tsx b/packages/web/src/components/upload/TrackPreviewNew.tsx index 8bb7264f935..9a900b24b87 100644 --- a/packages/web/src/components/upload/TrackPreviewNew.tsx +++ b/packages/web/src/components/upload/TrackPreviewNew.tsx @@ -1,10 +1,7 @@ import { useState } from 'react' -import { - FeatureFlags, - StemCategory, - stemCategoryFriendlyNames -} from '@audius/common' +import { StemCategory, stemCategoryFriendlyNames } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { Box, FilterButton, Flex, IconCompose } from '@audius/harmony' import { HarmonyPlainButton, IconTrash } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/upload/UploadArtwork.jsx b/packages/web/src/components/upload/UploadArtwork.jsx index 99dddec5fa6..8446913ef84 100644 --- a/packages/web/src/components/upload/UploadArtwork.jsx +++ b/packages/web/src/components/upload/UploadArtwork.jsx @@ -1,6 +1,6 @@ import { useState, useEffect, useRef } from 'react' -import { imageBlank, imageBlank as placeholderArt } from '@audius/common' +import { imageBlank, imageBlank as placeholderArt } from '@audius/common/assets' import cn from 'classnames' import ImageSelectionButton from 'components/image-selection/ImageSelectionButton' diff --git a/packages/web/src/components/upload/UploadChip.tsx b/packages/web/src/components/upload/UploadChip.tsx index 78763b55120..5e9017f557a 100644 --- a/packages/web/src/components/upload/UploadChip.tsx +++ b/packages/web/src/components/upload/UploadChip.tsx @@ -1,11 +1,8 @@ import { Ref, useCallback, useMemo } from 'react' -import { - CreatePlaylistSource, - FeatureFlags, - Name, - cacheCollectionsActions -} from '@audius/common' +import { Name, CreatePlaylistSource } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { cacheCollectionsActions } from '@audius/common/store' import { Box, HTMLButtonProps, diff --git a/packages/web/src/components/usdc-balance-fetcher/USDCBalanceFetcher.tsx b/packages/web/src/components/usdc-balance-fetcher/USDCBalanceFetcher.tsx index 1fc033196be..f9f67d6b8e3 100644 --- a/packages/web/src/components/usdc-balance-fetcher/USDCBalanceFetcher.tsx +++ b/packages/web/src/components/usdc-balance-fetcher/USDCBalanceFetcher.tsx @@ -1,4 +1,4 @@ -import { useUSDCBalance } from '@audius/common' +import { useUSDCBalance } from '@audius/common/hooks' export const USDCBalanceFetcher = () => { useUSDCBalance() diff --git a/packages/web/src/components/usdc-balance-pill/USDCBalancePill.tsx b/packages/web/src/components/usdc-balance-pill/USDCBalancePill.tsx index c5e881615e6..c64b7ab59d2 100644 --- a/packages/web/src/components/usdc-balance-pill/USDCBalancePill.tsx +++ b/packages/web/src/components/usdc-balance-pill/USDCBalancePill.tsx @@ -1,10 +1,9 @@ +import { useUSDCBalance } from '@audius/common/hooks' +import { Status, BNUSDC } from '@audius/common/models' import { - BNUSDC, - Status, formatCurrencyBalance, - formatUSDCWeiToFloorCentsNumber, - useUSDCBalance -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import { LogoUSDC } from '@audius/stems' import BN from 'bn.js' import cn from 'classnames' diff --git a/packages/web/src/components/usdc-manual-transfer/USDCManualTransfer.tsx b/packages/web/src/components/usdc-manual-transfer/USDCManualTransfer.tsx index 638c6623ade..48489f5366b 100644 --- a/packages/web/src/components/usdc-manual-transfer/USDCManualTransfer.tsx +++ b/packages/web/src/components/usdc-manual-transfer/USDCManualTransfer.tsx @@ -1,12 +1,11 @@ import { useCallback, useContext } from 'react' +import { useUSDCBalance, useCreateUserbankIfNeeded } from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { - Name, - isContentPurchaseInProgress, purchaseContentSelectors, - useCreateUserbankIfNeeded, - useUSDCBalance -} from '@audius/common' + isContentPurchaseInProgress +} from '@audius/common/store' import { USDC } from '@audius/fixed-decimal' import { Button, Flex, IconLogoCircleUSDC } from '@audius/harmony' import { IconError } from '@audius/stems' diff --git a/packages/web/src/components/usdc-purchase-details-modal/USDCPurchaseDetailsModal.tsx b/packages/web/src/components/usdc-purchase-details-modal/USDCPurchaseDetailsModal.tsx index 5cd3117b577..8390ea4675f 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/USDCPurchaseDetailsModal.tsx +++ b/packages/web/src/components/usdc-purchase-details-modal/USDCPurchaseDetailsModal.tsx @@ -1,4 +1,4 @@ -import { useUSDCPurchaseDetailsModal } from '@audius/common' +import { useUSDCPurchaseDetailsModal } from '@audius/common/store' import { Modal } from '@audius/stems' import { PurchaseModalContent } from './components/PurchaseModalContent' diff --git a/packages/web/src/components/usdc-purchase-details-modal/components/PurchaseModalContent.tsx b/packages/web/src/components/usdc-purchase-details-modal/components/PurchaseModalContent.tsx index e0588ed087e..12929a5593a 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/components/PurchaseModalContent.tsx +++ b/packages/web/src/components/usdc-purchase-details-modal/components/PurchaseModalContent.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { makeSolanaTransactionLink, useGetTrackById } from '@audius/common' +import { useGetTrackById } from '@audius/common/api' +import { makeSolanaTransactionLink } from '@audius/common/utils' import { Button, Flex, diff --git a/packages/web/src/components/usdc-purchase-details-modal/components/SaleModalContent.tsx b/packages/web/src/components/usdc-purchase-details-modal/components/SaleModalContent.tsx index b7b6cc7e2d8..dd02dfbaa79 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/components/SaleModalContent.tsx +++ b/packages/web/src/components/usdc-purchase-details-modal/components/SaleModalContent.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react' import { - CommonState, chatActions, chatSelectors, - makeSolanaTransactionLink, - useInboxUnavailableModal -} from '@audius/common' + useInboxUnavailableModal, + CommonState +} from '@audius/common/store' +import { makeSolanaTransactionLink } from '@audius/common/utils' import { Button, Flex, diff --git a/packages/web/src/components/usdc-purchase-details-modal/components/TrackLink.tsx b/packages/web/src/components/usdc-purchase-details-modal/components/TrackLink.tsx index 6b6b8feaea2..af0c4254d65 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/components/TrackLink.tsx +++ b/packages/web/src/components/usdc-purchase-details-modal/components/TrackLink.tsx @@ -1,4 +1,4 @@ -import { useGetTrackById } from '@audius/common' +import { useGetTrackById } from '@audius/common/api' import { Link } from 'react-router-dom' import { Text } from 'components/typography' diff --git a/packages/web/src/components/usdc-purchase-details-modal/components/TransactionSummary.tsx b/packages/web/src/components/usdc-purchase-details-modal/components/TransactionSummary.tsx index 5ad4cfd6309..3b3a2bb0de4 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/components/TransactionSummary.tsx +++ b/packages/web/src/components/usdc-purchase-details-modal/components/TransactionSummary.tsx @@ -1,4 +1,5 @@ -import { USDCPurchaseDetails, formatUSDCWeiToUSDString } from '@audius/common' +import { USDCPurchaseDetails } from '@audius/common/models' +import { formatUSDCWeiToUSDString } from '@audius/common/utils' import BN from 'bn.js' import { SummaryTable, SummaryTableItem } from 'components/summary-table' diff --git a/packages/web/src/components/usdc-purchase-details-modal/components/types.ts b/packages/web/src/components/usdc-purchase-details-modal/components/types.ts index 9b1162735d9..8e605af9b3b 100644 --- a/packages/web/src/components/usdc-purchase-details-modal/components/types.ts +++ b/packages/web/src/components/usdc-purchase-details-modal/components/types.ts @@ -1,4 +1,4 @@ -import { USDCPurchaseDetails } from '@audius/common' +import { USDCPurchaseDetails } from '@audius/common/models' export type ContentProps = { purchaseDetails: USDCPurchaseDetails diff --git a/packages/web/src/components/usdc-transaction-details-modal/USDCTransactionDetailsModal.tsx b/packages/web/src/components/usdc-transaction-details-modal/USDCTransactionDetailsModal.tsx index 71fa88d6328..1dba681aa84 100644 --- a/packages/web/src/components/usdc-transaction-details-modal/USDCTransactionDetailsModal.tsx +++ b/packages/web/src/components/usdc-transaction-details-modal/USDCTransactionDetailsModal.tsx @@ -1,8 +1,8 @@ +import { useUSDCTransactionDetailsModal } from '@audius/common/store' import { formatUSDCWeiToUSDString, - useUSDCTransactionDetailsModal, makeSolanaTransactionLink -} from '@audius/common' +} from '@audius/common/utils' import { Button } from '@audius/harmony' import { IconExternalLink, diff --git a/packages/web/src/components/user-badges/FollowsYouBadge.tsx b/packages/web/src/components/user-badges/FollowsYouBadge.tsx index 389130b0e1b..3e28a8579cf 100644 --- a/packages/web/src/components/user-badges/FollowsYouBadge.tsx +++ b/packages/web/src/components/user-badges/FollowsYouBadge.tsx @@ -1,4 +1,5 @@ -import { ID, accountSelectors } from '@audius/common' +import { ID } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { useWithMobileStyle } from 'hooks/useWithMobileStyle' diff --git a/packages/web/src/components/user-badges/ProfilePageBadge.tsx b/packages/web/src/components/user-badges/ProfilePageBadge.tsx index 8fe9f91154e..05759ae9847 100644 --- a/packages/web/src/components/user-badges/ProfilePageBadge.tsx +++ b/packages/web/src/components/user-badges/ProfilePageBadge.tsx @@ -1,6 +1,8 @@ import { useCallback } from 'react' -import { ID, BadgeTier, modalsActions, useSelectTierInfo } from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import { BadgeTier, ID } from '@audius/common/models' +import { modalsActions } from '@audius/common/store' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/user-badges/UserBadges.tsx b/packages/web/src/components/user-badges/UserBadges.tsx index ce7067c5a8d..9c19828a6fe 100644 --- a/packages/web/src/components/user-badges/UserBadges.tsx +++ b/packages/web/src/components/user-badges/UserBadges.tsx @@ -1,6 +1,8 @@ import { cloneElement, ReactElement } from 'react' -import { ID, BadgeTier, Nullable, useSelectTierInfo } from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import { BadgeTier, ID } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import IconBronzeBadgeSVG from 'assets/img/IconBronzeBadge.svg' diff --git a/packages/web/src/components/user-generated-text/UserGeneratedText.tsx b/packages/web/src/components/user-generated-text/UserGeneratedText.tsx index 85aa968e8d5..6c06c1e124d 100644 --- a/packages/web/src/components/user-generated-text/UserGeneratedText.tsx +++ b/packages/web/src/components/user-generated-text/UserGeneratedText.tsx @@ -1,10 +1,10 @@ import { forwardRef, useMemo, MouseEvent } from 'react' import { - getPathFromAudiusUrl, + squashNewLines, isAudiusUrl, - squashNewLines -} from '@audius/common' + getPathFromAudiusUrl +} from '@audius/common/utils' import cn from 'classnames' import Linkify from 'linkify-react' import { IntermediateRepresentation, Opts } from 'linkifyjs' diff --git a/packages/web/src/components/user-list-modal/components/UserListModal.tsx b/packages/web/src/components/user-list-modal/components/UserListModal.tsx index f00ba69f11c..a6cd99c4938 100644 --- a/packages/web/src/components/user-list-modal/components/UserListModal.tsx +++ b/packages/web/src/components/user-list-modal/components/UserListModal.tsx @@ -1,29 +1,29 @@ import { ReactElement, useRef } from 'react' +import { ID } from '@audius/common/models' import { cacheUsersSelectors, profilePageSelectors, topSupportersUserListSelectors, - UserListStoreState, supportingUserListSelectors, repostsUserListSelectors, notificationsUserListSelectors, - relatedArtistsUserListSelectors, - NOTIFICATIONS_USER_LIST_TAG as NOTIFICATION_TAG, mutualsUserListSelectors, - MUTUALS_USER_LIST_TAG as MUTUALS_TAG, followingUserListSelectors, followersUserListSelectors, favoritesUserListSelectors, - FAVORITES_USER_LIST_TAG as FAVORITES_TAG, - FOLLOWERS_USER_LIST_TAG as FOLLOWER_TAG, - FOLLOWING_USER_LIST_TAG as FOLLOWING_TAG, - REPOSTS_USER_LIST_TAG as REPOST_TAG, - SUPPORTING_USER_LIST_TAG as SUPPORTING_TAG, + relatedArtistsUserListSelectors, TOP_SUPPORTERS_USER_LIST_TAG as SUPPORTER_TAG, + SUPPORTING_USER_LIST_TAG as SUPPORTING_TAG, + REPOSTS_USER_LIST_TAG as REPOST_TAG, + NOTIFICATIONS_USER_LIST_TAG as NOTIFICATION_TAG, + MUTUALS_USER_LIST_TAG as MUTUALS_TAG, + FOLLOWING_USER_LIST_TAG as FOLLOWING_TAG, + FOLLOWERS_USER_LIST_TAG as FOLLOWER_TAG, + FAVORITES_USER_LIST_TAG as FAVORITES_TAG, RELATED_ARTISTS_USER_LIST_TAG as RELATED_ARTISTS_TAG, - ID -} from '@audius/common' + UserListStoreState +} from '@audius/common/store' import { Modal, IconTrophy, diff --git a/packages/web/src/components/user-list/UserList.tsx b/packages/web/src/components/user-list/UserList.tsx index fee10ff4be1..d980abad932 100644 --- a/packages/web/src/components/user-list/UserList.tsx +++ b/packages/web/src/components/user-list/UserList.tsx @@ -1,17 +1,15 @@ import { useEffect, useState } from 'react' +import { FollowSource, ID, User } from '@audius/common/models' import { - ID, - FollowSource, - User, accountSelectors, cacheUsersSelectors, profilePageActions, + usersSocialActions as socialActions, userListActions, userListSelectors, - UserListStoreState, - usersSocialActions as socialActions -} from '@audius/common' + UserListStoreState +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/components/user-list/components/UserList.tsx b/packages/web/src/components/user-list/components/UserList.tsx index f2f1a97ce95..e393ddbf1cf 100644 --- a/packages/web/src/components/user-list/components/UserList.tsx +++ b/packages/web/src/components/user-list/components/UserList.tsx @@ -1,9 +1,8 @@ +import { ID, User } from '@audius/common/models' import { - ID, - SUPPORTING_USER_LIST_TAG, TOP_SUPPORTERS_USER_LIST_TAG, - User -} from '@audius/common' + SUPPORTING_USER_LIST_TAG +} from '@audius/common/store' import cn from 'classnames' import InfiniteScroll from 'react-infinite-scroller' import Lottie from 'react-lottie' diff --git a/packages/web/src/components/user-name-and-badges/UserNameAndBadges.tsx b/packages/web/src/components/user-name-and-badges/UserNameAndBadges.tsx index 56b6ae6dfa2..7914ae811f4 100644 --- a/packages/web/src/components/user-name-and-badges/UserNameAndBadges.tsx +++ b/packages/web/src/components/user-name-and-badges/UserNameAndBadges.tsx @@ -1,6 +1,8 @@ import { MouseEventHandler, useCallback } from 'react' -import { UserMetadata, accountSelectors, useGetUserById } from '@audius/common' +import { useGetUserById } from '@audius/common/api' +import { UserMetadata } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import cn from 'classnames' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/wait-for-download-modal/WaitForDownloadModal.tsx b/packages/web/src/components/wait-for-download-modal/WaitForDownloadModal.tsx index c2be502bb60..5e3018f016c 100644 --- a/packages/web/src/components/wait-for-download-modal/WaitForDownloadModal.tsx +++ b/packages/web/src/components/wait-for-download-modal/WaitForDownloadModal.tsx @@ -2,7 +2,7 @@ import { CommonState, useWaitForDownloadModal, cacheTracksSelectors -} from '@audius/common' +} from '@audius/common/store' import { Flex, IconReceive, Text } from '@audius/harmony' import { ModalHeader } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/components/welcome-modal/WelcomeModal.tsx b/packages/web/src/components/welcome-modal/WelcomeModal.tsx index bef3dda077d..139d126657a 100644 --- a/packages/web/src/components/welcome-modal/WelcomeModal.tsx +++ b/packages/web/src/components/welcome-modal/WelcomeModal.tsx @@ -1,12 +1,9 @@ import { useCallback, useEffect } from 'react' -import { - Name, - SquareSizes, - accountSelectors, - fillString, - welcomeModalMessages as messages -} from '@audius/common' +import { welcomeModalMessages } from '@audius/common/messages' +import { Name, SquareSizes } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import { fillString } from '@audius/common/utils' import { Button, Flex, @@ -101,15 +98,18 @@ export const WelcomeModal = () => { id='welcome-title' color='accent' > - {fillString(messages.welcome, userName ? `, ${userName}` : ' ')} + {fillString( + welcomeModalMessages.welcome, + userName ? `, ${userName}` : ' ' + )} - {messages.youreIn} + {welcomeModalMessages.youreIn} diff --git a/packages/web/src/components/withdraw-usdc-modal/WithdrawUSDCModal.tsx b/packages/web/src/components/withdraw-usdc-modal/WithdrawUSDCModal.tsx index fab362e9079..3b08cbe1e5a 100644 --- a/packages/web/src/components/withdraw-usdc-modal/WithdrawUSDCModal.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/WithdrawUSDCModal.tsx @@ -1,23 +1,25 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { - SolanaWalletAddress, - useUSDCBalance, - useWithdrawUSDCModal, - WithdrawUSDCModalPages, - withdrawUSDCActions, - BNUSDC, - formatUSDCWeiToFloorCentsNumber, - Nullable, - withdrawUSDCSelectors, - Status, - Name, - WithdrawMethod, useFeatureFlag, - FeatureFlags, useRemoteVar, - IntKeys -} from '@audius/common' + useUSDCBalance +} from '@audius/common/hooks' +import { + Name, + Status, + BNUSDC, + SolanaWalletAddress +} from '@audius/common/models' +import { IntKeys, FeatureFlags } from '@audius/common/services' +import { + withdrawUSDCActions, + withdrawUSDCSelectors, + WithdrawUSDCModalPages, + useWithdrawUSDCModal, + WithdrawMethod +} from '@audius/common/store' +import { formatUSDCWeiToFloorCentsNumber, Nullable } from '@audius/common/utils' import { Modal, ModalContent, ModalHeader } from '@audius/stems' import BN from 'bn.js' import { Formik, FormikProps, useFormikContext } from 'formik' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/CoinflowWithdrawModal.tsx b/packages/web/src/components/withdraw-usdc-modal/components/CoinflowWithdrawModal.tsx index 044641d4821..c3c07e19ac7 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/CoinflowWithdrawModal.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/CoinflowWithdrawModal.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' +import { useCoinflowAdapter } from '@audius/common/hooks' import { - useCoinflowAdapter, - useCoinflowWithdrawModal, - withdrawUSDCActions -} from '@audius/common' + withdrawUSDCActions, + useCoinflowWithdrawModal +} from '@audius/common/store' import { CoinflowWithdraw } from '@coinflowlabs/react' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/ConfirmTransferDetails.tsx b/packages/web/src/components/withdraw-usdc-modal/components/ConfirmTransferDetails.tsx index e9c45b9b2a9..a09256a6980 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/ConfirmTransferDetails.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/ConfirmTransferDetails.tsx @@ -1,14 +1,16 @@ import { useCallback, useState } from 'react' +import { useUSDCBalance } from '@audius/common/hooks' +import { BNUSDC } from '@audius/common/models' import { WithdrawUSDCModalPages, - decimalIntegerToHumanReadable, useWithdrawUSDCModal, - useUSDCBalance, - formatUSDCWeiToFloorCentsNumber, - BNUSDC, WithdrawMethod -} from '@audius/common' +} from '@audius/common/store' +import { + decimalIntegerToHumanReadable, + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import { Button, IconQuestionCircle } from '@audius/harmony' import { Switch } from '@audius/stems' import BN from 'bn.js' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/EnterTransferDetails.tsx b/packages/web/src/components/withdraw-usdc-modal/components/EnterTransferDetails.tsx index 4a50f2b9f8f..7af9126eeca 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/EnterTransferDetails.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/EnterTransferDetails.tsx @@ -5,20 +5,20 @@ import { useState } from 'react' +import { useFeatureFlag, useUSDCBalance } from '@audius/common/hooks' +import { Name, BNUSDC } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - useUSDCBalance, - BNUSDC, - useWithdrawUSDCModal, WithdrawUSDCModalPages, - formatUSDCWeiToFloorCentsNumber, + useWithdrawUSDCModal, + WithdrawMethod +} from '@audius/common/store' +import { filterDecimalString, padDecimalValue, decimalIntegerToHumanReadable, - Name, - WithdrawMethod, - FeatureFlags, - useFeatureFlag -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import { Button } from '@audius/harmony' import { SegmentedControl } from '@audius/stems' import BN from 'bn.js' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/ErrorPage.tsx b/packages/web/src/components/withdraw-usdc-modal/components/ErrorPage.tsx index 9a54da83f2e..597fd4421e9 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/ErrorPage.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/ErrorPage.tsx @@ -1,14 +1,16 @@ import { useCallback } from 'react' +import { useUSDCBalance } from '@audius/common/hooks' +import { BNUSDC } from '@audius/common/models' import { - useUSDCBalance, - formatCurrencyBalance, - BNUSDC, - formatUSDCWeiToFloorDollarNumber, - useWithdrawUSDCModal, WithdrawUSDCModalPages, - decimalIntegerToHumanReadable -} from '@audius/common' + useWithdrawUSDCModal +} from '@audius/common/store' +import { + decimalIntegerToHumanReadable, + formatCurrencyBalance, + formatUSDCWeiToFloorDollarNumber +} from '@audius/common/utils' import BN from 'bn.js' import { useField } from 'formik' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/PrepareTransfer.tsx b/packages/web/src/components/withdraw-usdc-modal/components/PrepareTransfer.tsx index 0e3473018ed..51f1f07eb20 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/PrepareTransfer.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/PrepareTransfer.tsx @@ -1,12 +1,12 @@ import { useEffect } from 'react' import { - CoinflowWithdrawState, withdrawUSDCSelectors, + useCoinflowWithdrawModal, WithdrawUSDCModalPages, useWithdrawUSDCModal, - useCoinflowWithdrawModal -} from '@audius/common' + CoinflowWithdrawState +} from '@audius/common/store' import { Flex, Text } from '@audius/harmony' import { useField } from 'formik' import { useSelector } from 'react-redux' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/TransferInProgress.tsx b/packages/web/src/components/withdraw-usdc-modal/components/TransferInProgress.tsx index 924d827f55b..059330ab0fd 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/TransferInProgress.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/TransferInProgress.tsx @@ -1,9 +1,9 @@ +import { useUSDCBalance } from '@audius/common/hooks' +import { BNUSDC } from '@audius/common/models' import { - useUSDCBalance, - BNUSDC, - formatUSDCWeiToFloorCentsNumber, - decimalIntegerToHumanReadable -} from '@audius/common' + decimalIntegerToHumanReadable, + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import BN from 'bn.js' import { useField } from 'formik' diff --git a/packages/web/src/components/withdraw-usdc-modal/components/TransferSuccessful.tsx b/packages/web/src/components/withdraw-usdc-modal/components/TransferSuccessful.tsx index 09df53ec7bf..c9090c0d724 100644 --- a/packages/web/src/components/withdraw-usdc-modal/components/TransferSuccessful.tsx +++ b/packages/web/src/components/withdraw-usdc-modal/components/TransferSuccessful.tsx @@ -1,16 +1,13 @@ import { useCallback } from 'react' +import { useUSDCBalance } from '@audius/common/hooks' +import { Name, Status, BNUSDC } from '@audius/common/models' +import { withdrawUSDCSelectors, WithdrawMethod } from '@audius/common/store' import { - useUSDCBalance, - BNUSDC, - formatUSDCWeiToFloorCentsNumber, - makeSolanaTransactionLink, decimalIntegerToHumanReadable, - Status, - withdrawUSDCSelectors, - Name, - WithdrawMethod -} from '@audius/common' + formatUSDCWeiToFloorCentsNumber, + makeSolanaTransactionLink +} from '@audius/common/utils' import { Button, Flex } from '@audius/harmony' import { HarmonyPlainButton, diff --git a/packages/web/src/components/withdraw-usdc-modal/types.ts b/packages/web/src/components/withdraw-usdc-modal/types.ts index 7114fe074c2..7c8b1c59dd6 100644 --- a/packages/web/src/components/withdraw-usdc-modal/types.ts +++ b/packages/web/src/components/withdraw-usdc-modal/types.ts @@ -1,4 +1,4 @@ -import { WithdrawMethod } from '@audius/common' +import { WithdrawMethod } from '@audius/common/store' export const AMOUNT = 'amount' export const ADDRESS = 'address' diff --git a/packages/web/src/hooks/useAsyncPoll.ts b/packages/web/src/hooks/useAsyncPoll.ts index fe341492991..a0ca04b54dc 100644 --- a/packages/web/src/hooks/useAsyncPoll.ts +++ b/packages/web/src/hooks/useAsyncPoll.ts @@ -1,6 +1,6 @@ import { useEffect, useCallback } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' type UseAsyncPoll = { // Call to make (usually an action), doesn't have to be async diff --git a/packages/web/src/hooks/useAuthenticatedCallback.ts b/packages/web/src/hooks/useAuthenticatedCallback.ts index 36dcf7fafc3..30205bde401 100644 --- a/packages/web/src/hooks/useAuthenticatedCallback.ts +++ b/packages/web/src/hooks/useAuthenticatedCallback.ts @@ -1,6 +1,6 @@ import { MouseEvent as ReactMouseEvent, useCallback } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { useDispatch } from 'react-redux' import { diff --git a/packages/web/src/hooks/useCardWeight.ts b/packages/web/src/hooks/useCardWeight.ts index 2101d3a6431..f557445ebae 100644 --- a/packages/web/src/hooks/useCardWeight.ts +++ b/packages/web/src/hooks/useCardWeight.ts @@ -1,6 +1,6 @@ import { useEffect, useRef, useCallback, MutableRefObject } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { InterpolationChain, useSpring } from 'react-spring' diff --git a/packages/web/src/hooks/useCollectionCoverArt.ts b/packages/web/src/hooks/useCollectionCoverArt.ts index f1030edd742..a81c4c03592 100644 --- a/packages/web/src/hooks/useCollectionCoverArt.ts +++ b/packages/web/src/hooks/useCollectionCoverArt.ts @@ -1,10 +1,7 @@ -import { - CoverArtSizes, - SquareSizes, - useImageSize, - cacheCollectionsActions, - imageBlank as imageEmpty -} from '@audius/common' +import { imageBlank as imageEmpty } from '@audius/common/assets' +import { useImageSize } from '@audius/common/hooks' +import { SquareSizes, CoverArtSizes } from '@audius/common/models' +import { cacheCollectionsActions } from '@audius/common/store' import { useDispatch } from 'react-redux' const { fetchCoverArt } = cacheCollectionsActions diff --git a/packages/web/src/hooks/useCoverPhoto.ts b/packages/web/src/hooks/useCoverPhoto.ts index 475ff3ea375..1d706c859fe 100644 --- a/packages/web/src/hooks/useCoverPhoto.ts +++ b/packages/web/src/hooks/useCoverPhoto.ts @@ -1,15 +1,12 @@ import { useCallback } from 'react' import { - CoverPhotoSizes, - WidthSizes, - useImageSize, - cacheUsersActions, imageCoverPhotoBlank, - cacheUsersSelectors, - SquareSizes, imageProfilePicEmpty -} from '@audius/common' +} from '@audius/common/assets' +import { useImageSize } from '@audius/common/hooks' +import { SquareSizes, WidthSizes, CoverPhotoSizes } from '@audius/common/models' +import { cacheUsersActions, cacheUsersSelectors } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/hooks/useDelayedEffect.ts b/packages/web/src/hooks/useDelayedEffect.ts index 13baa03f009..fd431559fca 100644 --- a/packages/web/src/hooks/useDelayedEffect.ts +++ b/packages/web/src/hooks/useDelayedEffect.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' /** * useDelayedEffect invokes a callback after a given delay on the satisfaction diff --git a/packages/web/src/hooks/useErrorPageOnFailedStatus.ts b/packages/web/src/hooks/useErrorPageOnFailedStatus.ts index 03bdf3c2e29..66b8d08e355 100644 --- a/packages/web/src/hooks/useErrorPageOnFailedStatus.ts +++ b/packages/web/src/hooks/useErrorPageOnFailedStatus.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { Status } from '@audius/common' +import { Status } from '@audius/common/models' import { useDispatch } from 'react-redux' import { HandleErrorArgs, handleError } from 'store/errors/actions' diff --git a/packages/web/src/hooks/useHasChangedRoute.ts b/packages/web/src/hooks/useHasChangedRoute.ts index ffc766120d1..8ec2e722fb8 100644 --- a/packages/web/src/hooks/useHasChangedRoute.ts +++ b/packages/web/src/hooks/useHasChangedRoute.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { useHistory } from 'react-router-dom' /** diff --git a/packages/web/src/hooks/useImageSize.test.tsx b/packages/web/src/hooks/useImageSize.test.tsx index b1b424c51d1..1061d7d8e22 100644 --- a/packages/web/src/hooks/useImageSize.test.tsx +++ b/packages/web/src/hooks/useImageSize.test.tsx @@ -1,10 +1,9 @@ +import { useImageSize, BaseUserImageSizeProps } from '@audius/common/hooks' import { - BaseUserImageSizeProps, DefaultSizes, - ImageSizesObject, SquareSizes, - useImageSize -} from '@audius/common' + ImageSizesObject +} from '@audius/common/models' import { render } from '@testing-library/react' import type { Dispatch } from 'redux' import { expect, describe, it, vitest } from 'vitest' diff --git a/packages/web/src/hooks/useIsAudioMatchingChallengesEnabled.ts b/packages/web/src/hooks/useIsAudioMatchingChallengesEnabled.ts index 7f85ebf8b44..5d901f67f9b 100644 --- a/packages/web/src/hooks/useIsAudioMatchingChallengesEnabled.ts +++ b/packages/web/src/hooks/useIsAudioMatchingChallengesEnabled.ts @@ -1,4 +1,4 @@ -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import { useFlag } from './useRemoteConfig' diff --git a/packages/web/src/hooks/useIsUSDCEnabled.ts b/packages/web/src/hooks/useIsUSDCEnabled.ts index 1964dad6a8d..187e6deab6a 100644 --- a/packages/web/src/hooks/useIsUSDCEnabled.ts +++ b/packages/web/src/hooks/useIsUSDCEnabled.ts @@ -1,4 +1,5 @@ -import { useFeatureFlag, FeatureFlags } from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' export const useIsUSDCEnabled = () => useFeatureFlag(FeatureFlags.USDC_PURCHASES).isEnabled diff --git a/packages/web/src/hooks/useLocalStorage.ts b/packages/web/src/hooks/useLocalStorage.ts index 367a1eca089..157546352be 100644 --- a/packages/web/src/hooks/useLocalStorage.ts +++ b/packages/web/src/hooks/useLocalStorage.ts @@ -1,4 +1,4 @@ -import { createUseLocalStorageHook } from '@audius/common' +import { createUseLocalStorageHook } from '@audius/common/hooks' const getJSONValue = (key: string) => { const val = window.localStorage.getItem(key) diff --git a/packages/web/src/hooks/useRemoteConfig.ts b/packages/web/src/hooks/useRemoteConfig.ts index bf7845baed2..7a5e9dc6013 100644 --- a/packages/web/src/hooks/useRemoteConfig.ts +++ b/packages/web/src/hooks/useRemoteConfig.ts @@ -1,9 +1,8 @@ import { createUseFeatureFlagHook, - createUseRemoteVarHook, - accountSelectors, - remoteConfigSelectors -} from '@audius/common' + createUseRemoteVarHook +} from '@audius/common/hooks' +import { accountSelectors, remoteConfigSelectors } from '@audius/common/store' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/hooks/useRequiresAccount.ts b/packages/web/src/hooks/useRequiresAccount.ts index fc4e62d6c7b..9fa3433356c 100644 --- a/packages/web/src/hooks/useRequiresAccount.ts +++ b/packages/web/src/hooks/useRequiresAccount.ts @@ -1,6 +1,7 @@ import { useEffect } from 'react' -import { accountSelectors, Status } from '@audius/common' +import { Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/hooks/useTabs/useTabs.tsx b/packages/web/src/hooks/useTabs/useTabs.tsx index a2d88154681..aaf2dfc0957 100644 --- a/packages/web/src/hooks/useTabs/useTabs.tsx +++ b/packages/web/src/hooks/useTabs/useTabs.tsx @@ -13,7 +13,7 @@ import { createRef } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock' import cn from 'classnames' import { throttle } from 'lodash' diff --git a/packages/web/src/hooks/useTikTokAuth.ts b/packages/web/src/hooks/useTikTokAuth.ts index d3b3708e01b..4b51990f892 100644 --- a/packages/web/src/hooks/useTikTokAuth.ts +++ b/packages/web/src/hooks/useTikTokAuth.ts @@ -1,13 +1,12 @@ // Polyfills import 'whatwg-fetch' import 'url-search-params-polyfill' - import { - Name, - Credentials, + createUseTikTokAuthHook, UseTikTokAuthArguments, - createUseTikTokAuthHook -} from '@audius/common' + Credentials +} from '@audius/common/hooks' +import { Name } from '@audius/common/models' import { useRecord, make } from 'common/store/analytics/actions' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' diff --git a/packages/web/src/hooks/useTrackCoverArt.ts b/packages/web/src/hooks/useTrackCoverArt.ts index 96504fc7620..7ffaab3e734 100644 --- a/packages/web/src/hooks/useTrackCoverArt.ts +++ b/packages/web/src/hooks/useTrackCoverArt.ts @@ -1,13 +1,8 @@ -import { - CoverArtSizes, - SquareSizes, - useImageSize, - cacheTracksActions, - imageBlank as imageEmpty, - Maybe, - cacheTracksSelectors, - ID -} from '@audius/common' +import { imageBlank as imageEmpty } from '@audius/common/assets' +import { useImageSize } from '@audius/common/hooks' +import { SquareSizes, ID, CoverArtSizes } from '@audius/common/models' +import { cacheTracksActions, cacheTracksSelectors } from '@audius/common/store' +import { Maybe } from '@audius/common/utils' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/hooks/useUserProfilePicture.ts b/packages/web/src/hooks/useUserProfilePicture.ts index 3e57dcaeb4b..a7f161a2a29 100644 --- a/packages/web/src/hooks/useUserProfilePicture.ts +++ b/packages/web/src/hooks/useUserProfilePicture.ts @@ -1,11 +1,7 @@ -import { - ProfilePictureSizes, - SquareSizes, - useImageSize, - cacheUsersActions, - imageProfilePicEmpty as profilePicEmpty, - cacheUsersSelectors -} from '@audius/common' +import { imageProfilePicEmpty as profilePicEmpty } from '@audius/common/assets' +import { useImageSize } from '@audius/common/hooks' +import { SquareSizes, ProfilePictureSizes } from '@audius/common/models' +import { cacheUsersActions, cacheUsersSelectors } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/hooks/wallet.tsx b/packages/web/src/hooks/wallet.tsx index 22207888d23..ce5f16ac7c3 100644 --- a/packages/web/src/hooks/wallet.tsx +++ b/packages/web/src/hooks/wallet.tsx @@ -1,8 +1,5 @@ -import { - accountSelectors, - profilePageSelectors, - useSelectTierInfo -} from '@audius/common' +import { useSelectTierInfo } from '@audius/common/hooks' +import { accountSelectors, profilePageSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' const { getProfileUser } = profilePageSelectors diff --git a/packages/web/src/index.css b/packages/web/src/index.css index 8bc95d48e46..68aaf1d090b 100644 --- a/packages/web/src/index.css +++ b/packages/web/src/index.css @@ -1,5 +1,5 @@ @import 'antd/dist/antd.min.css'; -@import 'assets/styles/index.css'; +@import './assets/styles/index.css'; @import 'react-perfect-scrollbar/dist/css/styles.css'; /* Begin Reset.css */ diff --git a/packages/web/src/pages/ai-attributed-tracks-page/AiPageProvider.tsx b/packages/web/src/pages/ai-attributed-tracks-page/AiPageProvider.tsx index 9ae35f11aad..7c4bd263306 100644 --- a/packages/web/src/pages/ai-attributed-tracks-page/AiPageProvider.tsx +++ b/packages/web/src/pages/ai-attributed-tracks-page/AiPageProvider.tsx @@ -1,14 +1,14 @@ import { useEffect, useCallback, ComponentType, RefObject } from 'react' +import { ID } from '@audius/common/models' import { - ID, lineupSelectors, aiPageLineupActions as tracksActions, aiPageActions, aiPageSelectors, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { useParams } from 'react-router' diff --git a/packages/web/src/pages/ai-attributed-tracks-page/components/desktop/AiPage.tsx b/packages/web/src/pages/ai-attributed-tracks-page/components/desktop/AiPage.tsx index 0939a61e7e5..7483ab5af7d 100644 --- a/packages/web/src/pages/ai-attributed-tracks-page/components/desktop/AiPage.tsx +++ b/packages/web/src/pages/ai-attributed-tracks-page/components/desktop/AiPage.tsx @@ -1,5 +1,5 @@ -import { User } from '@audius/common' // import { IconRobot, IconRemix } from '@audius/stems' +import { User } from '@audius/common/models' import cn from 'classnames' import IconRobot from 'assets/img/iconRobot.svg' diff --git a/packages/web/src/pages/ai-attributed-tracks-page/components/mobile/AiPage.tsx b/packages/web/src/pages/ai-attributed-tracks-page/components/mobile/AiPage.tsx index ce03be6b16f..57d5232c338 100644 --- a/packages/web/src/pages/ai-attributed-tracks-page/components/mobile/AiPage.tsx +++ b/packages/web/src/pages/ai-attributed-tracks-page/components/mobile/AiPage.tsx @@ -1,6 +1,6 @@ import { useEffect, useContext } from 'react' -import { User } from '@audius/common' +import { User } from '@audius/common/models' import cn from 'classnames' import IconRobot from 'assets/img/iconRobot.svg' diff --git a/packages/web/src/pages/audio-rewards-page/AudioRewardsPage.tsx b/packages/web/src/pages/audio-rewards-page/AudioRewardsPage.tsx index a311122b175..0f18f22d244 100644 --- a/packages/web/src/pages/audio-rewards-page/AudioRewardsPage.tsx +++ b/packages/web/src/pages/audio-rewards-page/AudioRewardsPage.tsx @@ -1,11 +1,7 @@ import { ReactNode, useContext, useEffect } from 'react' -import { - FeatureFlags, - StringKeys, - tokenDashboardPageActions, - walletActions -} from '@audius/common' +import { StringKeys, FeatureFlags } from '@audius/common/services' +import { tokenDashboardPageActions, walletActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import Header from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/audio-rewards-page/ChallengeRewardsTile.tsx b/packages/web/src/pages/audio-rewards-page/ChallengeRewardsTile.tsx index e3c6287f632..fd4c19c2d13 100644 --- a/packages/web/src/pages/audio-rewards-page/ChallengeRewardsTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/ChallengeRewardsTile.tsx @@ -1,21 +1,25 @@ import { ReactNode, useEffect, useMemo, useState } from 'react' import { + Name, + ChallengeName, ChallengeRewardID, - OptimisticUserChallenge, - removeNullable, - StringKeys, - fillString, - formatNumberCommas, + OptimisticUserChallenge +} from '@audius/common/models' +import { StringKeys } from '@audius/common/services' +import { challengesSelectors, - audioRewardsPageActions, - ChallengeRewardsModalType, - ChallengeName, audioRewardsPageSelectors, - isAudioMatchingChallenge, + audioRewardsPageActions, + ChallengeRewardsModalType +} from '@audius/common/store' +import { + fillString, + formatNumberCommas, + removeNullable, makeOptimisticChallengeSortComparator, - Name -} from '@audius/common' + isAudioMatchingChallenge +} from '@audius/common/utils' import { ProgressBar, ButtonType, diff --git a/packages/web/src/pages/audio-rewards-page/Tiers.tsx b/packages/web/src/pages/audio-rewards-page/Tiers.tsx index 7c1d78e2c10..dee87a8a586 100644 --- a/packages/web/src/pages/audio-rewards-page/Tiers.tsx +++ b/packages/web/src/pages/audio-rewards-page/Tiers.tsx @@ -1,15 +1,15 @@ import { ReactElement, useCallback, useEffect, useMemo } from 'react' +import { useSelectTierInfo } from '@audius/common/hooks' +import { BadgeTier } from '@audius/common/models' import { - BadgeTier, - Nullable, accountSelectors, badgeTiers, getTierNumber, vipDiscordModalActions, - musicConfettiActions, - useSelectTierInfo -} from '@audius/common' + musicConfettiActions +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Button, ButtonType, IconDiscord } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/Tiles.tsx b/packages/web/src/pages/audio-rewards-page/Tiles.tsx index 7efd7916022..abdcd36800b 100644 --- a/packages/web/src/pages/audio-rewards-page/Tiles.tsx +++ b/packages/web/src/pages/audio-rewards-page/Tiles.tsx @@ -1,12 +1,11 @@ import { useCallback, ReactNode } from 'react' import { - formatWei, - tokenDashboardPageActions, tokenDashboardPageSelectors, - walletSelectors, - isNullOrUndefined -} from '@audius/common' + tokenDashboardPageActions, + walletSelectors +} from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import { Button, ButtonType, IconInfo } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/TrendingRewardsTile.tsx b/packages/web/src/pages/audio-rewards-page/TrendingRewardsTile.tsx index 8eddca52925..c4b32a81e6a 100644 --- a/packages/web/src/pages/audio-rewards-page/TrendingRewardsTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/TrendingRewardsTile.tsx @@ -2,10 +2,10 @@ import { ReactNode } from 'react' import { ChallengeRewardID, - StringKeys, - audioRewardsPageActions, OptimisticUserChallenge -} from '@audius/common' +} from '@audius/common/models' +import { StringKeys } from '@audius/common/services' +import { audioRewardsPageActions } from '@audius/common/store' import { ButtonType, Button, IconArrow } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/WalletModal.tsx b/packages/web/src/pages/audio-rewards-page/WalletModal.tsx index d364ee36593..b2bf6bd2f9a 100644 --- a/packages/web/src/pages/audio-rewards-page/WalletModal.tsx +++ b/packages/web/src/pages/audio-rewards-page/WalletModal.tsx @@ -1,20 +1,15 @@ import { ReactNode, useCallback } from 'react' +import { Chain, StringWei, BNWei, WalletAddress } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - Chain, - BNWei, - StringWei, - WalletAddress, - Nullable, - FeatureFlags, - stringWeiToBN, - weiToString, accountSelectors, - tokenDashboardPageActions, - TokenDashboardPageModalState, tokenDashboardPageSelectors, - walletSelectors -} from '@audius/common' + tokenDashboardPageActions, + walletSelectors, + TokenDashboardPageModalState +} from '@audius/common/store' +import { stringWeiToBN, weiToString, Nullable } from '@audius/common/utils' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/ConnectWalletsBody.tsx b/packages/web/src/pages/audio-rewards-page/components/ConnectWalletsBody.tsx index 2acf0adbfcc..b2b5433514e 100644 --- a/packages/web/src/pages/audio-rewards-page/components/ConnectWalletsBody.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/ConnectWalletsBody.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' import { - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/DashboardTokenValueSlider.tsx b/packages/web/src/pages/audio-rewards-page/components/DashboardTokenValueSlider.tsx index 8a408ef7f77..31e599e4d3e 100644 --- a/packages/web/src/pages/audio-rewards-page/components/DashboardTokenValueSlider.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/DashboardTokenValueSlider.tsx @@ -1,4 +1,5 @@ -import { BNAudio, formatNumberCommas } from '@audius/common' +import { BNAudio } from '@audius/common/models' +import { formatNumberCommas } from '@audius/common/utils' import { TokenValueSlider } from '@audius/stems' import BN from 'bn.js' diff --git a/packages/web/src/pages/audio-rewards-page/components/DisplayAudio.tsx b/packages/web/src/pages/audio-rewards-page/components/DisplayAudio.tsx index dfe78b1ba02..6e8a31f0970 100644 --- a/packages/web/src/pages/audio-rewards-page/components/DisplayAudio.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/DisplayAudio.tsx @@ -1,4 +1,5 @@ -import { BNWei, formatWei } from '@audius/common' +import { BNWei } from '@audius/common/models' +import { formatWei } from '@audius/common/utils' import cn from 'classnames' import styles from './DisplayAudio.module.css' diff --git a/packages/web/src/pages/audio-rewards-page/components/ExplainerTile.tsx b/packages/web/src/pages/audio-rewards-page/components/ExplainerTile.tsx index 309b839f72e..c480707fae0 100644 --- a/packages/web/src/pages/audio-rewards-page/components/ExplainerTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/ExplainerTile.tsx @@ -1,6 +1,6 @@ import { ReactNode, useCallback, useEffect, useRef, useState } from 'react' -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import cn from 'classnames' import TokenStill from 'assets/img/tokenSpinStill.png' diff --git a/packages/web/src/pages/audio-rewards-page/components/ReceiveBody.tsx b/packages/web/src/pages/audio-rewards-page/components/ReceiveBody.tsx index a0f7613626b..fab27b43354 100644 --- a/packages/web/src/pages/audio-rewards-page/components/ReceiveBody.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/ReceiveBody.tsx @@ -1,9 +1,6 @@ -import { - SolanaWalletAddress, - WalletAddress, - FeatureFlags, - useCreateUserbankIfNeeded -} from '@audius/common' +import { useCreateUserbankIfNeeded } from '@audius/common/hooks' +import { WalletAddress, SolanaWalletAddress } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { Button, ButtonType, LogoSol } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/audio-rewards-page/components/RemoveWalletBody.tsx b/packages/web/src/pages/audio-rewards-page/components/RemoveWalletBody.tsx index a09576817d3..e01fd416ea0 100644 --- a/packages/web/src/pages/audio-rewards-page/components/RemoveWalletBody.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/RemoveWalletBody.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' import { - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/SendInputBody.tsx b/packages/web/src/pages/audio-rewards-page/components/SendInputBody.tsx index 8f3dfce4d88..7cf9b3e0771 100644 --- a/packages/web/src/pages/audio-rewards-page/components/SendInputBody.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/SendInputBody.tsx @@ -2,21 +2,25 @@ import { useCallback, useMemo, useState } from 'react' import { Chain, - BNAudio, - BNWei, - SolanaWalletAddress, - StringAudio, StringWei, + StringAudio, + BNWei, + BNAudio, WalletAddress, - Nullable, - FeatureFlags, + SolanaWalletAddress +} from '@audius/common/models' +import { IntKeys, - parseAudioInputToWei, - stringAudioToBN, - stringWeiToBN, - weiToAudio, + FeatureFlags, MIN_TRANSFERRABLE_WEI -} from '@audius/common' +} from '@audius/common/services' +import { + weiToAudio, + stringWeiToBN, + stringAudioToBN, + parseAudioInputToWei, + Nullable +} from '@audius/common/utils' import { Button, TokenValueInput, diff --git a/packages/web/src/pages/audio-rewards-page/components/SendInputConfirmation.tsx b/packages/web/src/pages/audio-rewards-page/components/SendInputConfirmation.tsx index 74e8f717e35..58b44c2afc4 100644 --- a/packages/web/src/pages/audio-rewards-page/components/SendInputConfirmation.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/SendInputConfirmation.tsx @@ -1,13 +1,8 @@ import { useEffect, useState } from 'react' -import { - BNWei, - StringAudio, - WalletAddress, - stringAudioToBN, - weiToAudio, - tokenDashboardPageSelectors -} from '@audius/common' +import { StringAudio, BNWei, WalletAddress } from '@audius/common/models' +import { tokenDashboardPageSelectors } from '@audius/common/store' +import { weiToAudio, stringAudioToBN } from '@audius/common/utils' import { Button, ButtonType, IconArrow } from '@audius/stems' import LoadingSpinner from 'components/loading-spinner/LoadingSpinner' diff --git a/packages/web/src/pages/audio-rewards-page/components/SendInputSuccess.tsx b/packages/web/src/pages/audio-rewards-page/components/SendInputSuccess.tsx index c484ecca8cb..b7d761d7c53 100644 --- a/packages/web/src/pages/audio-rewards-page/components/SendInputSuccess.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/SendInputSuccess.tsx @@ -1,4 +1,5 @@ -import { WalletAddress, BNWei, formatWei } from '@audius/common' +import { BNWei, WalletAddress } from '@audius/common/models' +import { formatWei } from '@audius/common/utils' import { ModalBodyTitle, ModalBodyWrapper } from '../WalletModal' diff --git a/packages/web/src/pages/audio-rewards-page/components/SendingModalBody.tsx b/packages/web/src/pages/audio-rewards-page/components/SendingModalBody.tsx index 9b7a223f328..7d67771fee1 100644 --- a/packages/web/src/pages/audio-rewards-page/components/SendingModalBody.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/SendingModalBody.tsx @@ -1,4 +1,4 @@ -import { BNWei, WalletAddress } from '@audius/common' +import { BNWei, WalletAddress } from '@audius/common/models' import cn from 'classnames' import LoadingSpinner from 'components/loading-spinner/LoadingSpinner' diff --git a/packages/web/src/pages/audio-rewards-page/components/TokenHoverTooltip.tsx b/packages/web/src/pages/audio-rewards-page/components/TokenHoverTooltip.tsx index f9961c1606a..9a17259773d 100644 --- a/packages/web/src/pages/audio-rewards-page/components/TokenHoverTooltip.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/TokenHoverTooltip.tsx @@ -1,6 +1,7 @@ import { ReactNode } from 'react' -import { BNWei, formatWei } from '@audius/common' +import { BNWei } from '@audius/common/models' +import { formatWei } from '@audius/common/utils' import Tooltip from 'components/tooltip/Tooltip' diff --git a/packages/web/src/pages/audio-rewards-page/components/WalletActionsTile.tsx b/packages/web/src/pages/audio-rewards-page/components/WalletActionsTile.tsx index 24fac85ec51..a441c498209 100644 --- a/packages/web/src/pages/audio-rewards-page/components/WalletActionsTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/WalletActionsTile.tsx @@ -1,9 +1,9 @@ +import { BNWei } from '@audius/common/models' import { - BNWei, - isNullOrUndefined, tokenDashboardPageActions, walletSelectors -} from '@audius/common' +} from '@audius/common/store' +import { isNullOrUndefined } from '@audius/common/utils' import { Button, ButtonType } from '@audius/stems' import BN from 'bn.js' import cn from 'classnames' diff --git a/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx b/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx index 31a133f9c39..4fe9b709dd2 100644 --- a/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx @@ -1,19 +1,15 @@ import { useCallback, useContext, useEffect, useMemo } from 'react' +import { Client, BNWei } from '@audius/common/models' +import { StringKeys, FeatureFlags, Location } from '@audius/common/services' import { - BNWei, + tokenDashboardPageSelectors, tokenDashboardPageActions, walletSelectors, - tokenDashboardPageSelectors, - formatWei, buyAudioActions, - OnRampProvider, - FeatureFlags, - StringKeys, - Client, - Location, - isNullOrUndefined -} from '@audius/common' + OnRampProvider +} from '@audius/common/store' +import { isNullOrUndefined, formatWei } from '@audius/common/utils' import { Button, ButtonType, IconInfo } from '@audius/stems' import BN from 'bn.js' import cn from 'classnames' diff --git a/packages/web/src/pages/audio-rewards-page/components/WalletsTable.tsx b/packages/web/src/pages/audio-rewards-page/components/WalletsTable.tsx index b06151c3a9a..bd881037faa 100644 --- a/packages/web/src/pages/audio-rewards-page/components/WalletsTable.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/WalletsTable.tsx @@ -1,13 +1,11 @@ import { useCallback, useContext, useEffect, MouseEvent } from 'react' +import { Chain, BNWei } from '@audius/common/models' import { - Chain, - BNWei, - shortenEthAddress, - shortenSPLAddress, - tokenDashboardPageActions, - tokenDashboardPageSelectors -} from '@audius/common' + tokenDashboardPageSelectors, + tokenDashboardPageActions +} from '@audius/common/store' +import { shortenSPLAddress, shortenEthAddress } from '@audius/common/utils' import { LogoEth, LogoSol } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/AudioBreakdownModal.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/AudioBreakdownModal.tsx index b9d0d239691..e6138f90f53 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/AudioBreakdownModal.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/AudioBreakdownModal.tsx @@ -1,8 +1,8 @@ +import { BNWei } from '@audius/common/models' import { - BNWei, tokenDashboardPageSelectors, walletSelectors -} from '@audius/common' +} from '@audius/common/store' import { IconInfo } from '@audius/stems' import BN from 'bn.js' diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/AudioMatchingRewardsModalContent.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/AudioMatchingRewardsModalContent.tsx index eedd2dbb9e0..bdf87b9adce 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/AudioMatchingRewardsModalContent.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/AudioMatchingRewardsModalContent.tsx @@ -1,13 +1,12 @@ import { ReactNode, useCallback } from 'react' +import { useAudioMatchingChallengeCooldownSchedule } from '@audius/common/hooks' +import { ChallengeName, OptimisticUserChallenge } from '@audius/common/models' +import { challengesSelectors } from '@audius/common/store' import { - ChallengeName, - OptimisticUserChallenge, - challengeRewardsConfig, formatNumberCommas, - useAudioMatchingChallengeCooldownSchedule, - challengesSelectors -} from '@audius/common' + challengeRewardsConfig +} from '@audius/common/utils' import { IconArrowRight, IconCloudUpload, Text } from '@audius/harmony' import { HarmonyButton, diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/ChallengeRewardsModal.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/ChallengeRewardsModal.tsx index f6c0884a8c1..6ebc543997b 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/ChallengeRewardsModal.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/ChallengeRewardsModal/ChallengeRewardsModal.tsx @@ -1,20 +1,22 @@ import { useCallback, useEffect, useContext, useMemo } from 'react' import { - fillString, - formatNumberCommas, accountSelectors, challengesSelectors, + audioRewardsPageSelectors, audioRewardsPageActions, - ChallengeRewardsModalType, ClaimStatus, - audioRewardsPageSelectors, - getAAOErrorEmojis, musicConfettiActions, + ChallengeRewardsModalType +} from '@audius/common/store' +import { + fillString, + formatNumberCommas, + getAAOErrorEmojis, challengeRewardsConfig, isAudioMatchingChallenge, getClaimableChallengeSpecifiers -} from '@audius/common' +} from '@audius/common/utils' import { Button, ButtonType, diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/HCaptchaModal.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/HCaptchaModal.tsx index b9861faa492..172d181bac5 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/HCaptchaModal.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/HCaptchaModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { audioRewardsPageActions, HCaptchaStatus } from '@audius/common' +import { audioRewardsPageActions, HCaptchaStatus } from '@audius/common/store' import HCaptcha from '@hcaptcha/react-hcaptcha' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx index fc4f2ec70b4..33852567a8d 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx @@ -1,12 +1,12 @@ import { useCallback, useEffect, useState } from 'react' +import { Theme } from '@audius/common/models' +import { StringKeys } from '@audius/common/services' import { - Theme, - StringKeys, + audioRewardsPageSelectors, audioRewardsPageActions, - TrendingRewardsModalType, - audioRewardsPageSelectors -} from '@audius/common' + TrendingRewardsModalType +} from '@audius/common/store' import { SegmentedControl, ButtonType, Button, IconArrow } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/VipDiscordModal.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/VipDiscordModal.tsx index 81df51ce244..dbdac04e6b0 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/VipDiscordModal.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/VipDiscordModal.tsx @@ -1,4 +1,4 @@ -import { vipDiscordModalSelectors } from '@audius/common' +import { vipDiscordModalSelectors } from '@audius/common/store' import { Button, ButtonType, IconDiscord } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/pages/audio-rewards-page/config.tsx b/packages/web/src/pages/audio-rewards-page/config.tsx index 202ad831186..c74b0eb5811 100644 --- a/packages/web/src/pages/audio-rewards-page/config.tsx +++ b/packages/web/src/pages/audio-rewards-page/config.tsx @@ -1,11 +1,7 @@ import { ReactNode } from 'react' -import { - ChallengeName, - ChallengeRewardID, - Nullable, - challengeRewardsConfig -} from '@audius/common' +import { ChallengeName, ChallengeRewardID } from '@audius/common/models' +import { challengeRewardsConfig, Nullable } from '@audius/common/utils' import { IconArrow, IconCheck, IconUpload } from '@audius/stems' import IconGoldBadge from 'assets/img/tokenBadgeGold40@2x.png' diff --git a/packages/web/src/pages/audio-transactions-page/AudioTransactionsPage.tsx b/packages/web/src/pages/audio-transactions-page/AudioTransactionsPage.tsx index b0fe9e300f3..dec6617ceed 100644 --- a/packages/web/src/pages/audio-transactions-page/AudioTransactionsPage.tsx +++ b/packages/web/src/pages/audio-transactions-page/AudioTransactionsPage.tsx @@ -6,14 +6,14 @@ import { useLayoutEffect } from 'react' +import { statusIsNotFinalized } from '@audius/common/models' import { - TransactionDetails, - TransactionType, - audioTransactionsPageActions, audioTransactionsPageSelectors, + audioTransactionsPageActions, transactionDetailsActions, - statusIsNotFinalized -} from '@audius/common' + TransactionType, + TransactionDetails +} from '@audius/common/store' import { full } from '@audius/sdk' import { IconCaretRight } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/chat-page/ChatPage.tsx b/packages/web/src/pages/chat-page/ChatPage.tsx index 3d1c17c6835..2e2bbe79a38 100644 --- a/packages/web/src/pages/chat-page/ChatPage.tsx +++ b/packages/web/src/pages/chat-page/ChatPage.tsx @@ -1,11 +1,8 @@ import { useCallback, useEffect, useRef } from 'react' -import { - chatActions, - FeatureFlags, - useCanSendMessage, - chatSelectors -} from '@audius/common' +import { useCanSendMessage } from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' +import { chatActions, chatSelectors } from '@audius/common/store' import { ResizeObserver } from '@juggle/resize-observer' import { push as pushRoute } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/chat-page/components/BlockUserConfirmationModal.tsx b/packages/web/src/pages/chat-page/components/BlockUserConfirmationModal.tsx index c011c51c310..980238d5e6f 100644 --- a/packages/web/src/pages/chat-page/components/BlockUserConfirmationModal.tsx +++ b/packages/web/src/pages/chat-page/components/BlockUserConfirmationModal.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { User, chatActions, Name } from '@audius/common' +import { Name, User } from '@audius/common/models' +import { chatActions } from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/pages/chat-page/components/ChatComposer.tsx b/packages/web/src/pages/chat-page/components/ChatComposer.tsx index 8ec61b7bad9..a9b0143ffda 100644 --- a/packages/web/src/pages/chat-page/components/ChatComposer.tsx +++ b/packages/web/src/pages/chat-page/components/ChatComposer.tsx @@ -8,7 +8,7 @@ import { useEffect } from 'react' -import { chatActions } from '@audius/common' +import { chatActions } from '@audius/common/store' import { IconButton, IconSend } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/chat-page/components/ChatHeader.tsx b/packages/web/src/pages/chat-page/components/ChatHeader.tsx index aa18e7159d4..ec28e871e8a 100644 --- a/packages/web/src/pages/chat-page/components/ChatHeader.tsx +++ b/packages/web/src/pages/chat-page/components/ChatHeader.tsx @@ -1,11 +1,8 @@ import { forwardRef, useCallback, useState } from 'react' -import { - useProxySelector, - chatSelectors, - User, - useCreateChatModal -} from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import { User } from '@audius/common/models' +import { chatSelectors, useCreateChatModal } from '@audius/common/store' import { IconButton, IconCompose, diff --git a/packages/web/src/pages/chat-page/components/ChatList.tsx b/packages/web/src/pages/chat-page/components/ChatList.tsx index c80aed7b550..d10f13cdfa0 100644 --- a/packages/web/src/pages/chat-page/components/ChatList.tsx +++ b/packages/web/src/pages/chat-page/components/ChatList.tsx @@ -5,7 +5,8 @@ import { useState } from 'react' -import { chatSelectors, chatActions, Status } from '@audius/common' +import { Status } from '@audius/common/models' +import { chatActions, chatSelectors } from '@audius/common/store' import cn from 'classnames' import InfiniteScroll from 'react-infinite-scroller' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/chat-page/components/ChatListItem.tsx b/packages/web/src/pages/chat-page/components/ChatListItem.tsx index 2f5326249d7..144c7090628 100644 --- a/packages/web/src/pages/chat-page/components/ChatListItem.tsx +++ b/packages/web/src/pages/chat-page/components/ChatListItem.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { chatSelectors, useProxySelector } from '@audius/common' +import { useProxySelector } from '@audius/common/hooks' +import { chatSelectors } from '@audius/common/store' import type { UserChat } from '@audius/sdk' import cn from 'classnames' diff --git a/packages/web/src/pages/chat-page/components/ChatMessageList.tsx b/packages/web/src/pages/chat-page/components/ChatMessageList.tsx index 07c4c9d5029..1ec0e6cb7e8 100644 --- a/packages/web/src/pages/chat-page/components/ChatMessageList.tsx +++ b/packages/web/src/pages/chat-page/components/ChatMessageList.tsx @@ -11,17 +11,19 @@ import { useMemo } from 'react' +import { useCanSendMessage } from '@audius/common/hooks' +import { Status } from '@audius/common/models' import { accountSelectors, chatActions, - chatSelectors, + chatSelectors +} from '@audius/common/store' +import { encodeHashId, - Status, hasTail, isEarliestUnread, - chatCanFetchMoreMessages, - useCanSendMessage -} from '@audius/common' + chatCanFetchMoreMessages +} from '@audius/common/utils' import { ResizeObserver } from '@juggle/resize-observer' import cn from 'classnames' import { throttle } from 'lodash' diff --git a/packages/web/src/pages/chat-page/components/ChatMessageListItem.tsx b/packages/web/src/pages/chat-page/components/ChatMessageListItem.tsx index a74ef478094..dc1065e0cf7 100644 --- a/packages/web/src/pages/chat-page/components/ChatMessageListItem.tsx +++ b/packages/web/src/pages/chat-page/components/ChatMessageListItem.tsx @@ -1,20 +1,20 @@ import { useCallback, useRef, useState } from 'react' +import { useProxySelector, useCanSendMessage } from '@audius/common/hooks' +import { Status, ChatMessageWithExtras } from '@audius/common/models' import { accountSelectors, cacheUsersSelectors, chatActions, + ReactionTypes +} from '@audius/common/store' +import { + formatMessageDate, decodeHashId, encodeHashId, - ReactionTypes, - useProxySelector, - formatMessageDate, - isTrackUrl, isCollectionUrl, - ChatMessageWithExtras, - Status, - useCanSendMessage -} from '@audius/common' + isTrackUrl +} from '@audius/common/utils' import { IconError, IconPlus, PopupPosition } from '@audius/stems' import cn from 'classnames' import { find } from 'linkifyjs' diff --git a/packages/web/src/pages/chat-page/components/ChatMessagePlaylist.tsx b/packages/web/src/pages/chat-page/components/ChatMessagePlaylist.tsx index 45862a1807f..fe137ddede0 100644 --- a/packages/web/src/pages/chat-page/components/ChatMessagePlaylist.tsx +++ b/packages/web/src/pages/chat-page/components/ChatMessagePlaylist.tsx @@ -1,25 +1,21 @@ import { useCallback, useMemo, useEffect } from 'react' import { - Kind, - Status, - makeUid, - ID, - QueueSource, - playerSelectors, - getPathFromPlaylistUrl, - accountSelectors, useGetTracksByIds, - usePlayTrack, - usePauseTrack, - ChatMessageTileProps, - SquareSizes, + useGetPlaylistByPermalink +} from '@audius/common/api' +import { usePlayTrack, usePauseTrack } from '@audius/common/hooks' +import { Name, SquareSizes, Kind, Status, ID } from '@audius/common/models' +import { + accountSelectors, cacheCollectionsActions, cacheCollectionsSelectors, - CommonState, - Name, - useGetPlaylistByPermalink -} from '@audius/common' + QueueSource, + playerSelectors, + ChatMessageTileProps, + CommonState +} from '@audius/common/store' +import { getPathFromPlaylistUrl, makeUid } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/pages/chat-page/components/ChatMessageTrack.tsx b/packages/web/src/pages/chat-page/components/ChatMessageTrack.tsx index 222a48b4e23..de2475ad699 100644 --- a/packages/web/src/pages/chat-page/components/ChatMessageTrack.tsx +++ b/packages/web/src/pages/chat-page/components/ChatMessageTrack.tsx @@ -1,23 +1,26 @@ import { useCallback, useEffect, useMemo } from 'react' +import { useGetTrackByPermalink } from '@audius/common/api' import { + TrackPlayback, + useGatedContentAccess, + useToggleTrack +} from '@audius/common/hooks' +import { + Name, + PlaybackSource, + SquareSizes, Kind, Status, - makeUid, - PlaybackSource, - QueueSource, + ID +} from '@audius/common/models' +import { accountSelectors, - useGetTrackByPermalink, - getPathFromTrackUrl, - useToggleTrack, - ID, - TrackPlayback, - ChatMessageTileProps, cacheTracksActions, - SquareSizes, - Name, - useGatedContentAccess -} from '@audius/common' + QueueSource, + ChatMessageTileProps +} from '@audius/common/store' +import { getPathFromTrackUrl, makeUid } from '@audius/common/utils' import { useDispatch, useSelector } from 'react-redux' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/pages/chat-page/components/ChatUser.tsx b/packages/web/src/pages/chat-page/components/ChatUser.tsx index 7c30ef4aa67..f83bdbd806e 100644 --- a/packages/web/src/pages/chat-page/components/ChatUser.tsx +++ b/packages/web/src/pages/chat-page/components/ChatUser.tsx @@ -1,6 +1,6 @@ import { ReactNode, useCallback } from 'react' -import { User } from '@audius/common' +import { User } from '@audius/common/models' import cn from 'classnames' import { ArtistPopover } from 'components/artist/ArtistPopover' diff --git a/packages/web/src/pages/chat-page/components/CreateChatModal.tsx b/packages/web/src/pages/chat-page/components/CreateChatModal.tsx index e5f48ed9075..c989605a537 100644 --- a/packages/web/src/pages/chat-page/components/CreateChatModal.tsx +++ b/packages/web/src/pages/chat-page/components/CreateChatModal.tsx @@ -1,19 +1,19 @@ import { useCallback, useEffect } from 'react' +import { User } from '@audius/common/models' import { accountSelectors, chatActions, + chatSelectors, + searchUsersModalActions, + useCreateChatModal, + createChatModalActions, + useInboxUnavailableModal, userListActions, - FOLLOWERS_USER_LIST_TAG, followersUserListActions, followersUserListSelectors, - User, - useCreateChatModal, - useInboxUnavailableModal, - createChatModalActions, - searchUsersModalActions, - chatSelectors -} from '@audius/common' + FOLLOWERS_USER_LIST_TAG +} from '@audius/common/store' import { IconCompose } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/chat-page/components/CreateChatPrompt.tsx b/packages/web/src/pages/chat-page/components/CreateChatPrompt.tsx index 70bdf994104..9be8250b0ff 100644 --- a/packages/web/src/pages/chat-page/components/CreateChatPrompt.tsx +++ b/packages/web/src/pages/chat-page/components/CreateChatPrompt.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatSelectors, useCreateChatModal } from '@audius/common' +import { chatSelectors, useCreateChatModal } from '@audius/common/store' import { Button, ButtonType, IconCompose } from '@audius/stems' import { useSelector } from 'common/hooks/useSelector' diff --git a/packages/web/src/pages/chat-page/components/CreateChatUserResult.tsx b/packages/web/src/pages/chat-page/components/CreateChatUserResult.tsx index bd2142c9861..1bfab929a4a 100644 --- a/packages/web/src/pages/chat-page/components/CreateChatUserResult.tsx +++ b/packages/web/src/pages/chat-page/components/CreateChatUserResult.tsx @@ -1,15 +1,15 @@ import { useCallback, useEffect } from 'react' +import { User } from '@audius/common/models' import { accountSelectors, chatActions, - ChatPermissionAction, chatSelectors, - removeNullable, - tippingActions, + ChatPermissionAction, tippingSelectors, - User -} from '@audius/common' + tippingActions +} from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { IconBlockMessages, IconButton, diff --git a/packages/web/src/pages/chat-page/components/DeleteChatConfirmationModal.tsx b/packages/web/src/pages/chat-page/components/DeleteChatConfirmationModal.tsx index b03d318e594..1a162c03467 100644 --- a/packages/web/src/pages/chat-page/components/DeleteChatConfirmationModal.tsx +++ b/packages/web/src/pages/chat-page/components/DeleteChatConfirmationModal.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { chatActions } from '@audius/common' +import { chatActions } from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/pages/chat-page/components/InboxUnavailableMessage.tsx b/packages/web/src/pages/chat-page/components/InboxUnavailableMessage.tsx index 63e98184e1b..ad4389d11bd 100644 --- a/packages/web/src/pages/chat-page/components/InboxUnavailableMessage.tsx +++ b/packages/web/src/pages/chat-page/components/InboxUnavailableMessage.tsx @@ -1,6 +1,8 @@ import { useState, useCallback, MouseEventHandler } from 'react' -import { User, ChatPermissionAction, CHAT_BLOG_POST_URL } from '@audius/common' +import { User } from '@audius/common/models' +import { ChatPermissionAction } from '@audius/common/store' +import { CHAT_BLOG_POST_URL } from '@audius/common/utils' import { UserNameAndBadges } from 'components/user-name-and-badges/UserNameAndBadges' diff --git a/packages/web/src/pages/chat-page/components/LinkPreview.tsx b/packages/web/src/pages/chat-page/components/LinkPreview.tsx index 9f33105d5e2..0e5e0c4113b 100644 --- a/packages/web/src/pages/chat-page/components/LinkPreview.tsx +++ b/packages/web/src/pages/chat-page/components/LinkPreview.tsx @@ -1,10 +1,8 @@ import { MouseEventHandler, useCallback, useEffect } from 'react' -import { - isAudiusUrl, - useLinkUnfurlMetadata, - useLeavingAudiusModal -} from '@audius/common' +import { useLinkUnfurlMetadata } from '@audius/common/hooks' +import { useLeavingAudiusModal } from '@audius/common/store' +import { isAudiusUrl } from '@audius/common/utils' import cn from 'classnames' import styles from './LinkPreview.module.css' diff --git a/packages/web/src/pages/chat-page/components/ReactionPopupMenu.tsx b/packages/web/src/pages/chat-page/components/ReactionPopupMenu.tsx index 43b6a9fc0da..7be64457ad7 100644 --- a/packages/web/src/pages/chat-page/components/ReactionPopupMenu.tsx +++ b/packages/web/src/pages/chat-page/components/ReactionPopupMenu.tsx @@ -1,6 +1,6 @@ import { ComponentType, MutableRefObject } from 'react' -import { reactionOrder, ReactionTypes } from '@audius/common' +import { reactionOrder, ReactionTypes } from '@audius/common/store' import { Popup, PopupPosition } from '@audius/stems' import { diff --git a/packages/web/src/pages/chat-page/components/UnblockUserConfirmationModal.tsx b/packages/web/src/pages/chat-page/components/UnblockUserConfirmationModal.tsx index 5e46aa9de3d..7ee7dff5d0d 100644 --- a/packages/web/src/pages/chat-page/components/UnblockUserConfirmationModal.tsx +++ b/packages/web/src/pages/chat-page/components/UnblockUserConfirmationModal.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' -import { User, chatActions } from '@audius/common' +import { User } from '@audius/common/models' +import { chatActions } from '@audius/common/store' import { Button, ButtonType, diff --git a/packages/web/src/pages/check-page/CheckPage.tsx b/packages/web/src/pages/check-page/CheckPage.tsx index b7d8adac9d8..b6d4348bb7c 100644 --- a/packages/web/src/pages/check-page/CheckPage.tsx +++ b/packages/web/src/pages/check-page/CheckPage.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' -import { accountSelectors, Status } from '@audius/common' +import { Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/collectibles-playlist-page/CollectiblesPlaylistPageProvider.tsx b/packages/web/src/pages/collectibles-playlist-page/CollectiblesPlaylistPageProvider.tsx index 9de9fa78b0d..9d4f7cf70b9 100644 --- a/packages/web/src/pages/collectibles-playlist-page/CollectiblesPlaylistPageProvider.tsx +++ b/packages/web/src/pages/collectibles-playlist-page/CollectiblesPlaylistPageProvider.tsx @@ -10,24 +10,25 @@ import { import { ShareSource, Chain, + SmartCollectionVariant, + Status, Collectible, Collection, SmartCollection, - SmartCollectionVariant, - Status, - User, - formatSeconds, + User +} from '@audius/common/models' +import { cacheUsersSelectors, profilePageActions, - CollectionTrack, - CollectionPageTrackRecord, queueActions, QueueSource, collectibleDetailsUIActions, shareModalUIActions, playerSelectors, - getHash -} from '@audius/common' + CollectionTrack, + CollectionPageTrackRecord +} from '@audius/common/store' +import { getHash, formatSeconds } from '@audius/common/utils' import cn from 'classnames' import { push } from 'connected-react-router' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/collection-page/CollectionPage.tsx b/packages/web/src/pages/collection-page/CollectionPage.tsx index 99921fa2065..a4d6bf63b5a 100644 --- a/packages/web/src/pages/collection-page/CollectionPage.tsx +++ b/packages/web/src/pages/collection-page/CollectionPage.tsx @@ -1,4 +1,5 @@ -import { SmartCollection, CollectionsPageType } from '@audius/common' +import { SmartCollection } from '@audius/common/models' +import { CollectionsPageType } from '@audius/common/store' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/pages/collection-page/CollectionPageProvider.tsx b/packages/web/src/pages/collection-page/CollectionPageProvider.tsx index 0bb3b4c4a59..fddaafd8677 100644 --- a/packages/web/src/pages/collection-page/CollectionPageProvider.tsx +++ b/packages/web/src/pages/collection-page/CollectionPageProvider.tsx @@ -1,48 +1,48 @@ import { ChangeEvent, Component, ComponentType } from 'react' import { - ID, - UID, - PlayableType, - RepostSource, - FavoriteSource, Name, - PlaybackSource, ShareSource, + RepostSource, + FavoriteSource, FollowSource, - Collection, - SmartCollection, + PlaybackSource, FavoriteType, + PlayableType, Kind, Status, - Nullable, - Uid, - formatUrlName, + Collection, + SmartCollection, + ID, + UID +} from '@audius/common/models' +import { accountSelectors, cacheCollectionsActions, lineupSelectors, - collectionPageActions as collectionActions, collectionPageLineupActions as tracksActions, collectionPageSelectors, - CollectionPageTrackRecord, - CollectionTrack, - CollectionsPageType, - OverflowAction, - OverflowSource, + collectionPageActions as collectionActions, + queueSelectors, + collectionsSocialActions as socialCollectionsActions, + tracksSocialActions as socialTracksActions, + usersSocialActions as socialUsersActions, mobileOverflowMenuUIActions, shareModalUIActions, - RepostType, + OverflowAction, + OverflowSource, + editPlaylistModalActions, repostsUserListActions, favoritesUserListActions, - collectionsSocialActions as socialCollectionsActions, - tracksSocialActions as socialTracksActions, - usersSocialActions as socialUsersActions, + RepostType, playerSelectors, - queueSelectors, playlistUpdatesActions, playlistUpdatesSelectors, - editPlaylistModalActions -} from '@audius/common' + CollectionTrack, + CollectionsPageType, + CollectionPageTrackRecord +} from '@audius/common/store' +import { formatUrlName, Uid, Nullable } from '@audius/common/utils' import { push as pushRoute, replace } from 'connected-react-router' import { UnregisterCallback } from 'history' import { connect } from 'react-redux' diff --git a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx index 434ccd0efa7..70452915d27 100644 --- a/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx +++ b/packages/web/src/pages/collection-page/components/desktop/CollectionPage.tsx @@ -1,18 +1,20 @@ import { ChangeEvent, useMemo } from 'react' import { - ID, - Collection, - SmartCollection, Variant, + DogEarType, Status, - User, + Collection, + SmartCollection, + ID, + User +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { CollectionTrack, - CollectionPageTrackRecord, CollectionsPageType, - DogEarType, - FeatureFlags -} from '@audius/common' + CollectionPageTrackRecord +} from '@audius/common/store' import { CollectiblesPlaylistTableColumn, diff --git a/packages/web/src/pages/collection-page/components/mobile/CollectionPage.tsx b/packages/web/src/pages/collection-page/components/mobile/CollectionPage.tsx index 9cd8108fffb..eb31380ed98 100644 --- a/packages/web/src/pages/collection-page/components/mobile/CollectionPage.tsx +++ b/packages/web/src/pages/collection-page/components/mobile/CollectionPage.tsx @@ -1,18 +1,20 @@ import { memo, useEffect, useContext } from 'react' +import { useGatedContentAccessMap } from '@audius/common/hooks' import { - ID, - Collection, - SmartCollection, Variant, SmartCollectionVariant, Status, - User, - CollectionsPageType, - CollectionTrack, + Collection, + SmartCollection, + ID, + User +} from '@audius/common/models' +import { OverflowAction, - useGatedContentAccessMap -} from '@audius/common' + CollectionTrack, + CollectionsPageType +} from '@audius/common/store' import CollectionHeader from 'components/collection/mobile/CollectionHeader' import { HeaderContext } from 'components/header/mobile/HeaderContextProvider' diff --git a/packages/web/src/pages/collection-page/store/utils.ts b/packages/web/src/pages/collection-page/store/utils.ts index a71b979f756..ee7670a9f9f 100644 --- a/packages/web/src/pages/collection-page/store/utils.ts +++ b/packages/web/src/pages/collection-page/store/utils.ts @@ -1,4 +1,4 @@ -import { Collection, SmartCollection, Variant } from '@audius/common' +import { Variant, Collection, SmartCollection } from '@audius/common/models' export const computeCollectionMetadataProps = ( metadata: Collection | SmartCollection | null diff --git a/packages/web/src/pages/dashboard-page/DashboardPage.tsx b/packages/web/src/pages/dashboard-page/DashboardPage.tsx index 7bad31e0941..3e5713fd060 100644 --- a/packages/web/src/pages/dashboard-page/DashboardPage.tsx +++ b/packages/web/src/pages/dashboard-page/DashboardPage.tsx @@ -1,6 +1,8 @@ import { useState, Suspense, ReactNode, useEffect, useCallback } from 'react' -import { Status, Track, formatCount, themeSelectors } from '@audius/common' +import { Status, Track } from '@audius/common/models' +import { themeSelectors } from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import cn from 'classnames' import { each } from 'lodash' import moment, { Moment } from 'moment' diff --git a/packages/web/src/pages/dashboard-page/components/ArtistCard.tsx b/packages/web/src/pages/dashboard-page/components/ArtistCard.tsx index e0e709385cc..e6d2f4c8cdb 100644 --- a/packages/web/src/pages/dashboard-page/components/ArtistCard.tsx +++ b/packages/web/src/pages/dashboard-page/components/ArtistCard.tsx @@ -1,4 +1,4 @@ -import { ID, SquareSizes, WidthSizes } from '@audius/common' +import { SquareSizes, WidthSizes, ID } from '@audius/common/models' import DynamicImage from 'components/dynamic-image/DynamicImage' import { Text } from 'components/typography' diff --git a/packages/web/src/pages/dashboard-page/components/TotalPlaysChart.jsx b/packages/web/src/pages/dashboard-page/components/TotalPlaysChart.jsx index b9ee8fff4a5..b827b3e094e 100644 --- a/packages/web/src/pages/dashboard-page/components/TotalPlaysChart.jsx +++ b/packages/web/src/pages/dashboard-page/components/TotalPlaysChart.jsx @@ -1,6 +1,7 @@ import { createRef, Component } from 'react' -import { Theme, formatCount } from '@audius/common' +import { Theme } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import moment from 'moment' import numeral from 'numeral' import PropTypes from 'prop-types' diff --git a/packages/web/src/pages/dashboard-page/components/TracksTableContainer.tsx b/packages/web/src/pages/dashboard-page/components/TracksTableContainer.tsx index 230eb6e0aa5..ece2a7ad817 100644 --- a/packages/web/src/pages/dashboard-page/components/TracksTableContainer.tsx +++ b/packages/web/src/pages/dashboard-page/components/TracksTableContainer.tsx @@ -1,6 +1,11 @@ import { useState, useCallback, useMemo } from 'react' -import { Status, User, Track, isContentUSDCPurchaseGated } from '@audius/common' +import { + Status, + isContentUSDCPurchaseGated, + Track, + User +} from '@audius/common/models' import { SelectablePill } from '@audius/harmony' import { IconHidden, diff --git a/packages/web/src/pages/dashboard-page/store/sagas.ts b/packages/web/src/pages/dashboard-page/store/sagas.ts index c832614ede3..a59dec45c0c 100644 --- a/packages/web/src/pages/dashboard-page/store/sagas.ts +++ b/packages/web/src/pages/dashboard-page/store/sagas.ts @@ -1,14 +1,11 @@ +import { Collection, ID, Track } from '@audius/common/models' +import { IntKeys } from '@audius/common/services' import { - IntKeys, accountSelectors, walletActions, - doEvery, - waitForValue, - ID, - getContext, - Collection, - Track -} from '@audius/common' + getContext +} from '@audius/common/store' +import { waitForValue, doEvery } from '@audius/common/utils' import { each } from 'lodash' import moment from 'moment' import { EventChannel } from 'redux-saga' diff --git a/packages/web/src/pages/dashboard-page/store/selectors.ts b/packages/web/src/pages/dashboard-page/store/selectors.ts index 05a45465c51..189529b0289 100644 --- a/packages/web/src/pages/dashboard-page/store/selectors.ts +++ b/packages/web/src/pages/dashboard-page/store/selectors.ts @@ -1,4 +1,4 @@ -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { createSelector } from 'reselect' import { AppState } from 'store/types' diff --git a/packages/web/src/pages/dashboard-page/store/slice.ts b/packages/web/src/pages/dashboard-page/store/slice.ts index 520b767a393..35c1b2eff01 100644 --- a/packages/web/src/pages/dashboard-page/store/slice.ts +++ b/packages/web/src/pages/dashboard-page/store/slice.ts @@ -1,4 +1,4 @@ -import { Collection, ID, Status, Track } from '@audius/common' +import { Status, Collection, ID, Track } from '@audius/common/models' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import ArtistDashboardState from './types' diff --git a/packages/web/src/pages/dashboard-page/store/types.ts b/packages/web/src/pages/dashboard-page/store/types.ts index 3cb2c54c6f2..62d1c59fd1a 100644 --- a/packages/web/src/pages/dashboard-page/store/types.ts +++ b/packages/web/src/pages/dashboard-page/store/types.ts @@ -1,4 +1,5 @@ -import { Status, Collection, Track, Nullable } from '@audius/common' +import { Status, Collection, Track } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' export default interface ArtistDashboardState { status: Status diff --git a/packages/web/src/pages/deactivate-account-page/DeactivateAccountPage.tsx b/packages/web/src/pages/deactivate-account-page/DeactivateAccountPage.tsx index fb4e6f9f417..6ea2f29b538 100644 --- a/packages/web/src/pages/deactivate-account-page/DeactivateAccountPage.tsx +++ b/packages/web/src/pages/deactivate-account-page/DeactivateAccountPage.tsx @@ -1,11 +1,10 @@ import { ReactNode, useCallback, useEffect } from 'react' +import { Name, Status } from '@audius/common/models' import { deactivateAccountActions, - deactivateAccountSelectors, - Name, - Status -} from '@audius/common' + deactivateAccountSelectors +} from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' diff --git a/packages/web/src/pages/deleted-page/DeletedPage.tsx b/packages/web/src/pages/deleted-page/DeletedPage.tsx index 36deef2c375..28ecdd9a401 100644 --- a/packages/web/src/pages/deleted-page/DeletedPage.tsx +++ b/packages/web/src/pages/deleted-page/DeletedPage.tsx @@ -1,4 +1,4 @@ -import { Playable, User } from '@audius/common' +import { Playable, User } from '@audius/common/models' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/pages/deleted-page/DeletedPageProvider.tsx b/packages/web/src/pages/deleted-page/DeletedPageProvider.tsx index 3fb59145c96..7b049b9a040 100644 --- a/packages/web/src/pages/deleted-page/DeletedPageProvider.tsx +++ b/packages/web/src/pages/deleted-page/DeletedPageProvider.tsx @@ -1,12 +1,11 @@ import { useEffect, useCallback, ComponentType } from 'react' +import { Playable, User } from '@audius/common/models' import { - Playable, - User, lineupSelectors, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/pages/deleted-page/components/desktop/DeletedPage.tsx b/packages/web/src/pages/deleted-page/components/desktop/DeletedPage.tsx index 87d5f3f9426..01f52c52f7e 100644 --- a/packages/web/src/pages/deleted-page/components/desktop/DeletedPage.tsx +++ b/packages/web/src/pages/deleted-page/components/desktop/DeletedPage.tsx @@ -1,12 +1,12 @@ import { - ID, PlayableType, - CoverArtSizes, SquareSizes, + ID, + CoverArtSizes, Playable, - User, - NestedNonNullable -} from '@audius/common' + User +} from '@audius/common/models' +import { NestedNonNullable } from '@audius/common/utils' import { Button, ButtonType, IconUser } from '@audius/stems' import { ArtistPopover } from 'components/artist/ArtistPopover' diff --git a/packages/web/src/pages/deleted-page/components/mobile/DeletedPage.tsx b/packages/web/src/pages/deleted-page/components/mobile/DeletedPage.tsx index a1a901e4c3b..1bcb1b6e8f1 100644 --- a/packages/web/src/pages/deleted-page/components/mobile/DeletedPage.tsx +++ b/packages/web/src/pages/deleted-page/components/mobile/DeletedPage.tsx @@ -1,12 +1,12 @@ import { - ID, PlayableType, - CoverArtSizes, SquareSizes, + ID, + CoverArtSizes, Playable, - User, - NestedNonNullable -} from '@audius/common' + User +} from '@audius/common/models' +import { NestedNonNullable } from '@audius/common/utils' import { Button, ButtonType, IconUser } from '@audius/stems' import { ArtistPopover } from 'components/artist/ArtistPopover' diff --git a/packages/web/src/pages/deleted-page/store/lineups/more-by/actions.ts b/packages/web/src/pages/deleted-page/store/lineups/more-by/actions.ts index 53a4d1f3c33..87e80529428 100644 --- a/packages/web/src/pages/deleted-page/store/lineups/more-by/actions.ts +++ b/packages/web/src/pages/deleted-page/store/lineups/more-by/actions.ts @@ -1,4 +1,4 @@ -import { LineupBaseActions } from '@audius/common' +import { LineupBaseActions } from '@audius/common/store' export const PREFIX = 'DELETED_PAGE_MORE_BY' diff --git a/packages/web/src/pages/deleted-page/store/lineups/more-by/reducer.ts b/packages/web/src/pages/deleted-page/store/lineups/more-by/reducer.ts index b18b57b38e4..12d3ed79650 100644 --- a/packages/web/src/pages/deleted-page/store/lineups/more-by/reducer.ts +++ b/packages/web/src/pages/deleted-page/store/lineups/more-by/reducer.ts @@ -1,9 +1,5 @@ -import { - LineupState, - Track, - lineupActions, - lineupReducer -} from '@audius/common' +import { LineupState, Track } from '@audius/common/models' +import { lineupActions, lineupReducer } from '@audius/common/store' import { PREFIX } from 'pages/deleted-page/store/lineups/more-by/actions' const { initialLineupState } = lineupReducer diff --git a/packages/web/src/pages/deleted-page/store/lineups/more-by/sagas.ts b/packages/web/src/pages/deleted-page/store/lineups/more-by/sagas.ts index 1b02a303a56..ead0e60369c 100644 --- a/packages/web/src/pages/deleted-page/store/lineups/more-by/sagas.ts +++ b/packages/web/src/pages/deleted-page/store/lineups/more-by/sagas.ts @@ -1,4 +1,5 @@ -import { Track, accountSelectors } from '@audius/common' +import { Track } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { call, select } from 'typed-redux-saga' import { LineupSagas } from 'common/store/lineup/sagas' diff --git a/packages/web/src/pages/deleted-page/store/slice.ts b/packages/web/src/pages/deleted-page/store/slice.ts index 3040ee52072..1f167658a0a 100644 --- a/packages/web/src/pages/deleted-page/store/slice.ts +++ b/packages/web/src/pages/deleted-page/store/slice.ts @@ -1,4 +1,4 @@ -import { lineupReducer } from '@audius/common' +import { lineupReducer } from '@audius/common/store' import { createSlice } from '@reduxjs/toolkit' import { combineReducers } from 'redux' diff --git a/packages/web/src/pages/demo-trpc/DemoTrpcPage.tsx b/packages/web/src/pages/demo-trpc/DemoTrpcPage.tsx index a19ffb73938..6e746dc2687 100644 --- a/packages/web/src/pages/demo-trpc/DemoTrpcPage.tsx +++ b/packages/web/src/pages/demo-trpc/DemoTrpcPage.tsx @@ -1,6 +1,6 @@ import { CSSProperties, Suspense, useMemo, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { RouterInput } from '@audius/trpc-server' import { useSelector } from 'react-redux' import { create } from 'zustand' diff --git a/packages/web/src/pages/explore-page/ExploreCollectionsPage.tsx b/packages/web/src/pages/explore-page/ExploreCollectionsPage.tsx index 875b72619f7..28ca5e43795 100644 --- a/packages/web/src/pages/explore-page/ExploreCollectionsPage.tsx +++ b/packages/web/src/pages/explore-page/ExploreCollectionsPage.tsx @@ -1,4 +1,4 @@ -import { ExploreCollectionsVariant } from '@audius/common' +import { ExploreCollectionsVariant } from '@audius/common/store' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/pages/explore-page/ExploreCollectionsPageProvider.tsx b/packages/web/src/pages/explore-page/ExploreCollectionsPageProvider.tsx index 5daeb7c6dbc..28b1d6c063b 100644 --- a/packages/web/src/pages/explore-page/ExploreCollectionsPageProvider.tsx +++ b/packages/web/src/pages/explore-page/ExploreCollectionsPageProvider.tsx @@ -1,15 +1,14 @@ import { useEffect, useState, useCallback, ComponentType } from 'react' +import { FavoriteType, ID } from '@audius/common/models' import { - ID, - FavoriteType, - ExploreCollectionsVariant, explorePageCollectionsSelectors, explorePageCollectionsActions, - RepostType, + ExploreCollectionsVariant, repostsUserListActions, - favoritesUserListActions -} from '@audius/common' + favoritesUserListActions, + RepostType +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { matchPath } from 'react-router' diff --git a/packages/web/src/pages/explore-page/ExplorePage.tsx b/packages/web/src/pages/explore-page/ExplorePage.tsx index f95dc8ac585..94390469032 100644 --- a/packages/web/src/pages/explore-page/ExplorePage.tsx +++ b/packages/web/src/pages/explore-page/ExplorePage.tsx @@ -1,4 +1,4 @@ -import { remoteConfigSelectors } from '@audius/common' +import { remoteConfigSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/pages/explore-page/ExplorePageProvider.tsx b/packages/web/src/pages/explore-page/ExplorePageProvider.tsx index 6c97ac862a3..dc2642df7f0 100644 --- a/packages/web/src/pages/explore-page/ExplorePageProvider.tsx +++ b/packages/web/src/pages/explore-page/ExplorePageProvider.tsx @@ -1,11 +1,11 @@ import { ComponentType, useEffect } from 'react' import { - formatCount, accountSelectors, - explorePageActions, - explorePageSelectors -} from '@audius/common' + explorePageSelectors, + explorePageActions +} from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { withRouter, RouteComponentProps } from 'react-router-dom' diff --git a/packages/web/src/pages/explore-page/collections.ts b/packages/web/src/pages/explore-page/collections.ts index d177828480b..6ea42e968fa 100644 --- a/packages/web/src/pages/explore-page/collections.ts +++ b/packages/web/src/pages/explore-page/collections.ts @@ -1,6 +1,6 @@ import { ComponentType, SVGProps } from 'react' -import { ExploreCollectionsVariant } from '@audius/common' +import { ExploreCollectionsVariant } from '@audius/common/store' import { IconCart } from '@audius/stems' import IconCassette from 'assets/img/iconCassette.svg' diff --git a/packages/web/src/pages/explore-page/components/desktop/CollectionsPage.tsx b/packages/web/src/pages/explore-page/components/desktop/CollectionsPage.tsx index 44b07ca0d92..8c8be0713c5 100644 --- a/packages/web/src/pages/explore-page/components/desktop/CollectionsPage.tsx +++ b/packages/web/src/pages/explore-page/components/desktop/CollectionsPage.tsx @@ -1,6 +1,6 @@ import { useCallback, MouseEvent } from 'react' -import { ID, UserCollection, Status } from '@audius/common' +import { Status, UserCollection, ID } from '@audius/common/models' import { ArtistPopover } from 'components/artist/ArtistPopover' import Card from 'components/card/desktop/Card' diff --git a/packages/web/src/pages/explore-page/components/desktop/ExplorePage.tsx b/packages/web/src/pages/explore-page/components/desktop/ExplorePage.tsx index 27f4138dca4..d69a89d2809 100644 --- a/packages/web/src/pages/explore-page/components/desktop/ExplorePage.tsx +++ b/packages/web/src/pages/explore-page/components/desktop/ExplorePage.tsx @@ -1,12 +1,12 @@ import { Fragment, useCallback } from 'react' import { - UserCollection, Variant as CollectionVariant, Status, - User, - ExploreCollectionsVariant -} from '@audius/common' + UserCollection, + User +} from '@audius/common/models' +import { ExploreCollectionsVariant } from '@audius/common/store' import Lottie from 'react-lottie' import loadingSpinner from 'assets/animations/loadingSpinner.json' diff --git a/packages/web/src/pages/explore-page/components/mobile/CollectionsPage.tsx b/packages/web/src/pages/explore-page/components/mobile/CollectionsPage.tsx index 3c437d44cf2..9ee5c3c7cbc 100644 --- a/packages/web/src/pages/explore-page/components/mobile/CollectionsPage.tsx +++ b/packages/web/src/pages/explore-page/components/mobile/CollectionsPage.tsx @@ -1,6 +1,6 @@ import { useContext, useEffect } from 'react' -import { ID, UserCollection, Status } from '@audius/common' +import { Status, UserCollection, ID } from '@audius/common/models' import Card from 'components/card/mobile/Card' import Header from 'components/header/mobile/Header' diff --git a/packages/web/src/pages/explore-page/components/mobile/ExplorePage.tsx b/packages/web/src/pages/explore-page/components/mobile/ExplorePage.tsx index 05d1c6aa8bc..f8105186c36 100644 --- a/packages/web/src/pages/explore-page/components/mobile/ExplorePage.tsx +++ b/packages/web/src/pages/explore-page/components/mobile/ExplorePage.tsx @@ -8,17 +8,19 @@ import React, { } from 'react' import { - UserCollection, - SmartCollection, Variant as CollectionVariant, Status, - User, + UserCollection, + SmartCollection, + User +} from '@audius/common/models' +import { + explorePageSelectors, explorePageActions, ExplorePageTabs as ExploreTabs, - ExploreCollectionsVariant, - explorePageSelectors, - removeNullable -} from '@audius/common' + ExploreCollectionsVariant +} from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/favorites-page/FavoritesPage.tsx b/packages/web/src/pages/favorites-page/FavoritesPage.tsx index 48c212fb3b1..2aa3460e52b 100644 --- a/packages/web/src/pages/favorites-page/FavoritesPage.tsx +++ b/packages/web/src/pages/favorites-page/FavoritesPage.tsx @@ -3,7 +3,7 @@ import { useEffect, useContext } from 'react' import { favoritesUserListSelectors, FAVORITES_USER_LIST_TAG as USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import MobilePageContainer from 'components/mobile-page-container/MobilePageContainer' import NavContext, { LeftPreset } from 'components/nav/store/context' diff --git a/packages/web/src/pages/fb-share-page/FbSharePage.tsx b/packages/web/src/pages/fb-share-page/FbSharePage.tsx index b0087c71b70..48f8987cba3 100644 --- a/packages/web/src/pages/fb-share-page/FbSharePage.tsx +++ b/packages/web/src/pages/fb-share-page/FbSharePage.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import cn from 'classnames' import { Text } from 'components/typography' diff --git a/packages/web/src/pages/feed-page/FeedPageProvider.jsx b/packages/web/src/pages/feed-page/FeedPageProvider.jsx index 4fcc6a22cea..b56e0cf56f1 100644 --- a/packages/web/src/pages/feed-page/FeedPageProvider.jsx +++ b/packages/web/src/pages/feed-page/FeedPageProvider.jsx @@ -1,15 +1,15 @@ import { PureComponent } from 'react' +import { Name } from '@audius/common/models' import { - Name, accountSelectors, lineupSelectors, feedPageLineupActions as feedActions, feedPageSelectors, feedPageActions as discoverPageAction, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { push as pushRoute, replace as replaceRoute diff --git a/packages/web/src/pages/feed-page/components/desktop/FeedFilters.tsx b/packages/web/src/pages/feed-page/components/desktop/FeedFilters.tsx index 78c9c6097d9..09017b87185 100644 --- a/packages/web/src/pages/feed-page/components/desktop/FeedFilters.tsx +++ b/packages/web/src/pages/feed-page/components/desktop/FeedFilters.tsx @@ -1,4 +1,4 @@ -import { FeedFilter } from '@audius/common' +import { FeedFilter } from '@audius/common/models' import SelectablePills from 'components/selectable-pill/SelectablePills' diff --git a/packages/web/src/pages/feed-page/components/desktop/FeedPageContent.tsx b/packages/web/src/pages/feed-page/components/desktop/FeedPageContent.tsx index 1353122fec4..786e20778a3 100644 --- a/packages/web/src/pages/feed-page/components/desktop/FeedPageContent.tsx +++ b/packages/web/src/pages/feed-page/components/desktop/FeedPageContent.tsx @@ -1,10 +1,7 @@ -import { - Name, - FeedFilter, - feedPageLineupActions as feedActions, - FeatureFlags, - useFeatureFlag -} from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { Name, FeedFilter } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { feedPageLineupActions as feedActions } from '@audius/common/store' import { make, useRecord } from 'common/store/analytics/actions' import Header from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/feed-page/components/mobile/FeedFilterButton.tsx b/packages/web/src/pages/feed-page/components/mobile/FeedFilterButton.tsx index e42af0ef882..da53060dd95 100644 --- a/packages/web/src/pages/feed-page/components/mobile/FeedFilterButton.tsx +++ b/packages/web/src/pages/feed-page/components/mobile/FeedFilterButton.tsx @@ -1,4 +1,4 @@ -import { FeedFilter } from '@audius/common' +import { FeedFilter } from '@audius/common/models' import HeaderButton from 'components/header-button/HeaderButton' diff --git a/packages/web/src/pages/feed-page/components/mobile/FeedFilterDrawer.tsx b/packages/web/src/pages/feed-page/components/mobile/FeedFilterDrawer.tsx index 039dbc5a9c6..790c8159483 100644 --- a/packages/web/src/pages/feed-page/components/mobile/FeedFilterDrawer.tsx +++ b/packages/web/src/pages/feed-page/components/mobile/FeedFilterDrawer.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import { FeedFilter } from '@audius/common' +import { FeedFilter } from '@audius/common/models' import ActionDrawer from 'components/action-drawer/ActionDrawer' diff --git a/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx b/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx index 8535ed9ddcf..d2cbb7b7bb0 100644 --- a/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx +++ b/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx @@ -1,10 +1,7 @@ import { useContext, useEffect } from 'react' -import { - FeedFilter, - Name, - feedPageLineupActions as feedActions -} from '@audius/common' +import { Name, FeedFilter } from '@audius/common/models' +import { feedPageLineupActions as feedActions } from '@audius/common/store' import cn from 'classnames' import { useModalState } from 'common/hooks/useModalState' diff --git a/packages/web/src/pages/feed-page/types.ts b/packages/web/src/pages/feed-page/types.ts index 8dda4cbe3c4..6d34054cacd 100644 --- a/packages/web/src/pages/feed-page/types.ts +++ b/packages/web/src/pages/feed-page/types.ts @@ -1,4 +1,4 @@ -import { ID, UID, FeedFilter, Lineup, User } from '@audius/common' +import { FeedFilter, ID, UID, Lineup, User } from '@audius/common/models' export interface FeedPageContentProps { feedTitle: string diff --git a/packages/web/src/pages/followers-page/FollowersPage.tsx b/packages/web/src/pages/followers-page/FollowersPage.tsx index 8333608091d..c63ec18d8d4 100644 --- a/packages/web/src/pages/followers-page/FollowersPage.tsx +++ b/packages/web/src/pages/followers-page/FollowersPage.tsx @@ -3,7 +3,7 @@ import { useContext, useEffect } from 'react' import { followersUserListSelectors, FOLLOWERS_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import MobilePageContainer from 'components/mobile-page-container/MobilePageContainer' import NavContext, { LeftPreset } from 'components/nav/store/context' diff --git a/packages/web/src/pages/following-page/FollowingPage.tsx b/packages/web/src/pages/following-page/FollowingPage.tsx index bf600dc653e..1981e3c6030 100644 --- a/packages/web/src/pages/following-page/FollowingPage.tsx +++ b/packages/web/src/pages/following-page/FollowingPage.tsx @@ -3,7 +3,7 @@ import { useContext, useEffect } from 'react' import { followingUserListSelectors, FOLLOWING_USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import MobilePageContainer from 'components/mobile-page-container/MobilePageContainer' import NavContext, { LeftPreset } from 'components/nav/store/context' diff --git a/packages/web/src/pages/history-page/HistoryPageProvider.tsx b/packages/web/src/pages/history-page/HistoryPageProvider.tsx index f2b02076908..49592de5062 100644 --- a/packages/web/src/pages/history-page/HistoryPageProvider.tsx +++ b/packages/web/src/pages/history-page/HistoryPageProvider.tsx @@ -8,22 +8,24 @@ import { } from 'react' import { - ID, - UID, + Name, RepostSource, FavoriteSource, - Name, PlaybackSource, Status, + ID, + UID, + LineupTrack +} from '@audius/common/models' +import { accountSelectors, lineupSelectors, historyPageTracksLineupActions as tracksActions, historyPageSelectors, - tracksSocialActions as socialActions, - playerSelectors, queueSelectors, - LineupTrack -} from '@audius/common' + tracksSocialActions as socialActions, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { isEqual } from 'lodash' import { connect } from 'react-redux' diff --git a/packages/web/src/pages/history-page/components/desktop/HistoryPage.tsx b/packages/web/src/pages/history-page/components/desktop/HistoryPage.tsx index 4798d06d6a7..e782295a61a 100644 --- a/packages/web/src/pages/history-page/components/desktop/HistoryPage.tsx +++ b/packages/web/src/pages/history-page/components/desktop/HistoryPage.tsx @@ -1,6 +1,6 @@ import { ChangeEvent, memo, useMemo } from 'react' -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import { Button, ButtonType, IconPause, IconPlay } from '@audius/stems' import FilterInput from 'components/filter-input/FilterInput' diff --git a/packages/web/src/pages/history-page/components/mobile/HistoryPage.tsx b/packages/web/src/pages/history-page/components/mobile/HistoryPage.tsx index 57f672fb5ec..358fafc5e36 100644 --- a/packages/web/src/pages/history-page/components/mobile/HistoryPage.tsx +++ b/packages/web/src/pages/history-page/components/mobile/HistoryPage.tsx @@ -1,6 +1,7 @@ import { memo, useEffect, useCallback, useContext } from 'react' -import { ID, UID, LineupTrack, useGatedContentAccessMap } from '@audius/common' +import { useGatedContentAccessMap } from '@audius/common/hooks' +import { ID, UID, LineupTrack } from '@audius/common/models' import { Button, ButtonType } from '@audius/stems' import LoadingSpinner from 'components/loading-spinner/LoadingSpinner' diff --git a/packages/web/src/pages/modals/AppModal.tsx b/packages/web/src/pages/modals/AppModal.tsx index 2d27e2aa05e..a3ce97fba62 100644 --- a/packages/web/src/pages/modals/AppModal.tsx +++ b/packages/web/src/pages/modals/AppModal.tsx @@ -1,6 +1,6 @@ import { ComponentType, Suspense } from 'react' -import { Modals } from '@audius/common' +import { Modals } from '@audius/common/store' import { useModalState } from './useModalState' diff --git a/packages/web/src/pages/modals/Modals.tsx b/packages/web/src/pages/modals/Modals.tsx index 500b7fc0f12..6de8bd3f87f 100644 --- a/packages/web/src/pages/modals/Modals.tsx +++ b/packages/web/src/pages/modals/Modals.tsx @@ -1,6 +1,6 @@ import { ComponentType, lazy } from 'react' -import type { Modals as ModalTypes } from '@audius/common' +import { Modals as ModalTypes } from '@audius/common/store' import { AddFundsModal } from 'components/add-funds-modal/AddFundsModal' import AddToCollectionModal from 'components/add-to-collection/desktop/AddToCollectionModal' diff --git a/packages/web/src/pages/modals/useModalState.ts b/packages/web/src/pages/modals/useModalState.ts index f7783cded02..82c416cc9d3 100644 --- a/packages/web/src/pages/modals/useModalState.ts +++ b/packages/web/src/pages/modals/useModalState.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { modalsActions, modalsSelectors, Modals } from '@audius/common' +import { modalsSelectors, modalsActions, Modals } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useSelector } from 'utils/reducer' diff --git a/packages/web/src/pages/not-found-page/NotFoundPage.tsx b/packages/web/src/pages/not-found-page/NotFoundPage.tsx index 0223d314fef..556552edaa0 100644 --- a/packages/web/src/pages/not-found-page/NotFoundPage.tsx +++ b/packages/web/src/pages/not-found-page/NotFoundPage.tsx @@ -1,6 +1,7 @@ import { useEffect, useContext } from 'react' -import { Name, themeSelectors } from '@audius/common' +import { Name } from '@audius/common/models' +import { themeSelectors } from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' import { push as pushRoute } from 'connected-react-router' diff --git a/packages/web/src/pages/notification-users-page/NotificationUsersPage.tsx b/packages/web/src/pages/notification-users-page/NotificationUsersPage.tsx index 8d9a7254e9a..65adf3d267c 100644 --- a/packages/web/src/pages/notification-users-page/NotificationUsersPage.tsx +++ b/packages/web/src/pages/notification-users-page/NotificationUsersPage.tsx @@ -4,7 +4,7 @@ import { userListActions, notificationsUserListSelectors, NOTIFICATIONS_USER_LIST_TAG as USER_LIST_TAG -} from '@audius/common' +} from '@audius/common/store' import { connect } from 'react-redux' import { withRouter, RouteComponentProps } from 'react-router-dom' import { Dispatch } from 'redux' diff --git a/packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx b/packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx index d745e984f1a..879e1671962 100644 --- a/packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx +++ b/packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx @@ -1,11 +1,7 @@ import { FormEvent, useLayoutEffect, useState } from 'react' -import { - accountSelectors, - ErrorLevel, - Name, - signOutActions -} from '@audius/common' +import { Name, ErrorLevel } from '@audius/common/models' +import { accountSelectors, signOutActions } from '@audius/common/store' import { IconValidationX } from '@audius/stems' import cn from 'classnames' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/oauth-login-page/hooks.ts b/packages/web/src/pages/oauth-login-page/hooks.ts index 4ce2e20fdb7..ae924715c34 100644 --- a/packages/web/src/pages/oauth-login-page/hooks.ts +++ b/packages/web/src/pages/oauth-login-page/hooks.ts @@ -1,14 +1,13 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { - accountSelectors, - CommonState, - encodeHashId, - ErrorLevel, Name, + ErrorLevel, statusIsNotFinalized, User -} from '@audius/common' +} from '@audius/common/models' +import { accountSelectors, CommonState } from '@audius/common/store' +import { encodeHashId } from '@audius/common/utils' import * as queryString from 'query-string' import { useDispatch, useSelector } from 'react-redux' import { useHistory, useLocation } from 'react-router-dom' diff --git a/packages/web/src/pages/oauth-login-page/utils.ts b/packages/web/src/pages/oauth-login-page/utils.ts index d9d65eebddd..d4c004a6272 100644 --- a/packages/web/src/pages/oauth-login-page/utils.ts +++ b/packages/web/src/pages/oauth-login-page/utils.ts @@ -1,10 +1,9 @@ +import { SquareSizes, User } from '@audius/common/models' import { - SquareSizes, - User, + getErrorMessage, decodeHashId, - encodeHashId, - getErrorMessage -} from '@audius/common' + encodeHashId +} from '@audius/common/utils' import { CreateGrantRequest } from '@audius/sdk' import base64url from 'base64url' diff --git a/packages/web/src/pages/pay-and-earn-page/PayAndEarnPage.tsx b/packages/web/src/pages/pay-and-earn-page/PayAndEarnPage.tsx index 776c302075d..b82b2fa471f 100644 --- a/packages/web/src/pages/pay-and-earn-page/PayAndEarnPage.tsx +++ b/packages/web/src/pages/pay-and-earn-page/PayAndEarnPage.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -import { buyUSDCActions } from '@audius/common' +import { buyUSDCActions } from '@audius/common/store' import { useDispatch } from 'react-redux' import { useIsMobile } from 'hooks/useIsMobile' diff --git a/packages/web/src/pages/pay-and-earn-page/components/PurchasesTab.tsx b/packages/web/src/pages/pay-and-earn-page/components/PurchasesTab.tsx index bd7e120f561..cdbd8003b78 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/PurchasesTab.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/PurchasesTab.tsx @@ -1,17 +1,17 @@ import { useCallback, useContext, useState } from 'react' +import { useGetPurchases, useGetPurchasesCount, Id } from '@audius/common/api' +import { useAllPaginatedQuery } from '@audius/common/audius-query' import { - Id, Status, - USDCPurchaseDetails, - accountSelectors, - combineStatuses, statusIsNotFinalized, - useAllPaginatedQuery, - useGetPurchases, - useGetPurchasesCount, + combineStatuses, + USDCPurchaseDetails +} from '@audius/common/models' +import { + accountSelectors, useUSDCPurchaseDetailsModal -} from '@audius/common' +} from '@audius/common/store' import { full } from '@audius/sdk' import { push as pushRoute } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/pay-and-earn-page/components/PurchasesTable.tsx b/packages/web/src/pages/pay-and-earn-page/components/PurchasesTable.tsx index 18ae8e7ef85..67208d59eec 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/PurchasesTable.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/PurchasesTable.tsx @@ -1,10 +1,10 @@ import { MouseEvent, useCallback, useMemo } from 'react' import { - formatUSDCWeiToUSDString, USDCContentPurchaseType, USDCPurchaseDetails -} from '@audius/common' +} from '@audius/common/models' +import { formatUSDCWeiToUSDString } from '@audius/common/utils' import BN from 'bn.js' import moment from 'moment' diff --git a/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx b/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx index 3d9c00e950d..d1abc924250 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/SalesTab.tsx @@ -1,17 +1,17 @@ import { useCallback, useContext, useState } from 'react' +import { useGetSales, useGetSalesCount, Id } from '@audius/common/api' +import { useAllPaginatedQuery } from '@audius/common/audius-query' import { - Id, Status, - USDCPurchaseDetails, - accountSelectors, - combineStatuses, statusIsNotFinalized, - useAllPaginatedQuery, - useGetSales, - useGetSalesCount, + combineStatuses, + USDCPurchaseDetails +} from '@audius/common/models' +import { + accountSelectors, useUSDCPurchaseDetailsModal -} from '@audius/common' +} from '@audius/common/store' import { full } from '@audius/sdk' import { push as pushRoute } from 'connected-react-router' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx index b6b41db6b70..31c798db763 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/SalesTable.tsx @@ -1,10 +1,10 @@ import { MouseEvent, useCallback, useMemo } from 'react' import { - formatUSDCWeiToUSDString, USDCContentPurchaseType, USDCPurchaseDetails -} from '@audius/common' +} from '@audius/common/models' +import { formatUSDCWeiToUSDString } from '@audius/common/utils' import { BN } from 'bn.js' import moment from 'moment' diff --git a/packages/web/src/pages/pay-and-earn-page/components/TrackNameWithArtwork.tsx b/packages/web/src/pages/pay-and-earn-page/components/TrackNameWithArtwork.tsx index 5f74410a1b8..7fba4f6a678 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/TrackNameWithArtwork.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/TrackNameWithArtwork.tsx @@ -1,8 +1,5 @@ -import { - SquareSizes, - statusIsNotFinalized, - useGetTrackById -} from '@audius/common' +import { useGetTrackById } from '@audius/common/api' +import { SquareSizes, statusIsNotFinalized } from '@audius/common/models' import DynamicImage from 'components/dynamic-image/DynamicImage' import { Text } from 'components/typography' diff --git a/packages/web/src/pages/pay-and-earn-page/components/USDCCard.tsx b/packages/web/src/pages/pay-and-earn-page/components/USDCCard.tsx index 70489398904..2b34d118067 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/USDCCard.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/USDCCard.tsx @@ -1,16 +1,16 @@ import { useCallback } from 'react' +import { useUSDCBalance } from '@audius/common/hooks' +import { Name, Status, BNUSDC } from '@audius/common/models' import { - BNUSDC, - Name, WithdrawUSDCModalPages, - formatCurrencyBalance, - formatUSDCWeiToFloorCentsNumber, useWithdrawUSDCModal, - useAddFundsModal, - useUSDCBalance, - Status -} from '@audius/common' + useAddFundsModal +} from '@audius/common/store' +import { + formatCurrencyBalance, + formatUSDCWeiToFloorCentsNumber +} from '@audius/common/utils' import { Button, PlainButton, IconQuestionCircle, Flex } from '@audius/harmony' import { LogoUSDC } from '@audius/stems' import BN from 'bn.js' diff --git a/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTab.tsx b/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTab.tsx index 7a81d9f0d12..0af97b522fc 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTab.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTab.tsx @@ -1,23 +1,27 @@ import { useCallback, useContext, useState } from 'react' import { - BNUSDC, - Id, + useGetUSDCTransactions, + useGetUSDCTransactionsCount, + Id +} from '@audius/common/api' +import { useAllPaginatedQuery } from '@audius/common/audius-query' +import { useUSDCBalance } from '@audius/common/hooks' +import { Name, Status, + statusIsNotFinalized, + combineStatuses, USDCTransactionDetails, - WithdrawUSDCModalPages, + BNUSDC +} from '@audius/common/models' +import { accountSelectors, - combineStatuses, - formatUSDCWeiToFloorCentsNumber, - statusIsNotFinalized, - useAllPaginatedQuery, - useGetUSDCTransactions, - useGetUSDCTransactionsCount, - useUSDCBalance, useUSDCTransactionDetailsModal, + WithdrawUSDCModalPages, useWithdrawUSDCModal -} from '@audius/common' +} from '@audius/common/store' +import { formatUSDCWeiToFloorCentsNumber } from '@audius/common/utils' import { full } from '@audius/sdk' import BN from 'bn.js' diff --git a/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTable.tsx b/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTable.tsx index ec270dc626e..0914998a6a1 100644 --- a/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTable.tsx +++ b/packages/web/src/pages/pay-and-earn-page/components/WithdrawalsTable.tsx @@ -1,9 +1,7 @@ import { MouseEvent, useCallback, useMemo } from 'react' -import { - USDCTransactionDetails, - formatUSDCWeiToUSDString -} from '@audius/common' +import { USDCTransactionDetails } from '@audius/common/models' +import { formatUSDCWeiToUSDString } from '@audius/common/utils' import moment from 'moment' import { Table } from 'components/table' diff --git a/packages/web/src/pages/pay-and-earn-page/desktop/PayAndEarnPage.tsx b/packages/web/src/pages/pay-and-earn-page/desktop/PayAndEarnPage.tsx index 267f535ef05..21b89b965d0 100644 --- a/packages/web/src/pages/pay-and-earn-page/desktop/PayAndEarnPage.tsx +++ b/packages/web/src/pages/pay-and-earn-page/desktop/PayAndEarnPage.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { Button, Flex, diff --git a/packages/web/src/pages/pay-and-earn-page/mobile/PayAndEarnPage.tsx b/packages/web/src/pages/pay-and-earn-page/mobile/PayAndEarnPage.tsx index 51108937357..a722ccf24c8 100644 --- a/packages/web/src/pages/pay-and-earn-page/mobile/PayAndEarnPage.tsx +++ b/packages/web/src/pages/pay-and-earn-page/mobile/PayAndEarnPage.tsx @@ -1,6 +1,6 @@ import { useCallback, useContext, useEffect, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { Flex, Paper, SelectablePill } from '@audius/harmony' import { replace } from 'connected-react-router' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/pay-and-earn-page/types.ts b/packages/web/src/pages/pay-and-earn-page/types.ts index 683e6245f25..83ee6643420 100644 --- a/packages/web/src/pages/pay-and-earn-page/types.ts +++ b/packages/web/src/pages/pay-and-earn-page/types.ts @@ -1,4 +1,7 @@ -import { USDCPurchaseDetails, USDCTransactionDetails } from '@audius/common' +import { + USDCPurchaseDetails, + USDCTransactionDetails +} from '@audius/common/models' import { Cell, Row } from 'react-table' export enum TableType { diff --git a/packages/web/src/pages/premium-tracks-page/PremiumTracksPage.tsx b/packages/web/src/pages/premium-tracks-page/PremiumTracksPage.tsx index 61d91d3a41e..7771c4c9b06 100644 --- a/packages/web/src/pages/premium-tracks-page/PremiumTracksPage.tsx +++ b/packages/web/src/pages/premium-tracks-page/PremiumTracksPage.tsx @@ -1,9 +1,9 @@ import { useEffect } from 'react' import { - premiumTracksPageLineupActions, - premiumTracksPageLineupSelectors -} from '@audius/common' + premiumTracksPageLineupSelectors, + premiumTracksPageLineupActions +} from '@audius/common/store' import { useDispatch } from 'react-redux' import EndOfLineup from 'components/lineup/EndOfLineup' diff --git a/packages/web/src/pages/profile-page/ProfilePageProvider.tsx b/packages/web/src/pages/profile-page/ProfilePageProvider.tsx index f9b5f4535a1..d8de4d9a408 100644 --- a/packages/web/src/pages/profile-page/ProfilePageProvider.tsx +++ b/packages/web/src/pages/profile-page/ProfilePageProvider.tsx @@ -1,45 +1,45 @@ import { ComponentType, PureComponent, RefObject } from 'react' import { - ID, - UID, Name, - FollowSource, ShareSource, - BadgeTier, + FollowSource, + CreatePlaylistSource, Status, - formatCount, - getErrorMessage, + BadgeTier, + ID, + UID +} from '@audius/common/models' +import { newUserMetadata } from '@audius/common/schemas' +import { accountActions, accountSelectors, + cacheCollectionsActions, + profilePageFeedLineupActions as feedActions, + profilePageTracksLineupActions as tracksActions, + profilePageActions as profileActions, profilePageSelectors, - CollectionSortMode, - ProfilePageTabs, FollowType, + CollectionSortMode, TracksSortMode, + ProfilePageTabs, getTabForRoute, - profilePageActions as profileActions, - profilePageTracksLineupActions as tracksActions, - profilePageFeedLineupActions as feedActions, + chatActions, + chatSelectors, + ChatPermissionAction, + queueSelectors, + usersSocialActions as socialActions, relatedArtistsUISelectors, - OverflowSource, - OverflowAction, mobileOverflowMenuUIActions, shareModalUIActions, + OverflowAction, + OverflowSource, + inboxUnavailableModalActions, followingUserListActions, followersUserListActions, - usersSocialActions as socialActions, - newUserMetadata, - playerSelectors, - queueSelectors, - Nullable, - chatActions, - chatSelectors, - ChatPermissionAction, - inboxUnavailableModalActions, - cacheCollectionsActions, - CreatePlaylistSource -} from '@audius/common' + playerSelectors +} from '@audius/common/store' +import { getErrorMessage, formatCount, Nullable } from '@audius/common/utils' import { push as pushRoute, replace } from 'connected-react-router' import { UnregisterCallback } from 'history' import { uniq } from 'lodash' diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileBio.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileBio.tsx index ada730f57e9..c60c93370a6 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileBio.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileBio.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { ResizeObserver } from '@juggle/resize-observer' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx index 87d9b331b53..280bc75914a 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx @@ -1,4 +1,5 @@ -import { ID, accountSelectors } from '@audius/common' +import { ID } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { animated } from 'react-spring' diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileMutuals.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileMutuals.tsx index 8325596b0a2..382004a0888 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileMutuals.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileMutuals.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' import { - removeNullable, accountSelectors, cacheUsersSelectors, profilePageSelectors -} from '@audius/common' +} from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { IconFollowing } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' import { createSelector } from 'reselect' diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfilePage.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfilePage.tsx index 4478fd8fa7a..38fa3549f3d 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfilePage.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfilePage.tsx @@ -1,22 +1,24 @@ import { useCallback, memo, MouseEvent } from 'react' +import { useSelectTierInfo } from '@audius/common/hooks' import { + CreatePlaylistSource, + Status, + Collection, ID, UID, - Collection, - CoverPhotoSizes, ProfilePictureSizes, + CoverPhotoSizes, LineupState, - Status, + Track +} from '@audius/common/models' +import { + profilePageFeedLineupActions as feedActions, profilePageTracksLineupActions as tracksActions, - ProfileUser, ProfilePageTabs, - profilePageFeedLineupActions as feedActions, badgeTiers, - useSelectTierInfo, - CreatePlaylistSource, - Track -} from '@audius/common' + ProfileUser +} from '@audius/common/store' import { IconAlbum } from '@audius/harmony' import IconCollectibles from 'assets/img/iconCollectibles.svg' diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileTopTags.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileTopTags.tsx index 5b62f155bf7..8838a8cef6f 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileTopTags.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileTopTags.tsx @@ -1,10 +1,7 @@ import { useEffect } from 'react' -import { - Status, - profilePageActions, - profilePageSelectors -} from '@audius/common' +import { Status } from '@audius/common/models' +import { profilePageActions, profilePageSelectors } from '@audius/common/store' import { IconTrending } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileWrapping.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileWrapping.tsx index 2fc4e39ee9c..1c01a8bf5e5 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileWrapping.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileWrapping.tsx @@ -1,4 +1,5 @@ -import { ID, ProfilePictureSizes, Nullable } from '@audius/common' +import { ID, ProfilePictureSizes } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import BadgeArtist from 'assets/img/badgeArtist.svg' diff --git a/packages/web/src/pages/profile-page/components/mobile/GrowingCoverPhoto.tsx b/packages/web/src/pages/profile-page/components/mobile/GrowingCoverPhoto.tsx index 38d68b55934..e05cfe9d0a2 100644 --- a/packages/web/src/pages/profile-page/components/mobile/GrowingCoverPhoto.tsx +++ b/packages/web/src/pages/profile-page/components/mobile/GrowingCoverPhoto.tsx @@ -1,6 +1,6 @@ import { useEffect, useCallback } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useSpring, animated } from 'react-spring' diff --git a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx index 3e9f977b9af..22e6c8487c8 100644 --- a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx +++ b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx @@ -1,16 +1,18 @@ import { useState, useRef, useCallback, useEffect, MouseEvent } from 'react' import { - ID, - Name, - CoverPhotoSizes, - ProfilePictureSizes, - WidthSizes, - SquareSizes, - formatCount, imageCoverPhotoBlank, imageProfilePicEmpty -} from '@audius/common' +} from '@audius/common/assets' +import { + Name, + SquareSizes, + WidthSizes, + ID, + ProfilePictureSizes, + CoverPhotoSizes +} from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import { Button, ButtonType, diff --git a/packages/web/src/pages/profile-page/components/mobile/ProfilePage.tsx b/packages/web/src/pages/profile-page/components/mobile/ProfilePage.tsx index a72ce537e70..82e1f6f783e 100644 --- a/packages/web/src/pages/profile-page/components/mobile/ProfilePage.tsx +++ b/packages/web/src/pages/profile-page/components/mobile/ProfilePage.tsx @@ -1,22 +1,24 @@ import { useEffect, useContext, MouseEvent, ReactNode } from 'react' +import { useSelectTierInfo } from '@audius/common/hooks' import { + Status, + Collection, ID, UID, - Collection, - CoverPhotoSizes, ProfilePictureSizes, + CoverPhotoSizes, LineupState, - Status, User, - ProfilePageTabs, - ProfileUser, - profilePageTracksLineupActions as tracksActions, + Track +} from '@audius/common/models' +import { profilePageFeedLineupActions as feedActions, + profilePageTracksLineupActions as tracksActions, + ProfilePageTabs, badgeTiers, - useSelectTierInfo, - Track -} from '@audius/common' + ProfileUser +} from '@audius/common/store' import { IconAlbum } from '@audius/harmony' import cn from 'classnames' diff --git a/packages/web/src/pages/profile-page/components/mobile/ShareUserButton.tsx b/packages/web/src/pages/profile-page/components/mobile/ShareUserButton.tsx index 0a30f572bf0..5a97535a810 100644 --- a/packages/web/src/pages/profile-page/components/mobile/ShareUserButton.tsx +++ b/packages/web/src/pages/profile-page/components/mobile/ShareUserButton.tsx @@ -1,6 +1,8 @@ import { useCallback } from 'react' -import { ID, ShareSource, Nullable, shareModalUIActions } from '@audius/common' +import { ShareSource, ID } from '@audius/common/models' +import { shareModalUIActions } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { IconShare, IconButton } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/profile-page/useProfileParams.ts b/packages/web/src/pages/profile-page/useProfileParams.ts index d1bfcad0998..e2a4b56d0d4 100644 --- a/packages/web/src/pages/profile-page/useProfileParams.ts +++ b/packages/web/src/pages/profile-page/useProfileParams.ts @@ -1,4 +1,4 @@ -import { cacheUsersSelectors } from '@audius/common' +import { cacheUsersSelectors } from '@audius/common/store' import { useSelector } from 'react-redux' import { useLocation } from 'react-router-dom' diff --git a/packages/web/src/pages/remixes-page/RemixesPageProvider.tsx b/packages/web/src/pages/remixes-page/RemixesPageProvider.tsx index ba7b03a1b7f..2c73437810e 100644 --- a/packages/web/src/pages/remixes-page/RemixesPageProvider.tsx +++ b/packages/web/src/pages/remixes-page/RemixesPageProvider.tsx @@ -1,14 +1,14 @@ import { useEffect, useCallback, ComponentType, RefObject } from 'react' +import { ID } from '@audius/common/models' import { - ID, lineupSelectors, remixesPageLineupActions as tracksActions, remixesPageActions, remixesPageSelectors, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { useParams } from 'react-router' diff --git a/packages/web/src/pages/remixes-page/components/desktop/RemixesPage.tsx b/packages/web/src/pages/remixes-page/components/desktop/RemixesPage.tsx index 313d200d559..d5d75be2d2f 100644 --- a/packages/web/src/pages/remixes-page/components/desktop/RemixesPage.tsx +++ b/packages/web/src/pages/remixes-page/components/desktop/RemixesPage.tsx @@ -1,4 +1,5 @@ -import { Track, User, pluralize } from '@audius/common' +import { Track, User } from '@audius/common/models' +import { pluralize } from '@audius/common/utils' import cn from 'classnames' import IconRemixes from 'assets/img/iconRemix.svg' diff --git a/packages/web/src/pages/remixes-page/components/mobile/RemixesPage.tsx b/packages/web/src/pages/remixes-page/components/mobile/RemixesPage.tsx index 7c7c6a1adc0..e5a155da47d 100644 --- a/packages/web/src/pages/remixes-page/components/mobile/RemixesPage.tsx +++ b/packages/web/src/pages/remixes-page/components/mobile/RemixesPage.tsx @@ -1,6 +1,7 @@ import { useEffect, useContext } from 'react' -import { Track, User, pluralize } from '@audius/common' +import { Track, User } from '@audius/common/models' +import { pluralize } from '@audius/common/utils' import cn from 'classnames' import IconRemixes from 'assets/img/iconRemix.svg' diff --git a/packages/web/src/pages/reposts-page/RepostsPage.tsx b/packages/web/src/pages/reposts-page/RepostsPage.tsx index da42c4714ab..227af4aa6d5 100644 --- a/packages/web/src/pages/reposts-page/RepostsPage.tsx +++ b/packages/web/src/pages/reposts-page/RepostsPage.tsx @@ -1,6 +1,9 @@ import { useContext, useEffect } from 'react' -import { repostsUserListSelectors, REPOSTS_USER_LIST_TAG } from '@audius/common' +import { + repostsUserListSelectors, + REPOSTS_USER_LIST_TAG +} from '@audius/common/store' import MobilePageContainer from 'components/mobile-page-container/MobilePageContainer' import NavContext, { LeftPreset } from 'components/nav/store/context' diff --git a/packages/web/src/pages/requires-update/RequiresUpdate.tsx b/packages/web/src/pages/requires-update/RequiresUpdate.tsx index bc77f9a0ada..5b5ec3f4407 100644 --- a/packages/web/src/pages/requires-update/RequiresUpdate.tsx +++ b/packages/web/src/pages/requires-update/RequiresUpdate.tsx @@ -1,4 +1,4 @@ -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import { Button, ButtonType, ButtonSize } from '@audius/stems' import tileBackground from 'assets/img/notFoundTiledBackround.png' diff --git a/packages/web/src/pages/saved-page/SavedPageProvider.tsx b/packages/web/src/pages/saved-page/SavedPageProvider.tsx index a4461b9e6a6..bbe3bb2cf1d 100644 --- a/packages/web/src/pages/saved-page/SavedPageProvider.tsx +++ b/packages/web/src/pages/saved-page/SavedPageProvider.tsx @@ -1,30 +1,32 @@ import { ComponentType, PureComponent } from 'react' import { - FavoriteSource, - ID, - LibraryCategoryType, - LineupTrack, Name, - PlaybackSource, - SavedPageTabs as ProfileTabs, RepostSource, - SavedPageTabs, - SavedPageTrack, - TrackRecord, + FavoriteSource, + PlaybackSource, + ID, UID, + LineupTrack +} from '@audius/common/models' +import { + SavedPageTabs as ProfileTabs, accountActions, accountSelectors, lineupSelectors, - playerSelectors, - playlistUpdatesActions, - playlistUpdatesSelectors, - queueSelectors, + savedPageTracksLineupActions as tracksActions, savedPageActions as saveActions, savedPageSelectors, + SavedPageTabs, + queueSelectors, tracksSocialActions as socialActions, - savedPageTracksLineupActions as tracksActions -} from '@audius/common' + playerSelectors, + playlistUpdatesActions, + playlistUpdatesSelectors, + LibraryCategoryType, + SavedPageTrack, + TrackRecord +} from '@audius/common/store' import { full } from '@audius/sdk' import { push as pushRoute } from 'connected-react-router' import { debounce, isEqual } from 'lodash' diff --git a/packages/web/src/pages/saved-page/components/desktop/AlbumsTabPage.tsx b/packages/web/src/pages/saved-page/components/desktop/AlbumsTabPage.tsx index 05ead665fd1..0473337b55e 100644 --- a/packages/web/src/pages/saved-page/components/desktop/AlbumsTabPage.tsx +++ b/packages/web/src/pages/saved-page/components/desktop/AlbumsTabPage.tsx @@ -1,12 +1,12 @@ import { useMemo } from 'react' +import { statusIsNotFinalized } from '@audius/common/models' import { - LibraryCategory, - statusIsNotFinalized, savedPageSelectors, - CommonState, - SavedPageTabs -} from '@audius/common' + LibraryCategory, + SavedPageTabs, + CommonState +} from '@audius/common/store' import { useSelector } from 'react-redux' import { InfiniteCardLineup } from 'components/lineup/InfiniteCardLineup' diff --git a/packages/web/src/pages/saved-page/components/desktop/CollectionCard.tsx b/packages/web/src/pages/saved-page/components/desktop/CollectionCard.tsx index bc922b565d2..9ae17ac98ed 100644 --- a/packages/web/src/pages/saved-page/components/desktop/CollectionCard.tsx +++ b/packages/web/src/pages/saved-page/components/desktop/CollectionCard.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { ID } from '@audius/common/models' import { cacheCollectionsSelectors, cacheUsersSelectors, - ID, CommonState -} from '@audius/common' +} from '@audius/common/store' import { useSelector } from 'react-redux' import Card, { CardProps } from 'components/card/desktop/Card' diff --git a/packages/web/src/pages/saved-page/components/desktop/LibraryCategorySelectionMenu.tsx b/packages/web/src/pages/saved-page/components/desktop/LibraryCategorySelectionMenu.tsx index 5517bafa89a..a7be881e8e2 100644 --- a/packages/web/src/pages/saved-page/components/desktop/LibraryCategorySelectionMenu.tsx +++ b/packages/web/src/pages/saved-page/components/desktop/LibraryCategorySelectionMenu.tsx @@ -1,11 +1,11 @@ import { - CommonState, - LibraryCategory, - LibraryCategoryType, savedPageActions, savedPageSelectors, - SavedPageTabs -} from '@audius/common' + LibraryCategory, + SavedPageTabs, + LibraryCategoryType, + CommonState +} from '@audius/common/store' import { SelectablePill } from '@audius/harmony' import { IconHeart, IconCart, IconRepost } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/saved-page/components/desktop/PlaylistsTabPage.tsx b/packages/web/src/pages/saved-page/components/desktop/PlaylistsTabPage.tsx index 753059b2a2e..6d54778528d 100644 --- a/packages/web/src/pages/saved-page/components/desktop/PlaylistsTabPage.tsx +++ b/packages/web/src/pages/saved-page/components/desktop/PlaylistsTabPage.tsx @@ -1,14 +1,16 @@ import { useCallback, useMemo } from 'react' import { - cacheCollectionsActions, - CommonState, CreatePlaylistSource, - LibraryCategory, + statusIsNotFinalized +} from '@audius/common/models' +import { + cacheCollectionsActions, savedPageSelectors, + LibraryCategory, SavedPageTabs, - statusIsNotFinalized -} from '@audius/common' + CommonState +} from '@audius/common/store' import { IconPlus } from '@audius/stems' import { useDispatch, useSelector } from 'react-redux' diff --git a/packages/web/src/pages/saved-page/components/desktop/SavedPage.tsx b/packages/web/src/pages/saved-page/components/desktop/SavedPage.tsx index 2b1d31869c9..8651d06b8ba 100644 --- a/packages/web/src/pages/saved-page/components/desktop/SavedPage.tsx +++ b/packages/web/src/pages/saved-page/components/desktop/SavedPage.tsx @@ -1,21 +1,16 @@ import { useContext } from 'react' +import { Kind, Status, ID, UID, Lineup, User } from '@audius/common/models' import { - CommonState, - ID, - Kind, - LibraryCategory, - Lineup, - QueueItem, - SavedPageCollection, savedPageSelectors, + LibraryCategory, SavedPageTabs, SavedPageTrack, - Status, TrackRecord, - UID, - User -} from '@audius/common' + SavedPageCollection, + QueueItem, + CommonState +} from '@audius/common/store' import { IconAlbum } from '@audius/harmony' import { Button, ButtonType, IconPause, IconPlay } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/pages/saved-page/components/mobile/NewPlaylistButton.tsx b/packages/web/src/pages/saved-page/components/mobile/NewPlaylistButton.tsx index df9401e6a86..263a68a9f22 100644 --- a/packages/web/src/pages/saved-page/components/mobile/NewPlaylistButton.tsx +++ b/packages/web/src/pages/saved-page/components/mobile/NewPlaylistButton.tsx @@ -1,10 +1,7 @@ import { useCallback } from 'react' -import { - Name, - CreatePlaylistSource, - cacheCollectionsActions -} from '@audius/common' +import { Name, CreatePlaylistSource } from '@audius/common/models' +import { cacheCollectionsActions } from '@audius/common/store' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/pages/saved-page/components/mobile/SavedPage.tsx b/packages/web/src/pages/saved-page/components/mobile/SavedPage.tsx index ec7387c7793..debdcde1264 100644 --- a/packages/web/src/pages/saved-page/components/mobile/SavedPage.tsx +++ b/packages/web/src/pages/saved-page/components/mobile/SavedPage.tsx @@ -8,22 +8,26 @@ import { } from 'react' import { - CommonState, - ID, - LibraryCategory, - Lineup, + useGatedContentAccessMap, + useDebouncedCallback +} from '@audius/common/hooks' +import { Name, - QueueItem, - SavedPageTabs, - SavedPageTrack, + statusIsNotFinalized, + ID, UID, + Lineup +} from '@audius/common/models' +import { cacheCollectionsSelectors, cacheUsersSelectors, savedPageSelectors, - statusIsNotFinalized, - useDebouncedCallback, - useGatedContentAccessMap -} from '@audius/common' + LibraryCategory, + SavedPageTabs, + SavedPageTrack, + QueueItem, + CommonState +} from '@audius/common/store' import { IconAlbum } from '@audius/harmony' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/saved-page/components/utils.ts b/packages/web/src/pages/saved-page/components/utils.ts index aa852b21278..9937681ddf9 100644 --- a/packages/web/src/pages/saved-page/components/utils.ts +++ b/packages/web/src/pages/saved-page/components/utils.ts @@ -1,4 +1,4 @@ -import { formatCount } from '@audius/common' +import { formatCount } from '@audius/common/utils' export const formatCardSecondaryText = (saves: number, tracks: number) => { const savesText = saves === 1 ? 'Favorite' : 'Favorites' diff --git a/packages/web/src/pages/saved-page/hooks/useCollectionsData.tsx b/packages/web/src/pages/saved-page/hooks/useCollectionsData.tsx index 7b6c4fe8f16..4617c939048 100644 --- a/packages/web/src/pages/saved-page/hooks/useCollectionsData.tsx +++ b/packages/web/src/pages/saved-page/hooks/useCollectionsData.tsx @@ -1,15 +1,14 @@ import { useMemo } from 'react' +import { useGetLibraryAlbums, useGetLibraryPlaylists } from '@audius/common/api' +import { useAllPaginatedQuery } from '@audius/common/audius-query' +import { Status } from '@audius/common/models' import { accountSelectors, cacheCollectionsSelectors, - CommonState, savedPageSelectors, - Status, - useAllPaginatedQuery, - useGetLibraryAlbums, - useGetLibraryPlaylists -} from '@audius/common' + CommonState +} from '@audius/common/store' import { uniqBy } from 'lodash' import { useSelector } from 'react-redux' diff --git a/packages/web/src/pages/search-page/SearchPageProvider.jsx b/packages/web/src/pages/search-page/SearchPageProvider.jsx index 5aae6686dcc..1d5b7da8366 100644 --- a/packages/web/src/pages/search-page/SearchPageProvider.jsx +++ b/packages/web/src/pages/search-page/SearchPageProvider.jsx @@ -1,16 +1,16 @@ import { Component } from 'react' +import { Name } from '@audius/common/models' import { - Name, accountSelectors, lineupSelectors, + searchResultsPageTracksLineupActions as tracksActions, searchResultsPageActions as searchPageActions, searchResultsPageSelectors, SearchKind, - searchResultsPageTracksLineupActions as tracksActions, - playerSelectors, - queueSelectors -} from '@audius/common' + queueSelectors, + playerSelectors +} from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { connect } from 'react-redux' import { Redirect } from 'react-router' diff --git a/packages/web/src/pages/search-page/components/desktop/SearchPageContent.jsx b/packages/web/src/pages/search-page/components/desktop/SearchPageContent.jsx index 6a56064e220..f298f34a93a 100644 --- a/packages/web/src/pages/search-page/components/desktop/SearchPageContent.jsx +++ b/packages/web/src/pages/search-page/components/desktop/SearchPageContent.jsx @@ -1,11 +1,11 @@ import { Component } from 'react' +import { Status } from '@audius/common/models' import { - Status, - formatCount, searchResultsPageTracksLineupActions as tracksActions, SearchKind -} from '@audius/common' +} from '@audius/common/store' +import { formatCount } from '@audius/common/utils' import { Redirect } from 'react-router' import IconBigSearch from 'assets/img/iconBigSearch.svg' diff --git a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx index 222805ff18f..a0fb0581808 100644 --- a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx +++ b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx @@ -1,15 +1,15 @@ import { memo, useCallback, useContext, useEffect, useMemo } from 'react' import { - UID, Name, + Status, UserCollection, + UID, LineupState, - Status, - User, - searchResultsPageTracksLineupActions as tracksActions, - trimToAlphaNumeric -} from '@audius/common' + User +} from '@audius/common/models' +import { searchResultsPageTracksLineupActions as tracksActions } from '@audius/common/store' +import { trimToAlphaNumeric } from '@audius/common/utils' import { IconAlbum } from '@audius/harmony' import { matchPath } from 'react-router' import { Dispatch } from 'redux' diff --git a/packages/web/src/pages/search-page/helpers.ts b/packages/web/src/pages/search-page/helpers.ts index e8a73e2d668..7eb323ac49b 100644 --- a/packages/web/src/pages/search-page/helpers.ts +++ b/packages/web/src/pages/search-page/helpers.ts @@ -1,4 +1,4 @@ -import { SearchKind } from '@audius/common' +import { SearchKind } from '@audius/common/store' import { Location } from 'history' import { matchPath } from 'react-router' diff --git a/packages/web/src/pages/settings-page/SettingsPageProvider.tsx b/packages/web/src/pages/settings-page/SettingsPageProvider.tsx index c15fddc04a0..db839086e7c 100644 --- a/packages/web/src/pages/settings-page/SettingsPageProvider.tsx +++ b/packages/web/src/pages/settings-page/SettingsPageProvider.tsx @@ -1,25 +1,24 @@ import { ComponentType, PureComponent } from 'react' +import { Name, Theme } from '@audius/common/models' import { - Name, - Theme, + accountActions, accountSelectors, - InstagramProfile, settingsPageSelectors, + settingsPageActions as settingPageActions, BrowserNotificationSetting, - EmailFrequency, PushNotificationSetting, - settingsPageActions as settingPageActions, + EmailFrequency, + signOutActions, makeGetTierAndVerifiedForUser, - modalsActions, - themeSelectors, themeActions, - accountActions, - TwitterProfile, - signOutActions, + themeSelectors, + modalsActions, musicConfettiActions, + InstagramProfile, + TwitterProfile, TikTokProfile -} from '@audius/common' +} from '@audius/common/store' import { push as pushRoute, goBack } from 'connected-react-router' import { connect } from 'react-redux' import { Dispatch } from 'redux' diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/CreateNewAppPage.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/CreateNewAppPage.tsx index 2560eee0046..fe4877f2766 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/CreateNewAppPage.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/CreateNewAppPage.tsx @@ -1,14 +1,13 @@ import { useCallback, useEffect, useState } from 'react' import { - Status, - accountSelectors, - developerAppSchema, - useAddDeveloperApp, - Name, DEVELOPER_APP_DESCRIPTION_MAX_LENGTH, - DEVELOPER_APP_NAME_MAX_LENGTH -} from '@audius/common' + DEVELOPER_APP_NAME_MAX_LENGTH, + developerAppSchema, + useAddDeveloperApp +} from '@audius/common/api' +import { Name, Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Button, ButtonType } from '@audius/stems' import { Form, Formik } from 'formik' import { z } from 'zod' diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeleteAppConfirmationPage.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeleteAppConfirmationPage.tsx index 2b51505140d..bf6fea99d73 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeleteAppConfirmationPage.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeleteAppConfirmationPage.tsx @@ -1,11 +1,8 @@ import { useCallback, useEffect } from 'react' -import { - Status, - accountSelectors, - useDeleteDeveloperApp, - Name -} from '@audius/common' +import { useDeleteDeveloperApp } from '@audius/common/api' +import { Name, Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Button, ButtonType, ModalFooter } from '@audius/stems' import { useSelector } from 'common/hooks/useSelector' diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppListItem.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppListItem.tsx index 334e33ac24b..8b08fdfb925 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppListItem.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppListItem.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import { DeveloperApp } from '@audius/common' +import { DeveloperApp } from '@audius/common/api' import { IconButton, IconKebabHorizontal, diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppsSettingsModal.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppsSettingsModal.tsx index 97df62b3431..a61ae4d459d 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppsSettingsModal.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/DeveloperAppsSettingsModal.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { DeveloperApp } from '@audius/common' +import { DeveloperApp } from '@audius/common/api' import { Modal, ModalHeader, diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/YourAppsPage.tsx b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/YourAppsPage.tsx index d10810f5118..bb32f7dd8cf 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/YourAppsPage.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/YourAppsPage.tsx @@ -1,4 +1,6 @@ -import { Status, accountSelectors, useGetDeveloperApps } from '@audius/common' +import { useGetDeveloperApps } from '@audius/common/api' +import { Status } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Button, ButtonSize, diff --git a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/types.ts b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/types.ts index d3106071449..f819f99d75a 100644 --- a/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/types.ts +++ b/packages/web/src/pages/settings-page/components/desktop/DeveloperApps/types.ts @@ -1,4 +1,4 @@ -import { DeveloperApp } from '@audius/common' +import { DeveloperApp } from '@audius/common/api' export enum CreateAppsPages { YOUR_APPS = 'your_apps', diff --git a/packages/web/src/pages/settings-page/components/desktop/NotificationSettings.tsx b/packages/web/src/pages/settings-page/components/desktop/NotificationSettings.tsx index 70e00bd874e..d31dfff480f 100644 --- a/packages/web/src/pages/settings-page/components/desktop/NotificationSettings.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/NotificationSettings.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { FeatureFlags } from '@audius/common/services' import { - FeatureFlags, - Notifications, BrowserNotificationSetting, - EmailFrequency -} from '@audius/common' + EmailFrequency, + Notifications +} from '@audius/common/store' import { Modal, SegmentedControl } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/settings-page/components/desktop/SettingsPage.tsx b/packages/web/src/pages/settings-page/components/desktop/SettingsPage.tsx index eeacfd09c8c..77fa4fe7fc4 100644 --- a/packages/web/src/pages/settings-page/components/desktop/SettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/SettingsPage.tsx @@ -1,20 +1,17 @@ import { useCallback, useEffect, useMemo, useState } from 'react' +import { OS, Theme, ID, ProfilePictureSizes } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - ID, - ProfilePictureSizes, - OS, - Theme, - InstagramProfile, - TwitterProfile, - Notifications, + settingsPageSelectors, BrowserNotificationSetting, EmailFrequency, + InstagramProfile, + TwitterProfile, TikTokProfile, - FeatureFlags, - removeNullable, - settingsPageSelectors -} from '@audius/common' + Notifications +} from '@audius/common/store' +import { removeNullable } from '@audius/common/utils' import { IconAppearance } from '@audius/harmony' import { Modal, diff --git a/packages/web/src/pages/settings-page/components/desktop/VerificationModal.tsx b/packages/web/src/pages/settings-page/components/desktop/VerificationModal.tsx index c47d786dc91..ebdf7379376 100644 --- a/packages/web/src/pages/settings-page/components/desktop/VerificationModal.tsx +++ b/packages/web/src/pages/settings-page/components/desktop/VerificationModal.tsx @@ -1,17 +1,19 @@ import { useCallback, useState } from 'react' import { - ID, Name, - ProfilePictureSizes, SquareSizes, Status, - BooleanKeys, - TwitterProfile, - InstagramProfile, + ID, + ProfilePictureSizes +} from '@audius/common/models' +import { BooleanKeys } from '@audius/common/services' +import { musicConfettiActions, + InstagramProfile, + TwitterProfile, TikTokProfile -} from '@audius/common' +} from '@audius/common/store' import { Modal, Button, ButtonType, IconNote, ButtonSize } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/settings-page/components/mobile/AccountSettingsPage.tsx b/packages/web/src/pages/settings-page/components/mobile/AccountSettingsPage.tsx index af0fc81b2f6..b5b0078cc6a 100644 --- a/packages/web/src/pages/settings-page/components/mobile/AccountSettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/AccountSettingsPage.tsx @@ -1,6 +1,6 @@ import { useState, useContext, useCallback } from 'react' -import { Name, SquareSizes } from '@audius/common' +import { Name, SquareSizes } from '@audius/common/models' import { Modal, Button, ButtonType, IconMail, IconSignOut } from '@audius/stems' import cn from 'classnames' import { debounce } from 'lodash' diff --git a/packages/web/src/pages/settings-page/components/mobile/ChangePasswordPage.tsx b/packages/web/src/pages/settings-page/components/mobile/ChangePasswordPage.tsx index 0b986d6cdae..935c4a58a10 100644 --- a/packages/web/src/pages/settings-page/components/mobile/ChangePasswordPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/ChangePasswordPage.tsx @@ -1,11 +1,11 @@ import { useCallback, useContext, useEffect } from 'react' +import { Name } from '@audius/common/models' import { - Name, - ChangePasswordPageStep, changePasswordSelectors, - changePasswordActions -} from '@audius/common' + changePasswordActions, + ChangePasswordPageStep +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import { make, TrackEvent } from 'common/store/analytics/actions' diff --git a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx index dd574ab3e99..1cbc853ed52 100644 --- a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx @@ -1,4 +1,4 @@ -import { EmailFrequency } from '@audius/common' +import { EmailFrequency } from '@audius/common/store' import { SegmentedControl } from '@audius/stems' import GroupableList from 'components/groupable-list/GroupableList' diff --git a/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx b/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx index a916591eb94..93f34655ce7 100644 --- a/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx @@ -1,19 +1,21 @@ import { useContext, useEffect, FC } from 'react' import { - ID, SquareSizes, - ProfilePictureSizes, Theme, + ID, + ProfilePictureSizes +} from '@audius/common/models' +import { + BrowserNotificationSetting, + PushNotificationSetting, + EmailFrequency, InstagramProfile, TwitterProfile, + TikTokProfile, Notifications, - EmailFrequency, - BrowserNotificationSetting, - PushNotificationSetting, - PushNotifications, - TikTokProfile -} from '@audius/common' + PushNotifications +} from '@audius/common/store' import { SegmentedControl } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/settings-page/components/mobile/VerificationPage.tsx b/packages/web/src/pages/settings-page/components/mobile/VerificationPage.tsx index 8a6e3bad240..ccaafefa022 100644 --- a/packages/web/src/pages/settings-page/components/mobile/VerificationPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/VerificationPage.tsx @@ -1,16 +1,18 @@ import { useCallback, useState } from 'react' import { - ID, Name, - ProfilePictureSizes, SquareSizes, Status, - BooleanKeys, + ID, + ProfilePictureSizes +} from '@audius/common/models' +import { BooleanKeys } from '@audius/common/services' +import { InstagramProfile, TwitterProfile, TikTokProfile -} from '@audius/common' +} from '@audius/common/store' import { Button, ButtonSize, diff --git a/packages/web/src/pages/settings-page/store/errorSagas.ts b/packages/web/src/pages/settings-page/store/errorSagas.ts index f9c5335ea8d..7850959e0dd 100644 --- a/packages/web/src/pages/settings-page/store/errorSagas.ts +++ b/packages/web/src/pages/settings-page/store/errorSagas.ts @@ -1,4 +1,4 @@ -import { settingsPageActions as actions } from '@audius/common' +import { settingsPageActions as actions } from '@audius/common/store' import { createErrorSagas } from 'utils/errorSagas' diff --git a/packages/web/src/pages/settings-page/store/sagas.ts b/packages/web/src/pages/settings-page/store/sagas.ts index 4b861388de9..0f36963e1e5 100644 --- a/packages/web/src/pages/settings-page/store/sagas.ts +++ b/packages/web/src/pages/settings-page/store/sagas.ts @@ -1,11 +1,11 @@ +import { Name } from '@audius/common/models' import { - Name, - getErrorMessage, - settingsPageActions as actions, settingsPageSelectors, + settingsPageActions as actions, BrowserNotificationSetting, getContext -} from '@audius/common' +} from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { select, call, put, takeEvery } from 'typed-redux-saga' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/pages/settings-page/store/selectors.ts b/packages/web/src/pages/settings-page/store/selectors.ts index 89a3a93ff4a..e5ae3d34b90 100644 --- a/packages/web/src/pages/settings-page/store/selectors.ts +++ b/packages/web/src/pages/settings-page/store/selectors.ts @@ -1,4 +1,4 @@ -import { CommonState } from '@audius/common' +import { CommonState } from '@audius/common/store' export const getBrowserNotificationSettings = (state: CommonState) => { return state.pages.settings.browserNotifications diff --git a/packages/web/src/pages/sign-in-page/ConfirmEmailPage.tsx b/packages/web/src/pages/sign-in-page/ConfirmEmailPage.tsx index cac1f20eabc..d1576d8450d 100644 --- a/packages/web/src/pages/sign-in-page/ConfirmEmailPage.tsx +++ b/packages/web/src/pages/sign-in-page/ConfirmEmailPage.tsx @@ -1,11 +1,11 @@ import { useCallback, useContext, useEffect, useState } from 'react' +import { confirmEmailMessages } from '@audius/common/messages' import { - confirmEmailErrorMessages, confirmEmailSchema, formatOtp, - confirmEmailMessages as messages -} from '@audius/common' + confirmEmailErrorMessages +} from '@audius/common/schemas' import { Text, TextLink } from '@audius/harmony' import { Form, Formik, useField } from 'formik' import { useDispatch } from 'react-redux' @@ -58,10 +58,13 @@ export const ConfirmEmailPage = () => { validationSchema={ConfirmEmailSchema} > - + - {messages.noEmailNotice} + {confirmEmailMessages.noEmailNotice} @@ -86,8 +89,8 @@ const VerificationCodeField = () => { return ( ) @@ -102,13 +105,13 @@ const ResendCodeLink = () => { const handleClick = useCallback(() => { dispatch(signIn(email, password)) - toast(messages.resentToast) + toast(confirmEmailMessages.resentToast) setHasResendCode(true) }, [dispatch, email, password, toast]) return ( - {messages.resendCode} + {confirmEmailMessages.resendCode} ) } diff --git a/packages/web/src/pages/sign-in-page/SignInPage.tsx b/packages/web/src/pages/sign-in-page/SignInPage.tsx index f5e9815ad01..e49fd934601 100644 --- a/packages/web/src/pages/sign-in-page/SignInPage.tsx +++ b/packages/web/src/pages/sign-in-page/SignInPage.tsx @@ -1,10 +1,7 @@ import { useCallback, useEffect, useState } from 'react' -import { - signInPageMessages as messages, - signInErrorMessages, - signInSchema -} from '@audius/common' +import { signInPageMessages } from '@audius/common/messages' +import { signInSchema, signInErrorMessages } from '@audius/common/schemas' import { Flex, IconAudiusLogoHorizontalColor, @@ -112,7 +109,11 @@ export const SignInPage = () => { /> )} - + @@ -124,7 +125,7 @@ export const SignInPage = () => { isLoading={signInStatus === 'loading'} fullWidth > - {messages.signIn} + {signInPageMessages.signIn} {!isMobile ? : null} { setShowForgotPassword(true) }} > - {messages.forgotPassword} + {signInPageMessages.forgotPassword} {!isMobile ? ( ) : null} @@ -166,5 +167,10 @@ const SignInPasswordField = () => { } }, [setError, signInError]) - return + return ( + + ) } diff --git a/packages/web/src/pages/sign-in-page/SignInRootPage.tsx b/packages/web/src/pages/sign-in-page/SignInRootPage.tsx index 2e5ec05fc7b..9c9980fc49f 100644 --- a/packages/web/src/pages/sign-in-page/SignInRootPage.tsx +++ b/packages/web/src/pages/sign-in-page/SignInRootPage.tsx @@ -1,4 +1,4 @@ -import { signInPageMessages as messages } from '@audius/common' +import { signInPageMessages } from '@audius/common/messages' import { Helmet } from 'react-helmet' import { Redirect, Route, Switch } from 'react-router-dom' import { useFirstMountState } from 'react-use' @@ -15,8 +15,8 @@ export const SignInRootPage = () => { return ( <> - {messages.metaTitle} - + {signInPageMessages.metaTitle} + diff --git a/packages/web/src/pages/sign-on/SignOn.tsx b/packages/web/src/pages/sign-on/SignOn.tsx index a719692bba7..70fabaca320 100644 --- a/packages/web/src/pages/sign-on/SignOn.tsx +++ b/packages/web/src/pages/sign-on/SignOn.tsx @@ -1,7 +1,7 @@ import type { ComponentType } from 'react' import { useEffect, useState } from 'react' -import { accountSelectors } from '@audius/common' +import { accountSelectors } from '@audius/common/store' import { replace as replaceRoute } from 'connected-react-router' import { connect } from 'react-redux' import { withRouter, RouteComponentProps } from 'react-router-dom' diff --git a/packages/web/src/pages/sign-on/SignOnProvider.tsx b/packages/web/src/pages/sign-on/SignOnProvider.tsx index 95980ddc26f..8c01106260d 100644 --- a/packages/web/src/pages/sign-on/SignOnProvider.tsx +++ b/packages/web/src/pages/sign-on/SignOnProvider.tsx @@ -1,16 +1,14 @@ import { Component, ComponentType } from 'react' +import { Name, ID, User } from '@audius/common/models' import { - ID, - Name, - User, + accountActions, accountSelectors, InstagramProfile, - Image, TwitterProfile, - accountActions, - TikTokProfile -} from '@audius/common' + TikTokProfile, + Image +} from '@audius/common/store' import { push as pushRoute, replace as replaceRoute, diff --git a/packages/web/src/pages/sign-on/components/CompleteProfileWithSocial.tsx b/packages/web/src/pages/sign-on/components/CompleteProfileWithSocial.tsx index a3e5d5f281c..453b28eaeeb 100644 --- a/packages/web/src/pages/sign-on/components/CompleteProfileWithSocial.tsx +++ b/packages/web/src/pages/sign-on/components/CompleteProfileWithSocial.tsx @@ -1,11 +1,11 @@ import { useCallback } from 'react' +import { BooleanKeys } from '@audius/common/services' import { - BooleanKeys, InstagramProfile, - TikTokProfile, - TwitterProfile -} from '@audius/common' + TwitterProfile, + TikTokProfile +} from '@audius/common/store' import { IconImage, IconUser, IconVerified } from '@audius/stems' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web diff --git a/packages/web/src/pages/sign-on/components/ProfileForm.tsx b/packages/web/src/pages/sign-on/components/ProfileForm.tsx index b5bfedf3eb7..8bddee65888 100644 --- a/packages/web/src/pages/sign-on/components/ProfileForm.tsx +++ b/packages/web/src/pages/sign-on/components/ProfileForm.tsx @@ -1,11 +1,11 @@ import { KeyboardEventHandler, useState } from 'react' +import { imageProfilePicEmpty as profilePicEmpty } from '@audius/common/assets' import { - imageProfilePicEmpty as profilePicEmpty, - MAX_DISPLAY_NAME_LENGTH, MAX_HANDLE_LENGTH, - getErrorMessage -} from '@audius/common' + MAX_DISPLAY_NAME_LENGTH +} from '@audius/common/services' +import { getErrorMessage } from '@audius/common/utils' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web diff --git a/packages/web/src/pages/sign-on/components/ProfilePage.tsx b/packages/web/src/pages/sign-on/components/ProfilePage.tsx index 04291f9c0c9..0f9fa5861b4 100644 --- a/packages/web/src/pages/sign-on/components/ProfilePage.tsx +++ b/packages/web/src/pages/sign-on/components/ProfilePage.tsx @@ -1,14 +1,16 @@ import { useState, useCallback, KeyboardEvent, useContext } from 'react' import { - Image, + formatTwitterProfile, + formatInstagramProfile, + formatTikTokProfile +} from '@audius/common/services' +import { InstagramProfile, TwitterProfile, - formatInstagramProfile, - formatTwitterProfile, - formatTikTokProfile, - TikTokProfile -} from '@audius/common' + TikTokProfile, + Image +} from '@audius/common/store' import cn from 'classnames' import IconCaretLeft from 'assets/img/iconCaretLeft.svg' diff --git a/packages/web/src/pages/sign-on/components/desktop/FollowPage.tsx b/packages/web/src/pages/sign-on/components/desktop/FollowPage.tsx index ae68c640113..407c6583cae 100644 --- a/packages/web/src/pages/sign-on/components/desktop/FollowPage.tsx +++ b/packages/web/src/pages/sign-on/components/desktop/FollowPage.tsx @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from 'react' -import { ID, User } from '@audius/common' +import { ID, User } from '@audius/common/models' import { Button, ButtonType, IconArrow, Scrollbar } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/sign-on/components/desktop/MetaMaskModal.jsx b/packages/web/src/pages/sign-on/components/desktop/MetaMaskModal.jsx index 8b3b3f8cc27..59ac98154a6 100644 --- a/packages/web/src/pages/sign-on/components/desktop/MetaMaskModal.jsx +++ b/packages/web/src/pages/sign-on/components/desktop/MetaMaskModal.jsx @@ -1,6 +1,6 @@ import { Component } from 'react' -import { BackendUtils as Utils } from '@audius/common' +import { BackendUtils as Utils } from '@audius/common/services' import { Box, Text } from '@audius/harmony' import { Button, ButtonType } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/sign-on/components/desktop/PasswordPage.jsx b/packages/web/src/pages/sign-on/components/desktop/PasswordPage.jsx index 087577eaa4f..408b4387320 100644 --- a/packages/web/src/pages/sign-on/components/desktop/PasswordPage.jsx +++ b/packages/web/src/pages/sign-on/components/desktop/PasswordPage.jsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' -import { commonPasswordCheck } from '@audius/common' +import { commonPasswordCheck } from '@audius/common/utils' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' import PropTypes from 'prop-types' diff --git a/packages/web/src/pages/sign-on/components/desktop/SignInPage.tsx b/packages/web/src/pages/sign-on/components/desktop/SignInPage.tsx index b2e0b7469fb..e76840066a5 100644 --- a/packages/web/src/pages/sign-on/components/desktop/SignInPage.tsx +++ b/packages/web/src/pages/sign-on/components/desktop/SignInPage.tsx @@ -6,7 +6,7 @@ import { KeyboardEvent } from 'react' -import { useInstanceVar } from '@audius/common' +import { useInstanceVar } from '@audius/common/hooks' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web diff --git a/packages/web/src/pages/sign-on/components/desktop/SignOnPage.tsx b/packages/web/src/pages/sign-on/components/desktop/SignOnPage.tsx index 856d6ea35be..d6d640a994f 100644 --- a/packages/web/src/pages/sign-on/components/desktop/SignOnPage.tsx +++ b/packages/web/src/pages/sign-on/components/desktop/SignOnPage.tsx @@ -1,15 +1,13 @@ import { Suspense, useEffect } from 'react' +import { Status, ID, User } from '@audius/common/models' import { - ID, - Status, - User, accountSelectors, - Image, InstagramProfile, TwitterProfile, - TikTokProfile -} from '@audius/common' + TikTokProfile, + Image +} from '@audius/common/store' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { animated } from 'react-spring' diff --git a/packages/web/src/pages/sign-on/components/mobile/FollowPage.tsx b/packages/web/src/pages/sign-on/components/mobile/FollowPage.tsx index f69e85b59a4..e21d96a110e 100644 --- a/packages/web/src/pages/sign-on/components/mobile/FollowPage.tsx +++ b/packages/web/src/pages/sign-on/components/mobile/FollowPage.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from 'react' -import { ID, User } from '@audius/common' +import { ID, User } from '@audius/common/models' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/sign-on/components/mobile/PasswordPage.tsx b/packages/web/src/pages/sign-on/components/mobile/PasswordPage.tsx index 3a5bf4be7d2..a8fc4ff250f 100644 --- a/packages/web/src/pages/sign-on/components/mobile/PasswordPage.tsx +++ b/packages/web/src/pages/sign-on/components/mobile/PasswordPage.tsx @@ -1,6 +1,6 @@ import { useState, useCallback } from 'react' -import { commonPasswordCheck } from '@audius/common' +import { commonPasswordCheck } from '@audius/common/utils' import { Button, ButtonType, IconArrow } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/sign-on/components/mobile/SignOnPage.tsx b/packages/web/src/pages/sign-on/components/mobile/SignOnPage.tsx index 2ff9514ce21..e5e33c3e302 100644 --- a/packages/web/src/pages/sign-on/components/mobile/SignOnPage.tsx +++ b/packages/web/src/pages/sign-on/components/mobile/SignOnPage.tsx @@ -1,13 +1,12 @@ import { useEffect } from 'react' +import { ID, User } from '@audius/common/models' import { - ID, - User, - Image, InstagramProfile, TwitterProfile, - TikTokProfile -} from '@audius/common' + TikTokProfile, + Image +} from '@audius/common/store' import cn from 'classnames' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { animated } from 'react-spring' diff --git a/packages/web/src/pages/sign-up-page/components/AccountHeader.tsx b/packages/web/src/pages/sign-up-page/components/AccountHeader.tsx index 7823b4fb1b4..906151c0e39 100644 --- a/packages/web/src/pages/sign-up-page/components/AccountHeader.tsx +++ b/packages/web/src/pages/sign-up-page/components/AccountHeader.tsx @@ -1,4 +1,5 @@ -import { Name, SquareSizes, accountSelectors } from '@audius/common' +import { Name, SquareSizes } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Avatar, Box, diff --git a/packages/web/src/pages/sign-up-page/components/CoverPhotoBanner.tsx b/packages/web/src/pages/sign-up-page/components/CoverPhotoBanner.tsx index 99659ef3d1b..301da2c08c3 100644 --- a/packages/web/src/pages/sign-up-page/components/CoverPhotoBanner.tsx +++ b/packages/web/src/pages/sign-up-page/components/CoverPhotoBanner.tsx @@ -1,4 +1,5 @@ -import { SquareSizes, WidthSizes, accountSelectors } from '@audius/common' +import { SquareSizes, WidthSizes } from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' import { Box, useTheme, IconImage, IconButton } from '@audius/harmony' import { diff --git a/packages/web/src/pages/sign-up-page/components/EmailField.tsx b/packages/web/src/pages/sign-up-page/components/EmailField.tsx index 2a41f4eb01b..6210efb6728 100644 --- a/packages/web/src/pages/sign-up-page/components/EmailField.tsx +++ b/packages/web/src/pages/sign-up-page/components/EmailField.tsx @@ -1,9 +1,7 @@ import { ChangeEvent } from 'react' -import { - emailSchemaMessages, - createEmailPageMessages as messages -} from '@audius/common' +import { createEmailPageMessages } from '@audius/common/messages' +import { emailSchemaMessages } from '@audius/common/schemas' import { Hint, IconError, TextLink } from '@audius/harmony' import { useField, useFormikContext } from 'formik' import { useDispatch } from 'react-redux' @@ -29,7 +27,7 @@ export const EmailField = (props: Partial) => { { const signInLink = ( - {messages.signIn} + {createEmailPageMessages.signIn} ) diff --git a/packages/web/src/pages/sign-up-page/components/FollowArtistCard.tsx b/packages/web/src/pages/sign-up-page/components/FollowArtistCard.tsx index 710faf5106f..31f1f0d59a3 100644 --- a/packages/web/src/pages/sign-up-page/components/FollowArtistCard.tsx +++ b/packages/web/src/pages/sign-up-page/components/FollowArtistCard.tsx @@ -1,6 +1,7 @@ import { HTMLProps, useContext } from 'react' -import { Name, UserMetadata, WidthSizes, formatCount } from '@audius/common' +import { Name, WidthSizes, UserMetadata } from '@audius/common/models' +import { formatCount } from '@audius/common/utils' import { Box, Divider, diff --git a/packages/web/src/pages/sign-up-page/components/HandleField.tsx b/packages/web/src/pages/sign-up-page/components/HandleField.tsx index 91e5594253f..e085ed9831b 100644 --- a/packages/web/src/pages/sign-up-page/components/HandleField.tsx +++ b/packages/web/src/pages/sign-up-page/components/HandleField.tsx @@ -1,12 +1,12 @@ import { Ref, forwardRef, useCallback, useContext } from 'react' +import { useIsWaitingForValidation } from '@audius/common/hooks' import { - MAX_HANDLE_LENGTH, socialMediaMessages, - pickHandleErrorMessages, - pickHandlePageMessages as messages, - useIsWaitingForValidation -} from '@audius/common' + pickHandlePageMessages as messages +} from '@audius/common/messages' +import { pickHandleErrorMessages } from '@audius/common/schemas' +import { MAX_HANDLE_LENGTH } from '@audius/common/services' import { TextLink } from '@audius/harmony' import { IconCheck } from '@audius/stems' import { useField } from 'formik' diff --git a/packages/web/src/pages/sign-up-page/components/ImageField.tsx b/packages/web/src/pages/sign-up-page/components/ImageField.tsx index 305905dbf73..59be869a21b 100644 --- a/packages/web/src/pages/sign-up-page/components/ImageField.tsx +++ b/packages/web/src/pages/sign-up-page/components/ImageField.tsx @@ -1,6 +1,7 @@ import { ReactNode, useCallback } from 'react' -import { Nullable, finishProfilePageMessages as messages } from '@audius/common' +import { finishProfilePageMessages as messages } from '@audius/common/messages' +import { Nullable } from '@audius/common/utils' import cn from 'classnames' import { useField } from 'formik' import ReactDropzone, { DropFilesEventHandler } from 'react-dropzone' diff --git a/packages/web/src/pages/sign-up-page/components/PasswordCompletionChecklist.tsx b/packages/web/src/pages/sign-up-page/components/PasswordCompletionChecklist.tsx index 51f9810c0ef..d0b8a9f474e 100644 --- a/packages/web/src/pages/sign-up-page/components/PasswordCompletionChecklist.tsx +++ b/packages/web/src/pages/sign-up-page/components/PasswordCompletionChecklist.tsx @@ -1,8 +1,8 @@ import { - passwordSchema, createPasswordPageMessages, - type CompletionChecklistType -} from '@audius/common' + CompletionChecklistType +} from '@audius/common/messages' +import { passwordSchema } from '@audius/common/schemas' import { CompletionCheck, Flex, Text } from '@audius/harmony' import { useField } from 'formik' import { useAsync } from 'react-use' diff --git a/packages/web/src/pages/sign-up-page/components/SignUpPolicyText.tsx b/packages/web/src/pages/sign-up-page/components/SignUpPolicyText.tsx index 0d45dea1ed0..6d4fdcf1b3a 100644 --- a/packages/web/src/pages/sign-up-page/components/SignUpPolicyText.tsx +++ b/packages/web/src/pages/sign-up-page/components/SignUpPolicyText.tsx @@ -1,4 +1,4 @@ -import { signUpPolicyMessages as messages } from '@audius/common' +import { signUpPolicyMessages } from '@audius/common/messages' import { Text, TextLink } from '@audius/harmony' import { PRIVACY_POLICY, TERMS_OF_SERVICE } from 'utils/route' @@ -6,13 +6,13 @@ import { PRIVACY_POLICY, TERMS_OF_SERVICE } from 'utils/route' export const SignUpAgreementText = () => { return ( - {messages.agreeTo} + {signUpPolicyMessages.agreeTo} - {messages.termsOfService} + {signUpPolicyMessages.termsOfService} - {messages.and} + {signUpPolicyMessages.and} - {messages.privacyPolicy} + {signUpPolicyMessages.privacyPolicy} ) diff --git a/packages/web/src/pages/sign-up-page/components/SignUpWithMetaMaskButton.tsx b/packages/web/src/pages/sign-up-page/components/SignUpWithMetaMaskButton.tsx index 6c92b0f1795..37ec8995564 100644 --- a/packages/web/src/pages/sign-up-page/components/SignUpWithMetaMaskButton.tsx +++ b/packages/web/src/pages/sign-up-page/components/SignUpWithMetaMaskButton.tsx @@ -1,6 +1,7 @@ import { useContext, useState } from 'react' -import { AudiusQueryContext, signUpFetch } from '@audius/common' +import { signUpFetch } from '@audius/common/api' +import { AudiusQueryContext } from '@audius/common/audius-query' import { Button, IconMetamask } from '@audius/harmony' import { useFormikContext } from 'formik' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/sign-up-page/components/SignupFlowInstagramAuth.tsx b/packages/web/src/pages/sign-up-page/components/SignupFlowInstagramAuth.tsx index 40ba8a52465..f02438c852d 100644 --- a/packages/web/src/pages/sign-up-page/components/SignupFlowInstagramAuth.tsx +++ b/packages/web/src/pages/sign-up-page/components/SignupFlowInstagramAuth.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react' -import { InstagramProfile } from '@audius/common' +import { InstagramProfile } from '@audius/common/store' import InstagramAuth from 'components/instagram-auth/InstagramAuth' diff --git a/packages/web/src/pages/sign-up-page/components/SignupFlowTikTokAuth.tsx b/packages/web/src/pages/sign-up-page/components/SignupFlowTikTokAuth.tsx index 3ba19f15e12..83d48f98ef0 100644 --- a/packages/web/src/pages/sign-up-page/components/SignupFlowTikTokAuth.tsx +++ b/packages/web/src/pages/sign-up-page/components/SignupFlowTikTokAuth.tsx @@ -1,6 +1,6 @@ import { ReactElement } from 'react' -import { TikTokProfile } from '@audius/common' +import { TikTokProfile } from '@audius/common/store' import { TikTokAuth } from 'components/tiktok-auth/TikTokAuthButton' diff --git a/packages/web/src/pages/sign-up-page/components/SignupFlowTwitterAuth.tsx b/packages/web/src/pages/sign-up-page/components/SignupFlowTwitterAuth.tsx index 6d018318fa3..cd60179f816 100644 --- a/packages/web/src/pages/sign-up-page/components/SignupFlowTwitterAuth.tsx +++ b/packages/web/src/pages/sign-up-page/components/SignupFlowTwitterAuth.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react' -import { TwitterProfile } from '@audius/common' +import { TwitterProfile } from '@audius/common/store' import TwitterAuth from 'components/twitter-auth/TwitterAuth' diff --git a/packages/web/src/pages/sign-up-page/components/SocialMediaLoginOptions.tsx b/packages/web/src/pages/sign-up-page/components/SocialMediaLoginOptions.tsx index 0cf745f77a6..15c9f82427a 100644 --- a/packages/web/src/pages/sign-up-page/components/SocialMediaLoginOptions.tsx +++ b/packages/web/src/pages/sign-up-page/components/SocialMediaLoginOptions.tsx @@ -1,8 +1,7 @@ import { useContext } from 'react' -import { platform } from 'os' - -import { BooleanKeys, socialMediaMessages } from '@audius/common' +import { socialMediaMessages } from '@audius/common/messages' +import { BooleanKeys } from '@audius/common/services' import { Box, Flex, SocialButton } from '@audius/harmony' import { ToastContext } from 'components/toast/ToastContext' diff --git a/packages/web/src/pages/sign-up-page/components/layout.tsx b/packages/web/src/pages/sign-up-page/components/layout.tsx index de9baae78b6..c4c798a15fa 100644 --- a/packages/web/src/pages/sign-up-page/components/layout.tsx +++ b/packages/web/src/pages/sign-up-page/components/layout.tsx @@ -8,7 +8,7 @@ import { RefObject } from 'react' -import { Maybe } from '@audius/common' +import { Maybe } from '@audius/common/utils' import { Box, BoxProps, diff --git a/packages/web/src/pages/sign-up-page/hooks/socialMediaLogin.ts b/packages/web/src/pages/sign-up-page/hooks/socialMediaLogin.ts index 46208e05419..e9ebf684b94 100644 --- a/packages/web/src/pages/sign-up-page/hooks/socialMediaLogin.ts +++ b/packages/web/src/pages/sign-up-page/hooks/socialMediaLogin.ts @@ -1,16 +1,18 @@ import { useContext } from 'react' +import { AudiusQueryContext } from '@audius/common/audius-query' +import { Name } from '@audius/common/models' +import { pickHandleSchema } from '@audius/common/schemas' import { - AudiusQueryContext, - formatInstagramProfile, - formatTikTokProfile, formatTwitterProfile, + formatInstagramProfile, + formatTikTokProfile +} from '@audius/common/services' +import { InstagramProfile, - Name, - pickHandleSchema, - TikTokProfile, - TwitterProfile -} from '@audius/common' + TwitterProfile, + TikTokProfile +} from '@audius/common/store' import { useDispatch } from 'react-redux' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/pages/sign-up-page/hooks/useSocialMediaLoader.ts b/packages/web/src/pages/sign-up-page/hooks/useSocialMediaLoader.ts index 441c3818595..618181e21f2 100644 --- a/packages/web/src/pages/sign-up-page/hooks/useSocialMediaLoader.ts +++ b/packages/web/src/pages/sign-up-page/hooks/useSocialMediaLoader.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { useDispatch } from 'react-redux' import { AnyAction } from 'redux' diff --git a/packages/web/src/pages/sign-up-page/pages/CreateEmailPage.tsx b/packages/web/src/pages/sign-up-page/pages/CreateEmailPage.tsx index 61431d25e39..68a22925353 100644 --- a/packages/web/src/pages/sign-up-page/pages/CreateEmailPage.tsx +++ b/packages/web/src/pages/sign-up-page/pages/CreateEmailPage.tsx @@ -1,10 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - emailSchema, - createEmailPageMessages as messages, - useAudiusQueryContext -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { createEmailPageMessages } from '@audius/common/messages' +import { emailSchema } from '@audius/common/schemas' import { Box, Button, @@ -104,7 +102,7 @@ export const CreateEmailPage = () => { const signInLink = ( - {messages.signIn} + {createEmailPageMessages.signIn} ) @@ -135,11 +133,11 @@ export const CreateEmailPage = () => { )} - {messages.subHeader.line1} -
{messages.subHeader.line2} + {createEmailPageMessages.subHeader.line1} +
{createEmailPageMessages.subHeader.line2} } tag='h1' @@ -149,7 +147,7 @@ export const CreateEmailPage = () => { - {messages.socialsDividerText} + {createEmailPageMessages.socialsDividerText} { iconRight={IconArrowRight} isLoading={isSubmitting} > - {messages.signUp} + {createEmailPageMessages.signUp} { size={isMobile ? 'm' : 'l'} textAlign={isMobile ? 'center' : undefined} > - {messages.haveAccount} {signInLink} + {createEmailPageMessages.haveAccount} {signInLink}
{!isMobile && window.ethereum ? ( - {messages.metaMaskNotRecommended}{' '} - {messages.learnMore} + {createEmailPageMessages.metaMaskNotRecommended}{' '} + + {createEmailPageMessages.learnMore} + ) : null} diff --git a/packages/web/src/pages/sign-up-page/pages/CreateLoginDetails.tsx b/packages/web/src/pages/sign-up-page/pages/CreateLoginDetails.tsx index fcc142a54ba..4b1a2c8cda3 100644 --- a/packages/web/src/pages/sign-up-page/pages/CreateLoginDetails.tsx +++ b/packages/web/src/pages/sign-up-page/pages/CreateLoginDetails.tsx @@ -1,10 +1,8 @@ import { useCallback, useMemo } from 'react' -import { - emailSchema, - createLoginDetailsPageMessages as messages, - useAudiusQueryContext -} from '@audius/common' +import { useAudiusQueryContext } from '@audius/common/audius-query' +import { createLoginDetailsPageMessages } from '@audius/common/messages' +import { emailSchema } from '@audius/common/schemas' import { Flex, IconVerified, useTheme } from '@audius/harmony' import { Form, Formik, useField } from 'formik' import { useDispatch, useSelector } from 'react-redux' @@ -95,13 +93,13 @@ export const CreateLoginDetailsPage = () => { {({ isValid, dirty }) => ( @{handleField.value} @@ -114,10 +112,13 @@ export const CreateLoginDetailsPage = () => { } /> - + diff --git a/packages/web/src/pages/sign-up-page/pages/CreatePasswordPage.tsx b/packages/web/src/pages/sign-up-page/pages/CreatePasswordPage.tsx index dbd1dc2a047..73adf0f30c4 100644 --- a/packages/web/src/pages/sign-up-page/pages/CreatePasswordPage.tsx +++ b/packages/web/src/pages/sign-up-page/pages/CreatePasswordPage.tsx @@ -1,9 +1,7 @@ import { useCallback, useRef } from 'react' -import { - createPasswordPageMessages as messages, - passwordSchema -} from '@audius/common' +import { createPasswordPageMessages } from '@audius/common/messages' +import { passwordSchema } from '@audius/common/schemas' import { Flex } from '@audius/harmony' import { Form, Formik } from 'formik' import { useDispatch, useSelector } from 'react-redux' @@ -61,12 +59,12 @@ export const CreatePasswordPage = () => { autoFocusInputRef={passwordInputRef} > diff --git a/packages/web/src/pages/sign-up-page/pages/FinishProfilePage.tsx b/packages/web/src/pages/sign-up-page/pages/FinishProfilePage.tsx index 089bb8ce4d0..cde87505a17 100644 --- a/packages/web/src/pages/sign-up-page/pages/FinishProfilePage.tsx +++ b/packages/web/src/pages/sign-up-page/pages/FinishProfilePage.tsx @@ -1,11 +1,9 @@ import { useCallback, useRef } from 'react' -import { - MAX_DISPLAY_NAME_LENGTH, - Name, - finishProfileSchema, - finishProfilePageMessages as messages -} from '@audius/common' +import { finishProfilePageMessages } from '@audius/common/messages' +import { Name } from '@audius/common/models' +import { finishProfileSchema } from '@audius/common/schemas' +import { MAX_DISPLAY_NAME_LENGTH } from '@audius/common/services' import { Flex, Paper, PlainButton, Text, useTheme } from '@audius/harmony' import { Formik, Form, useField, useFormikContext } from 'formik' import { useDispatch, useSelector } from 'react-redux' @@ -49,14 +47,16 @@ const formSchema = toFormikValidationSchema(finishProfileSchema) const ImageUploadErrorText = () => { const { errors } = useFormikContext() let errorText - if (errors.coverPhoto === messages.coverPhotoUploadError) { + if (errors.coverPhoto === finishProfilePageMessages.coverPhotoUploadError) { errorText = errors.coverPhoto } // Profile image error takes priority - if (errors.profileImage === messages.profileImageUploadError) { + if ( + errors.profileImage === finishProfilePageMessages.profileImageUploadError + ) { // If both images have errors, we show a combined error message if (errorText !== undefined) { - errorText = messages.bothImageUploadError + errorText = finishProfilePageMessages.bothImageUploadError } else { errorText = errors.profileImage } @@ -156,8 +156,8 @@ export const FinishProfilePage = () => { ) } - heading={messages.header} - description={messages.description} + heading={finishProfilePageMessages.header} + description={finishProfilePageMessages.description} centered={!isMobile} /> @@ -172,8 +172,8 @@ export const FinishProfilePage = () => { setDisplayName(e.currentTarget.value)} css={(theme) => ({ @@ -190,7 +190,7 @@ export const FinishProfilePage = () => { postfix={ isMobile || isSocialConnected ? null : ( - {messages.goBack} + {finishProfilePageMessages.goBack} ) } @@ -216,7 +216,7 @@ const UploadProfilePhotoHelperText = () => { transition: `opacity ${motion.calm}` }} > - {messages.uploadProfilePhoto} + {finishProfilePageMessages.uploadProfilePhoto} ) } diff --git a/packages/web/src/pages/sign-up-page/pages/PickHandlePage.tsx b/packages/web/src/pages/sign-up-page/pages/PickHandlePage.tsx index 0c09e83fc9b..1aedaaaa28a 100644 --- a/packages/web/src/pages/sign-up-page/pages/PickHandlePage.tsx +++ b/packages/web/src/pages/sign-up-page/pages/PickHandlePage.tsx @@ -1,11 +1,11 @@ import { useCallback, useContext, useMemo, useRef } from 'react' +import { AudiusQueryContext } from '@audius/common/audius-query' import { - socialMediaMessages, - pickHandlePageMessages as messages, - pickHandleSchema, - AudiusQueryContext -} from '@audius/common' + pickHandlePageMessages, + socialMediaMessages +} from '@audius/common/messages' +import { pickHandleSchema } from '@audius/common/schemas' import { Divider, Flex, IconVerified, Paper, Text } from '@audius/harmony' import { Form, Formik } from 'formik' import { useDispatch, useSelector } from 'react-redux' @@ -64,9 +64,9 @@ const SocialMediaSection = (props: SocialMediaSectionProps) => { variant={isMobile ? 'title' : 'heading'} size={isMobile ? 'm' : 's'} > - {messages.claimHandleHeaderPrefix}{' '} + {pickHandlePageMessages.claimHandleHeaderPrefix}{' '} - @{messages.handle} + @{pickHandlePageMessages.handle} {' '} { /> - {messages.claimHandleDescription} + {pickHandlePageMessages.claimHandleDescription} { onCompleteSocialMediaLogin={onCompleteSocialMediaLogin} /> - {messages.claimHandleHeadsUp} + {pickHandlePageMessages.claimHandleHeadsUp} ) @@ -178,8 +178,8 @@ export const PickHandlePage = () => { prefix={ isMobile ? null : } - heading={messages.title} - description={messages.description} + heading={pickHandlePageMessages.title} + description={pickHandlePageMessages.description} centered={!isMobile} /> @@ -196,7 +196,7 @@ export const PickHandlePage = () => { size='s' css={{ textTransform: 'uppercase' }} > - {messages.or} + {pickHandlePageMessages.or} { { { justifyContent={isMobile ? 'flex-start' : 'center'} role='radiogroup' onChange={handleChangeGenre} - aria-label={messages.genresLabel} + aria-label={selectArtistsPageMessages.genresLabel} disableScroll={!isMobile} > {artistGenres.map((genre) => ( @@ -194,7 +195,7 @@ export const SelectArtistsPage = () => { direction='column' > - {messages.pickArtists(currentGenre)} + {selectArtistsPageMessages.pickArtists(currentGenre)} {isLoading || !isMobile ? null : } @@ -223,7 +224,8 @@ export const SelectArtistsPage = () => { }} postfix={ - {messages.selected} {selectedArtists.length || 0}/3 + {selectArtistsPageMessages.selected}{' '} + {selectedArtists.length || 0}/3 } /> diff --git a/packages/web/src/pages/sign-up-page/pages/SelectGenresPage.tsx b/packages/web/src/pages/sign-up-page/pages/SelectGenresPage.tsx index 7fcf383681a..6468f0347af 100644 --- a/packages/web/src/pages/sign-up-page/pages/SelectGenresPage.tsx +++ b/packages/web/src/pages/sign-up-page/pages/SelectGenresPage.tsx @@ -1,12 +1,9 @@ import { MouseEventHandler, useCallback, useState } from 'react' -import { - Genre, - Name, - selectGenresPageMessages as messages, - selectGenresSchema, - selectableGenres -} from '@audius/common' +import { selectGenresPageMessages } from '@audius/common/messages' +import { Name } from '@audius/common/models' +import { selectableGenres, selectGenresSchema } from '@audius/common/schemas' +import { Genre } from '@audius/common/utils' import { Flex } from '@audius/harmony' import { Form, Formik } from 'formik' import { useDispatch, useSelector } from 'react-redux' @@ -90,8 +87,8 @@ export const SelectGenresPage = () => { css={!isMobile ? { maxWidth: '641px' } : undefined} > str ?? '' diff --git a/packages/web/src/pages/trending-page/TrendingPageProvider.jsx b/packages/web/src/pages/trending-page/TrendingPageProvider.jsx index ddfb13b2586..8cef859761c 100644 --- a/packages/web/src/pages/trending-page/TrendingPageProvider.jsx +++ b/packages/web/src/pages/trending-page/TrendingPageProvider.jsx @@ -1,17 +1,16 @@ import { PureComponent } from 'react' +import { Name, TimeRange } from '@audius/common/models' import { - Name, - TimeRange, - GENRES, accountSelectors, lineupSelectors, trendingPageLineupActions, - trendingPageSelectors, trendingPageActions, - playerSelectors, - queueSelectors -} from '@audius/common' + trendingPageSelectors, + queueSelectors, + playerSelectors +} from '@audius/common/store' +import { GENRES } from '@audius/common/utils' import { push as pushRoute, replace as replaceRoute diff --git a/packages/web/src/pages/trending-page/components/RewardsBanner.tsx b/packages/web/src/pages/trending-page/components/RewardsBanner.tsx index 0e26bb2f6c3..11e222e8aa5 100644 --- a/packages/web/src/pages/trending-page/components/RewardsBanner.tsx +++ b/packages/web/src/pages/trending-page/components/RewardsBanner.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { audioRewardsPageActions, TrendingRewardsModalType -} from '@audius/common' +} from '@audius/common/store' import { IconArrow, IconCrown } from '@audius/stems' import cn from 'classnames' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/trending-page/components/desktop/TrendingGenreFilters.tsx b/packages/web/src/pages/trending-page/components/desktop/TrendingGenreFilters.tsx index 008bd43b36c..8b84b334213 100644 --- a/packages/web/src/pages/trending-page/components/desktop/TrendingGenreFilters.tsx +++ b/packages/web/src/pages/trending-page/components/desktop/TrendingGenreFilters.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' -import { getCanonicalName } from '@audius/common' +import { getCanonicalName } from '@audius/common/utils' import IconKebabHorizontal from 'assets/img/iconKebabHorizontal.svg' import SelectablePills from 'components/selectable-pill/SelectablePills' diff --git a/packages/web/src/pages/trending-page/components/desktop/TrendingPageContent.tsx b/packages/web/src/pages/trending-page/components/desktop/TrendingPageContent.tsx index a3ce338f23e..82b5f3c209d 100644 --- a/packages/web/src/pages/trending-page/components/desktop/TrendingPageContent.tsx +++ b/packages/web/src/pages/trending-page/components/desktop/TrendingPageContent.tsx @@ -1,13 +1,8 @@ import { useCallback, useRef, useState } from 'react' -import { - Name, - Status, - TimeRange, - ELECTRONIC_PREFIX, - TRENDING_GENRES, - trendingPageLineupActions -} from '@audius/common' +import { Name, Status, TimeRange } from '@audius/common/models' +import { trendingPageLineupActions } from '@audius/common/store' +import { ELECTRONIC_PREFIX, TRENDING_GENRES } from '@audius/common/utils' import { make, useRecord } from 'common/store/analytics/actions' import Header from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/trending-page/components/mobile/TrendingPageContent.tsx b/packages/web/src/pages/trending-page/components/mobile/TrendingPageContent.tsx index cddfff0dbc0..93488378ed8 100644 --- a/packages/web/src/pages/trending-page/components/mobile/TrendingPageContent.tsx +++ b/packages/web/src/pages/trending-page/components/mobile/TrendingPageContent.tsx @@ -1,6 +1,7 @@ import { useCallback, useContext, useEffect, useMemo } from 'react' -import { Name, TimeRange, trendingPageLineupActions } from '@audius/common' +import { Name, TimeRange } from '@audius/common/models' +import { trendingPageLineupActions } from '@audius/common/store' import { IconAllTime } from '@audius/harmony' import cn from 'classnames' diff --git a/packages/web/src/pages/trending-page/types.ts b/packages/web/src/pages/trending-page/types.ts index f40c2c92054..278d9510b50 100644 --- a/packages/web/src/pages/trending-page/types.ts +++ b/packages/web/src/pages/trending-page/types.ts @@ -1,4 +1,4 @@ -import { ID, Lineup, TimeRange, Track, UID, User } from '@audius/common' +import { TimeRange, ID, UID, Lineup, Track, User } from '@audius/common/models' type ExtraTrendingLineupProps = {} diff --git a/packages/web/src/pages/trending-playlists/TrendingPlaylistPage.tsx b/packages/web/src/pages/trending-playlists/TrendingPlaylistPage.tsx index c6d71005657..49e2a69cdcd 100644 --- a/packages/web/src/pages/trending-playlists/TrendingPlaylistPage.tsx +++ b/packages/web/src/pages/trending-playlists/TrendingPlaylistPage.tsx @@ -3,7 +3,7 @@ import { useEffect } from 'react' import { trendingPlaylistsPageLineupSelectors, trendingPlaylistsPageLineupActions -} from '@audius/common' +} from '@audius/common/store' import { useDispatch } from 'react-redux' import DesktopHeader from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/trending-underground/TrendingUndergroundPage.tsx b/packages/web/src/pages/trending-underground/TrendingUndergroundPage.tsx index d82a01c64a4..69817bbb765 100644 --- a/packages/web/src/pages/trending-underground/TrendingUndergroundPage.tsx +++ b/packages/web/src/pages/trending-underground/TrendingUndergroundPage.tsx @@ -1,9 +1,9 @@ import { useEffect } from 'react' import { - trendingUndergroundPageLineupActions, - trendingUndergroundPageLineupSelectors -} from '@audius/common' + trendingUndergroundPageLineupSelectors, + trendingUndergroundPageLineupActions +} from '@audius/common/store' import { useDispatch } from 'react-redux' import DesktopHeader from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/upload-page/UploadPage.tsx b/packages/web/src/pages/upload-page/UploadPage.tsx index 80f6cc996e0..2180b90f613 100644 --- a/packages/web/src/pages/upload-page/UploadPage.tsx +++ b/packages/web/src/pages/upload-page/UploadPage.tsx @@ -1,11 +1,11 @@ import { createContext, useCallback, useEffect, useState } from 'react' import { - UploadType, - uploadActions, uploadConfirmationModalUIActions, - uploadSelectors -} from '@audius/common' + uploadActions, + uploadSelectors, + UploadType +} from '@audius/common/store' import { useDispatch, useSelector } from 'react-redux' import Header from 'components/header/desktop/Header' diff --git a/packages/web/src/pages/upload-page/components/ShareBanner.tsx b/packages/web/src/pages/upload-page/components/ShareBanner.tsx index 6ceda015da8..db3680f57c9 100644 --- a/packages/web/src/pages/upload-page/components/ShareBanner.tsx +++ b/packages/web/src/pages/upload-page/components/ShareBanner.tsx @@ -1,17 +1,19 @@ import { useCallback, useContext } from 'react' import { - Collection, Name, - ShareContent, ShareSource, + Collection, Track, - UploadType, - User, + User +} from '@audius/common/models' +import { accountSelectors, tracksSocialActions, - usersSocialActions -} from '@audius/common' + usersSocialActions, + UploadType, + ShareContent +} from '@audius/common/store' import { Button, ButtonType, IconLink, IconTwitterBird } from '@audius/stems' import { useDispatch } from 'react-redux' diff --git a/packages/web/src/pages/upload-page/components/TracksPreview.tsx b/packages/web/src/pages/upload-page/components/TracksPreview.tsx index 90ecee45ed2..24b315ccc7d 100644 --- a/packages/web/src/pages/upload-page/components/TracksPreview.tsx +++ b/packages/web/src/pages/upload-page/components/TracksPreview.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { UploadType } from '@audius/common' +import { UploadType } from '@audius/common/store' import { Button } from '@audius/harmony' import { IconCaretRight, Scrollbar, SegmentedControl } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/upload-page/fields/AccessAndSaleField.tsx b/packages/web/src/pages/upload-page/fields/AccessAndSaleField.tsx index 02c88997bff..f91648cc403 100644 --- a/packages/web/src/pages/upload-page/fields/AccessAndSaleField.tsx +++ b/packages/web/src/pages/upload-page/fields/AccessAndSaleField.tsx @@ -1,22 +1,21 @@ import { useCallback, useMemo } from 'react' +import { USDCPurchaseConfig, useUSDCPurchaseConfig } from '@audius/common/hooks' import { - accountSelectors, - FieldVisibility, - formatPrice, isContentCollectibleGated, isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated, + FieldVisibility, StreamTrackAvailabilityType, - USDCPurchaseConfig, - useUSDCPurchaseConfig, CollectibleGatedConditions, - USDCPurchaseConditions, FollowGatedConditions, TipGatedConditions, - Download -} from '@audius/common' + Download, + USDCPurchaseConditions +} from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import { formatPrice } from '@audius/common/utils' import { IconCart, IconCollectible, diff --git a/packages/web/src/pages/upload-page/fields/AccessAndSaleMenuFields.tsx b/packages/web/src/pages/upload-page/fields/AccessAndSaleMenuFields.tsx index ed88de0dfda..41fc8fc8d98 100644 --- a/packages/web/src/pages/upload-page/fields/AccessAndSaleMenuFields.tsx +++ b/packages/web/src/pages/upload-page/fields/AccessAndSaleMenuFields.tsx @@ -1,10 +1,9 @@ +import { useFeatureFlag, useAccessAndRemixSettings } from '@audius/common/hooks' import { AccessConditions, - FeatureFlags, - StreamTrackAvailabilityType, - useAccessAndRemixSettings, - useFeatureFlag -} from '@audius/common' + StreamTrackAvailabilityType +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { IconHidden, RadioButtonGroup, diff --git a/packages/web/src/pages/upload-page/fields/AttributionField.tsx b/packages/web/src/pages/upload-page/fields/AttributionField.tsx index 7dd71256e4c..73e511537d0 100644 --- a/packages/web/src/pages/upload-page/fields/AttributionField.tsx +++ b/packages/web/src/pages/upload-page/fields/AttributionField.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' -import { creativeCommons } from '@audius/common' +import { creativeCommons } from '@audius/common/utils' import { IconRobot } from '@audius/stems' import cn from 'classnames' import { useField } from 'formik' diff --git a/packages/web/src/pages/upload-page/fields/MultiTrackSidebar.tsx b/packages/web/src/pages/upload-page/fields/MultiTrackSidebar.tsx index 4d55f5b8f94..c212e8536e5 100644 --- a/packages/web/src/pages/upload-page/fields/MultiTrackSidebar.tsx +++ b/packages/web/src/pages/upload-page/fields/MultiTrackSidebar.tsx @@ -1,6 +1,6 @@ import { MouseEvent, useCallback, useContext } from 'react' -import { imageBlank as placeholderArt } from '@audius/common' +import { imageBlank as placeholderArt } from '@audius/common/assets' import { Button } from '@audius/harmony' import { IconError, IconUpload } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/upload-page/fields/ReleaseDateField.tsx b/packages/web/src/pages/upload-page/fields/ReleaseDateField.tsx index 0cf9cc72aed..5b1b4059d1e 100644 --- a/packages/web/src/pages/upload-page/fields/ReleaseDateField.tsx +++ b/packages/web/src/pages/upload-page/fields/ReleaseDateField.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react' -import { getLocalTimezone } from '@audius/common' +import { getLocalTimezone } from '@audius/common/utils' import { IconInfo, Flex } from '@audius/harmony' import { IconCalendar, RadioButtonGroup, ModalContent } from '@audius/stems' import cn from 'classnames' diff --git a/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsField.tsx b/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsField.tsx index 28c69bf0fda..92328946e4f 100644 --- a/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsField.tsx +++ b/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsField.tsx @@ -1,13 +1,13 @@ import { useCallback, useEffect, useMemo } from 'react' +import { useGetTrackById } from '@audius/common/api' import { - Nullable, + isContentUSDCPurchaseGated, ID, - useGetTrackById, FieldVisibility, - Remix, - isContentUSDCPurchaseGated -} from '@audius/common' + Remix +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { get, set } from 'lodash' import { toFormikValidationSchema } from 'zod-formik-adapter' diff --git a/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsMenuFields.tsx b/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsMenuFields.tsx index 2c17a307671..a979cc8289e 100644 --- a/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsMenuFields.tsx +++ b/packages/web/src/pages/upload-page/fields/RemixSettingsField/RemixSettingsMenuFields.tsx @@ -1,13 +1,13 @@ import { useEffect } from 'react' +import { useGetTrackByPermalink } from '@audius/common/api' +import { useGatedContentAccess } from '@audius/common/hooks' import { - getPathFromTrackUrl, - useGetTrackByPermalink, - accountSelectors, - useGatedContentAccess, - isContentUSDCPurchaseGated, - isContentCollectibleGated -} from '@audius/common' + isContentCollectibleGated, + isContentUSDCPurchaseGated +} from '@audius/common/models' +import { accountSelectors } from '@audius/common/store' +import { getPathFromTrackUrl } from '@audius/common/utils' import { useField } from 'formik' import { useSelector } from 'react-redux' import { useThrottle } from 'react-use' diff --git a/packages/web/src/pages/upload-page/fields/RemixSettingsField/TrackInfo.tsx b/packages/web/src/pages/upload-page/fields/RemixSettingsField/TrackInfo.tsx index 19a08a998c1..20e591a38ca 100644 --- a/packages/web/src/pages/upload-page/fields/RemixSettingsField/TrackInfo.tsx +++ b/packages/web/src/pages/upload-page/fields/RemixSettingsField/TrackInfo.tsx @@ -1,4 +1,5 @@ -import { ID, SquareSizes, useGetTrackById } from '@audius/common' +import { useGetTrackById } from '@audius/common/api' +import { SquareSizes, ID } from '@audius/common/models' import { SelectedValue } from 'components/data-entry/ContextualMenu' import DynamicImage from 'components/dynamic-image/DynamicImage' diff --git a/packages/web/src/pages/upload-page/fields/SelectGenreField.tsx b/packages/web/src/pages/upload-page/fields/SelectGenreField.tsx index cad9c5abe33..2791a81e472 100644 --- a/packages/web/src/pages/upload-page/fields/SelectGenreField.tsx +++ b/packages/web/src/pages/upload-page/fields/SelectGenreField.tsx @@ -1,4 +1,4 @@ -import { convertGenreLabelToValue, GENRES } from '@audius/common' +import { GENRES, convertGenreLabelToValue } from '@audius/common/utils' import { DropdownField, DropdownFieldProps } from 'components/form-fields' diff --git a/packages/web/src/pages/upload-page/fields/StemFilesView.tsx b/packages/web/src/pages/upload-page/fields/StemFilesView.tsx index a7f9a51076d..e8c588bdc45 100644 --- a/packages/web/src/pages/upload-page/fields/StemFilesView.tsx +++ b/packages/web/src/pages/upload-page/fields/StemFilesView.tsx @@ -1,15 +1,15 @@ import { useCallback } from 'react' import { - FeatureFlags, StemCategory, stemCategoryFriendlyNames, StemUpload, StemUploadWithFile -} from '@audius/common' +} from '@audius/common/models' import { Box, Flex, Text as HarmonyText } from '@audius/harmony' import { IconRemove, IconButton } from '@audius/stems' import cn from 'classnames' +import { FeatureFlags } from '~/services' import LoadingSpinner from 'components/loading-spinner/LoadingSpinner' import Dropdown from 'components/navigation/Dropdown' diff --git a/packages/web/src/pages/upload-page/fields/StemsAndDownloadsField.tsx b/packages/web/src/pages/upload-page/fields/StemsAndDownloadsField.tsx index 1c0e7facf36..f1c08187c93 100644 --- a/packages/web/src/pages/upload-page/fields/StemsAndDownloadsField.tsx +++ b/packages/web/src/pages/upload-page/fields/StemsAndDownloadsField.tsx @@ -1,20 +1,20 @@ import { useCallback, useMemo } from 'react' +import { useUSDCPurchaseConfig } from '@audius/common/hooks' import { AccessConditions, Download, DownloadTrackAvailabilityType, - FeatureFlags, FollowGatedConditions, - Nullable, StemUpload, USDCPurchaseConditions, - accountSelectors, isContentFollowGated, isContentUSDCPurchaseGated, - stemCategoryFriendlyNames, - useUSDCPurchaseConfig -} from '@audius/common' + stemCategoryFriendlyNames +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { IconCart } from '@audius/stems' import { FormikErrors } from 'formik' import { get, set } from 'lodash' diff --git a/packages/web/src/pages/upload-page/fields/StemsAndDownloadsMenuFields.tsx b/packages/web/src/pages/upload-page/fields/StemsAndDownloadsMenuFields.tsx index a69d5b6bd23..15222591385 100644 --- a/packages/web/src/pages/upload-page/fields/StemsAndDownloadsMenuFields.tsx +++ b/packages/web/src/pages/upload-page/fields/StemsAndDownloadsMenuFields.tsx @@ -3,14 +3,12 @@ import { useCallback, useEffect, useState } from 'react' import { AccessConditions, DownloadTrackAvailabilityType, - FeatureFlags, - Nullable, StemCategory, StemUploadWithFile, - formatPrice, - isContentUSDCPurchaseGated, - removeNullable -} from '@audius/common' + isContentUSDCPurchaseGated +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { removeNullable, formatPrice, Nullable } from '@audius/common/utils' import { useField } from 'formik' import { z } from 'zod' diff --git a/packages/web/src/pages/upload-page/fields/download-availability/DownloadAvailability.tsx b/packages/web/src/pages/upload-page/fields/download-availability/DownloadAvailability.tsx index 7baaa513725..766dd8ba866 100644 --- a/packages/web/src/pages/upload-page/fields/download-availability/DownloadAvailability.tsx +++ b/packages/web/src/pages/upload-page/fields/download-availability/DownloadAvailability.tsx @@ -3,12 +3,12 @@ import { useCallback } from 'react' import { AccessConditions, DownloadTrackAvailabilityType, - Nullable, isContentCollectibleGated, isContentFollowGated, isContentTipGated, isContentUSDCPurchaseGated -} from '@audius/common' +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { Box, Flex, diff --git a/packages/web/src/pages/upload-page/fields/download-availability/DownloadPriceField.tsx b/packages/web/src/pages/upload-page/fields/download-availability/DownloadPriceField.tsx index a2e21624335..37b9ab1b09e 100644 --- a/packages/web/src/pages/upload-page/fields/download-availability/DownloadPriceField.tsx +++ b/packages/web/src/pages/upload-page/fields/download-availability/DownloadPriceField.tsx @@ -9,7 +9,7 @@ import { decimalIntegerToHumanReadable, filterDecimalString, padDecimalValue -} from '@audius/common' +} from '@audius/common/utils' import { useField } from 'formik' import { BoxedTextField } from '../BoxedTextField' diff --git a/packages/web/src/pages/upload-page/fields/helpers.ts b/packages/web/src/pages/upload-page/fields/helpers.ts index 0afa679bb43..7ea6cb01b7c 100644 --- a/packages/web/src/pages/upload-page/fields/helpers.ts +++ b/packages/web/src/pages/upload-page/fields/helpers.ts @@ -1,4 +1,5 @@ -import { ID, Nullable } from '@audius/common' +import { ID } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' /** * Allows us to store all the user selections in the Access & Sale modal diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/SpecialAccessFields.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/SpecialAccessFields.tsx index 5baee37bf0a..f8680c883ba 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/SpecialAccessFields.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/SpecialAccessFields.tsx @@ -1,12 +1,10 @@ import { ChangeEvent, useCallback } from 'react' -import { - AccessConditions, - FeatureFlags, - Nullable, - accountSelectors, - useFeatureFlag -} from '@audius/common' +import { useFeatureFlag } from '@audius/common/hooks' +import { AccessConditions } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { accountSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { IconInfo, RadioButton, RadioButtonGroup } from '@audius/stems' import cn from 'classnames' import { useField } from 'formik' diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedDescription.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedDescription.tsx index 90e33a03c18..2689a4480b4 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedDescription.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedDescription.tsx @@ -1,4 +1,4 @@ -import { collectiblesSelectors } from '@audius/common' +import { collectiblesSelectors } from '@audius/common/store' import { Text } from '@audius/harmony' import { Button, ButtonType } from '@audius/stems' import { useSelector } from 'react-redux' diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedFields.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedFields.tsx index ed99dab538f..f656a2391df 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedFields.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedFields.tsx @@ -1,15 +1,15 @@ import { useMemo } from 'react' +import { useFeatureFlag } from '@audius/common/hooks' import { AccessConditions, Chain, - collectiblesSelectors, - FeatureFlags, - isContentCollectibleGated, - Nullable, StreamTrackAvailabilityType, - useFeatureFlag -} from '@audius/common' + isContentCollectibleGated +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' +import { collectiblesSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { Box, IconInfo } from '@audius/harmony' import { useField } from 'formik' import { useSelector } from 'react-redux' diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedRadioField.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedRadioField.tsx index 043a320df64..208505ec27a 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedRadioField.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/collectible-gated/CollectibleGatedRadioField.tsx @@ -1,9 +1,9 @@ +import { useAccessAndRemixSettings } from '@audius/common/hooks' import { - AccessConditions, StreamTrackAvailabilityType, - collectiblesSelectors, - useAccessAndRemixSettings -} from '@audius/common' + AccessConditions +} from '@audius/common/models' +import { collectiblesSelectors } from '@audius/common/store' import { IconCollectible } from '@audius/stems' import { ModalRadioItem } from 'components/modal-radio/ModalRadioItem' diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseFields.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseFields.tsx index bb953c774de..337679b15d3 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseFields.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseFields.tsx @@ -5,15 +5,15 @@ import { useState } from 'react' +import { useFeatureFlag } from '@audius/common/hooks' +import { AccessConditions } from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { - AccessConditions, - FeatureFlags, - Nullable, - decimalIntegerToHumanReadable, filterDecimalString, padDecimalValue, - useFeatureFlag -} from '@audius/common' + decimalIntegerToHumanReadable, + Nullable +} from '@audius/common/utils' import { IconInfo } from '@audius/harmony' import cn from 'classnames' import { useField } from 'formik' diff --git a/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseGatedRadioField.tsx b/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseGatedRadioField.tsx index 46056d55c17..f560db0bc1d 100644 --- a/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseGatedRadioField.tsx +++ b/packages/web/src/pages/upload-page/fields/stream-availability/usdc-purchase-gated/UsdcPurchaseGatedRadioField.tsx @@ -1,13 +1,12 @@ import { useCallback } from 'react' +import { useFeatureFlag, useAccessAndRemixSettings } from '@audius/common/hooks' import { - FeatureFlags, Name, - AccessConditions, StreamTrackAvailabilityType, - useAccessAndRemixSettings, - useFeatureFlag -} from '@audius/common' + AccessConditions +} from '@audius/common/models' +import { FeatureFlags } from '@audius/common/services' import { IconCart, IconStars } from '@audius/stems' import { ExternalLink } from 'components/link' diff --git a/packages/web/src/pages/upload-page/fields/types.ts b/packages/web/src/pages/upload-page/fields/types.ts index 168ef8c20d2..fc90de92c60 100644 --- a/packages/web/src/pages/upload-page/fields/types.ts +++ b/packages/web/src/pages/upload-page/fields/types.ts @@ -2,10 +2,10 @@ import { AccessConditions, DownloadTrackAvailabilityType, FieldVisibility, - Nullable, StemUpload, StreamTrackAvailabilityType -} from '@audius/common' +} from '@audius/common/models' +import { Nullable } from '@audius/common/utils' export type FieldProps = { name: string diff --git a/packages/web/src/pages/upload-page/forms/EditCollectionForm.tsx b/packages/web/src/pages/upload-page/forms/EditCollectionForm.tsx index dcb8afb19c7..41a53e106a7 100644 --- a/packages/web/src/pages/upload-page/forms/EditCollectionForm.tsx +++ b/packages/web/src/pages/upload-page/forms/EditCollectionForm.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { UploadType } from '@audius/common' +import { UploadType } from '@audius/common/store' import { Form, Formik } from 'formik' import moment from 'moment' import { toFormikValidationSchema } from 'zod-formik-adapter' diff --git a/packages/web/src/pages/upload-page/forms/EditTrackForm.tsx b/packages/web/src/pages/upload-page/forms/EditTrackForm.tsx index b7331b55843..10a02cde214 100644 --- a/packages/web/src/pages/upload-page/forms/EditTrackForm.tsx +++ b/packages/web/src/pages/upload-page/forms/EditTrackForm.tsx @@ -1,6 +1,6 @@ import { useCallback, useContext, useMemo, useState } from 'react' -import { FeatureFlags } from '@audius/common' +import { FeatureFlags } from '@audius/common/services' import { HarmonyPlainButton, IconCaretRight } from '@audius/stems' import cn from 'classnames' import { Form, Formik, FormikProps, useField } from 'formik' diff --git a/packages/web/src/pages/upload-page/hooks.ts b/packages/web/src/pages/upload-page/hooks.ts index 57fc8ce3af3..ab5ab468638 100644 --- a/packages/web/src/pages/upload-page/hooks.ts +++ b/packages/web/src/pages/upload-page/hooks.ts @@ -1,4 +1,4 @@ -import { Maybe } from '@audius/common' +import { Maybe } from '@audius/common/utils' import { useField } from 'formik' const getFieldName = (base: string, index: number, path: string) => diff --git a/packages/web/src/pages/upload-page/pages/EditPage.tsx b/packages/web/src/pages/upload-page/pages/EditPage.tsx index 6568c38ec74..8a2cc6e5cd5 100644 --- a/packages/web/src/pages/upload-page/pages/EditPage.tsx +++ b/packages/web/src/pages/upload-page/pages/EditPage.tsx @@ -1,6 +1,6 @@ import { useContext } from 'react' -import { UploadType } from '@audius/common' +import { UploadType } from '@audius/common/store' import { useUnmount } from 'react-use' import { EditCollectionForm } from '../forms/EditCollectionForm' diff --git a/packages/web/src/pages/upload-page/pages/FinishPage.tsx b/packages/web/src/pages/upload-page/pages/FinishPage.tsx index 17b85e279ab..92b69cdc27c 100644 --- a/packages/web/src/pages/upload-page/pages/FinishPage.tsx +++ b/packages/web/src/pages/upload-page/pages/FinishPage.tsx @@ -1,15 +1,15 @@ import { useCallback, useMemo } from 'react' +import { imageBlank as placeholderArt } from '@audius/common/assets' +import { Name } from '@audius/common/models' import { accountSelectors, - CommonState, - imageBlank as placeholderArt, - Name, - ProgressState, - ProgressStatus, uploadSelectors, - UploadType -} from '@audius/common' + UploadType, + ProgressStatus, + CommonState, + ProgressState +} from '@audius/common/store' import { HarmonyPlainButton, IconArrow, diff --git a/packages/web/src/pages/upload-page/pages/SelectPage.tsx b/packages/web/src/pages/upload-page/pages/SelectPage.tsx index d9942ae7a6e..1459445432b 100644 --- a/packages/web/src/pages/upload-page/pages/SelectPage.tsx +++ b/packages/web/src/pages/upload-page/pages/SelectPage.tsx @@ -1,12 +1,9 @@ import { useCallback, useState } from 'react' -import { - Nullable, - UploadType, - removeNullable, - newCollectionMetadata, - FeatureFlags -} from '@audius/common' +import { newCollectionMetadata } from '@audius/common/schemas' +import { FeatureFlags } from '@audius/common/services' +import { UploadType } from '@audius/common/store' +import { removeNullable, Nullable } from '@audius/common/utils' import { Box } from '@audius/harmony' import cn from 'classnames' diff --git a/packages/web/src/pages/upload-page/store/utils/processFiles.ts b/packages/web/src/pages/upload-page/store/utils/processFiles.ts index 4cde534bfc0..b62faa57d24 100644 --- a/packages/web/src/pages/upload-page/store/utils/processFiles.ts +++ b/packages/web/src/pages/upload-page/store/utils/processFiles.ts @@ -1,9 +1,9 @@ +import { newTrackMetadata } from '@audius/common/schemas' import { - newTrackMetadata, ALLOWED_MAX_AUDIO_SIZE_BYTES, ALLOWED_AUDIO_FILE_EXTENSIONS, ALLOWED_AUDIO_FILE_MIME -} from '@audius/common' +} from '@audius/common/utils' import jsmediatags from 'jsmediatags' import { resizeImage } from 'utils/imageProcessingUtil' diff --git a/packages/web/src/pages/upload-page/store/utils/stems.ts b/packages/web/src/pages/upload-page/store/utils/stems.ts index 4bfbf41e0b9..43cc5dd4b54 100644 --- a/packages/web/src/pages/upload-page/store/utils/stems.ts +++ b/packages/web/src/pages/upload-page/store/utils/stems.ts @@ -1,4 +1,10 @@ -import { ID, StemCategory, StemUpload, Track, StemTrack } from '@audius/common' +import { + StemCategory, + ID, + StemUpload, + Track, + StemTrack +} from '@audius/common/models' export const updateAndFlattenStems = ( stems: StemUpload[][], diff --git a/packages/web/src/pages/upload-page/types.ts b/packages/web/src/pages/upload-page/types.ts index 5d3a8e04441..caa2912d31f 100644 --- a/packages/web/src/pages/upload-page/types.ts +++ b/packages/web/src/pages/upload-page/types.ts @@ -1,4 +1,6 @@ -import { Nullable, TrackMetadata, UploadType } from '@audius/common' +import { TrackMetadata } from '@audius/common/models' +import { UploadType } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { CollectionValues } from './validation' diff --git a/packages/web/src/pages/upload-page/utils/computeLicenseIcons.ts b/packages/web/src/pages/upload-page/utils/computeLicenseIcons.ts index 8ba0f994a4b..3d21c0b0bb4 100644 --- a/packages/web/src/pages/upload-page/utils/computeLicenseIcons.ts +++ b/packages/web/src/pages/upload-page/utils/computeLicenseIcons.ts @@ -1,6 +1,6 @@ import type { ComponentType, SVGProps } from 'react' -import type { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import IconAllowAttribution from 'assets/img/creativeCommons/by.svg' import IconCreativeCommons from 'assets/img/creativeCommons/cc.svg' diff --git a/packages/web/src/pages/upload-page/utils/uploadPreviewContext.tsx b/packages/web/src/pages/upload-page/utils/uploadPreviewContext.tsx index c663d8c6657..68ba7214e7b 100644 --- a/packages/web/src/pages/upload-page/utils/uploadPreviewContext.tsx +++ b/packages/web/src/pages/upload-page/utils/uploadPreviewContext.tsx @@ -1,6 +1,7 @@ import { createContext, useCallback, useState } from 'react' -import { Nullable, playerSelectors, queueActions } from '@audius/common' +import { queueActions, playerSelectors } from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { useSelector, useDispatch } from 'react-redux' const { getPlaying } = playerSelectors diff --git a/packages/web/src/pages/upload-page/validation.ts b/packages/web/src/pages/upload-page/validation.ts index 0164dbac11f..9d136a3f980 100644 --- a/packages/web/src/pages/upload-page/validation.ts +++ b/packages/web/src/pages/upload-page/validation.ts @@ -1,4 +1,4 @@ -import { imageBlank } from '@audius/common' +import { imageBlank } from '@audius/common/assets' import { Genre, HashId, diff --git a/packages/web/src/pages/visualizer/VisualizerProvider.tsx b/packages/web/src/pages/visualizer/VisualizerProvider.tsx index 4f21ee9a4f7..c371c97941e 100644 --- a/packages/web/src/pages/visualizer/VisualizerProvider.tsx +++ b/packages/web/src/pages/visualizer/VisualizerProvider.tsx @@ -1,3 +1,11 @@ +import { + averageColorSelectors, + queueSelectors, + themeSelectors, + playerSelectors +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' +import { Name, SquareSizes, Track } from '@audius/common/models' import { useEffect, useState, useCallback } from 'react' import { push as pushRoute } from 'connected-react-router' import { AppState } from 'store/types' @@ -10,23 +18,14 @@ import Toast from 'components/toast/Toast' import styles from './VisualizerProvider.module.css' import { MountPlacement, ComponentPlacement } from 'components/types' -import { - Nullable, - playerSelectors, - queueSelectors, - themeSelectors -} from '@audius/common' import { shouldShowDark } from 'utils/theme/theme' import { profilePage } from 'utils/route' import { make, TrackEvent } from 'common/store/analytics/actions' -import { Name } from '@audius/common' -import { Track } from '@audius/common' -import { SquareSizes } from '@audius/common' import DynamicImage from 'components/dynamic-image/DynamicImage' import PlayingTrackInfo from 'components/play-bar/desktop/components/PlayingTrackInfo' import { webglSupported } from './utils' -import { averageColorSelectors } from '@audius/common' + import IconRemove from 'assets/img/iconRemove.svg' import AudiusLogoHorizontal from 'assets/img/audiusLogoHorizontal.svg' import { useTrackCoverArt } from 'hooks/useTrackCoverArt' diff --git a/packages/web/src/public-site/pages/download-page/DownloadPage.tsx b/packages/web/src/public-site/pages/download-page/DownloadPage.tsx index a32e5c3426c..e138b23a5a8 100644 --- a/packages/web/src/public-site/pages/download-page/DownloadPage.tsx +++ b/packages/web/src/public-site/pages/download-page/DownloadPage.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import { MobileOS, OS } from '@audius/common' +import { OS, MobileOS } from '@audius/common/models' import { IconDownload } from '@audius/stems' import cn from 'classnames' import queryString from 'query-string' diff --git a/packages/web/src/public-site/pages/landing-page/components/FeaturedContent.tsx b/packages/web/src/public-site/pages/landing-page/components/FeaturedContent.tsx index 98056681fe8..b4af8974edc 100644 --- a/packages/web/src/public-site/pages/landing-page/components/FeaturedContent.tsx +++ b/packages/web/src/public-site/pages/landing-page/components/FeaturedContent.tsx @@ -1,12 +1,8 @@ import { useEffect, useState } from 'react' -import { - Maybe, - Nullable, - SquareSizes, - UserCollectionMetadata, - useAppContext -} from '@audius/common' +import { useAppContext } from '@audius/common/context' +import { SquareSizes, UserCollectionMetadata } from '@audius/common/models' +import { Nullable, Maybe } from '@audius/common/utils' import { StorageNodeSelectorService } from '@audius/sdk' // eslint-disable-next-line no-restricted-imports -- TODO: migrate to @react-spring/web import { useSpring, animated } from 'react-spring' diff --git a/packages/web/src/services/Location.ts b/packages/web/src/services/Location.ts index 83baa99fe12..887242fdc7a 100644 --- a/packages/web/src/services/Location.ts +++ b/packages/web/src/services/Location.ts @@ -1,4 +1,4 @@ -import { getLocation as getLocationCommon } from '@audius/common' +import { getLocation as getLocationCommon } from '@audius/common/services' import { localStorage } from 'services/local-storage' diff --git a/packages/web/src/services/analytics/amplitude.ts b/packages/web/src/services/analytics/amplitude.ts index 929479a3bf6..6c49278c929 100644 --- a/packages/web/src/services/analytics/amplitude.ts +++ b/packages/web/src/services/analytics/amplitude.ts @@ -1,5 +1,6 @@ +import { Name, MobileOS } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' // Amplitude Analytics -import { Name, Nullable, MobileOS } from '@audius/common' import amplitude from 'amplitude-js' import { env } from 'services/env' diff --git a/packages/web/src/services/analytics/index.ts b/packages/web/src/services/analytics/index.ts index 21b59d3f451..06f2342dff5 100644 --- a/packages/web/src/services/analytics/index.ts +++ b/packages/web/src/services/analytics/index.ts @@ -1,4 +1,5 @@ -import { AnalyticsEvent, Nullable, AllTrackingEvents } from '@audius/common' +import { AnalyticsEvent, AllTrackingEvents } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { env } from 'services/env' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' diff --git a/packages/web/src/services/audio-player/AudioPlayer.ts b/packages/web/src/services/audio-player/AudioPlayer.ts index 200d153d97c..60bc1dd0a9b 100644 --- a/packages/web/src/services/audio-player/AudioPlayer.ts +++ b/packages/web/src/services/audio-player/AudioPlayer.ts @@ -1,4 +1,4 @@ -import { PlaybackRate, playbackRateValueMap } from '@audius/common' +import { playbackRateValueMap, PlaybackRate } from '@audius/common/store' declare global { interface Window { diff --git a/packages/web/src/services/audius-api-client/apiClient.ts b/packages/web/src/services/audius-api-client/apiClient.ts index a355d6ee5af..b3e049d3e62 100644 --- a/packages/web/src/services/audius-api-client/apiClient.ts +++ b/packages/web/src/services/audius-api-client/apiClient.ts @@ -1,4 +1,4 @@ -import { AudiusAPIClient } from '@audius/common' +import { AudiusAPIClient } from '@audius/common/services' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { waitForLibsInit } from 'services/audius-backend/eagerLoadUtils' diff --git a/packages/web/src/services/audius-backend/BuyAudio.ts b/packages/web/src/services/audius-backend/BuyAudio.ts index 41d188b041e..5d7852c1e6b 100644 --- a/packages/web/src/services/audius-backend/BuyAudio.ts +++ b/packages/web/src/services/audius-backend/BuyAudio.ts @@ -1,4 +1,5 @@ -import { InAppAudioPurchaseMetadata, MEMO_PROGRAM_ID } from '@audius/common' +import { MEMO_PROGRAM_ID } from '@audius/common/services' +import { InAppAudioPurchaseMetadata } from '@audius/common/store' import { TokenAccountNotFoundError, createTransferCheckedInstruction, diff --git a/packages/web/src/services/audius-backend/Cognito.ts b/packages/web/src/services/audius-backend/Cognito.ts index f1143bd119f..44ece4eb9a7 100644 --- a/packages/web/src/services/audius-backend/Cognito.ts +++ b/packages/web/src/services/audius-backend/Cognito.ts @@ -1,4 +1,4 @@ -import { AuthHeaders } from '@audius/common' +import { AuthHeaders } from '@audius/common/services' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { waitForLibsInit } from 'services/audius-backend/eagerLoadUtils' diff --git a/packages/web/src/services/audius-backend/Jupiter.ts b/packages/web/src/services/audius-backend/Jupiter.ts index d3a020184f3..a658259eee2 100644 --- a/packages/web/src/services/audius-backend/Jupiter.ts +++ b/packages/web/src/services/audius-backend/Jupiter.ts @@ -1,8 +1,5 @@ -import { - JupiterTokenSymbol, - TOKEN_LISTING_MAP, - convertBigIntToAmountObject -} from '@audius/common' +import { TOKEN_LISTING_MAP, JupiterTokenSymbol } from '@audius/common/store' +import { convertBigIntToAmountObject } from '@audius/common/utils' import { TransactionHandler } from '@audius/sdk/dist/core' import { createJupiterApiClient, Instruction, QuoteResponse } from '@jup-ag/api' import { PublicKey, TransactionInstruction } from '@solana/web3.js' diff --git a/packages/web/src/services/audius-backend/audius-backend-instance.ts b/packages/web/src/services/audius-backend/audius-backend-instance.ts index 9155bc12fad..4f7845dc30e 100644 --- a/packages/web/src/services/audius-backend/audius-backend-instance.ts +++ b/packages/web/src/services/audius-backend/audius-backend-instance.ts @@ -1,4 +1,4 @@ -import { audiusBackend } from '@audius/common' +import { audiusBackend } from '@audius/common/services' import type { AudiusLibs } from '@audius/sdk' import { track } from 'services/analytics' diff --git a/packages/web/src/services/audius-backend/eagerLoadUtils.ts b/packages/web/src/services/audius-backend/eagerLoadUtils.ts index fdb65edde68..0f00f1e28f7 100644 --- a/packages/web/src/services/audius-backend/eagerLoadUtils.ts +++ b/packages/web/src/services/audius-backend/eagerLoadUtils.ts @@ -1,10 +1,9 @@ +import { getEagerDiscprov, makeEagerRequest } from '@audius/common/services' /** * Utilities to assist in eager pre-fetching content from the * protocol before libs has initialized. */ -import { getEagerDiscprov, makeEagerRequest } from '@audius/common' - import { env } from 'services/env' import { localStorage } from 'services/local-storage' diff --git a/packages/web/src/services/audius-sdk/discoveryNodeSelector.ts b/packages/web/src/services/audius-sdk/discoveryNodeSelector.ts index 890f662092c..4a08deb0cfa 100644 --- a/packages/web/src/services/audius-sdk/discoveryNodeSelector.ts +++ b/packages/web/src/services/audius-sdk/discoveryNodeSelector.ts @@ -1,4 +1,4 @@ -import { DiscoveryNodeSelectorService } from '@audius/common' +import { DiscoveryNodeSelectorService } from '@audius/common/services' import { env } from '../env' import { remoteConfigInstance } from '../remote-config/remote-config-instance' diff --git a/packages/web/src/services/audius-sdk/storageNodeSelector.ts b/packages/web/src/services/audius-sdk/storageNodeSelector.ts index 31de5d8a304..e1b2b44bc38 100644 --- a/packages/web/src/services/audius-sdk/storageNodeSelector.ts +++ b/packages/web/src/services/audius-sdk/storageNodeSelector.ts @@ -1,4 +1,4 @@ -import { makeGetStorageNodeSelector } from '@audius/common' +import { makeGetStorageNodeSelector } from '@audius/common/services' import { env } from 'services/env' diff --git a/packages/web/src/services/download-app/DownloadApp.test.ts b/packages/web/src/services/download-app/DownloadApp.test.ts index f32c06b1468..5faa4aca6ed 100644 --- a/packages/web/src/services/download-app/DownloadApp.test.ts +++ b/packages/web/src/services/download-app/DownloadApp.test.ts @@ -1,4 +1,4 @@ -import { OS } from '@audius/common' +import { OS } from '@audius/common/models' import fetchMock from 'fetch-mock' import { describe, it, beforeAll, expect } from 'vitest' diff --git a/packages/web/src/services/download-app/DownloadApp.ts b/packages/web/src/services/download-app/DownloadApp.ts index 96525aab111..f337580dcc4 100644 --- a/packages/web/src/services/download-app/DownloadApp.ts +++ b/packages/web/src/services/download-app/DownloadApp.ts @@ -1,4 +1,4 @@ -import { OS } from '@audius/common' +import { OS } from '@audius/common/models' import { env } from 'services/env' diff --git a/packages/web/src/services/env/env.dev.ts b/packages/web/src/services/env/env.dev.ts index c699d2ae143..afc85a95345 100644 --- a/packages/web/src/services/env/env.dev.ts +++ b/packages/web/src/services/env/env.dev.ts @@ -1,4 +1,4 @@ -import { Env } from '@audius/common' +import { Env } from '@audius/common/services' export const env: Env = { AAO_ENDPOINT: 'http://audius-protocol-anti-abuse-oracle-1', diff --git a/packages/web/src/services/env/env.prod.ts b/packages/web/src/services/env/env.prod.ts index 1d7d993e943..bb2824a7694 100644 --- a/packages/web/src/services/env/env.prod.ts +++ b/packages/web/src/services/env/env.prod.ts @@ -1,4 +1,4 @@ -import { Env } from '@audius/common' +import { Env } from '@audius/common/services' export const env: Env = { AAO_ENDPOINT: 'https://antiabuseoracle.audius.co', diff --git a/packages/web/src/services/env/env.stage.ts b/packages/web/src/services/env/env.stage.ts index 0b45d6f5c77..0f93ca44ece 100644 --- a/packages/web/src/services/env/env.stage.ts +++ b/packages/web/src/services/env/env.stage.ts @@ -1,4 +1,4 @@ -import { Env } from '@audius/common' +import { Env } from '@audius/common/services' export const env: Env = { AAO_ENDPOINT: 'https://antiabuseoracle.staging.audius.co', diff --git a/packages/web/src/services/env/index.ts b/packages/web/src/services/env/index.ts index 74b19ac19b6..f1683e6d9f5 100644 --- a/packages/web/src/services/env/index.ts +++ b/packages/web/src/services/env/index.ts @@ -1,5 +1,4 @@ -import { Environment } from '@audius/common' -import type { Env } from '@audius/common' +import { Environment, Env } from '@audius/common/services' import { env as envDev } from './env.dev' import { env as envProd } from './env.prod' diff --git a/packages/web/src/services/explore.ts b/packages/web/src/services/explore.ts index fcab1e89747..e0e351fec49 100644 --- a/packages/web/src/services/explore.ts +++ b/packages/web/src/services/explore.ts @@ -1,4 +1,4 @@ -import { Explore } from '@audius/common' +import { Explore } from '@audius/common/services' import { apiClient } from './audius-api-client' import { audiusBackendInstance } from './audius-backend/audius-backend-instance' diff --git a/packages/web/src/services/fingerprint.ts b/packages/web/src/services/fingerprint.ts index e6ca6d8a194..b7fad01a93e 100644 --- a/packages/web/src/services/fingerprint.ts +++ b/packages/web/src/services/fingerprint.ts @@ -1,4 +1,4 @@ -import { FingerprintClient } from '@audius/common' +import { FingerprintClient } from '@audius/common/services' import FingerprintJS, { Agent } from '@fingerprintjs/fingerprintjs-pro' import { env } from './env' diff --git a/packages/web/src/services/local-storage.ts b/packages/web/src/services/local-storage.ts index 87c0e53178f..82709c90de1 100644 --- a/packages/web/src/services/local-storage.ts +++ b/packages/web/src/services/local-storage.ts @@ -1,4 +1,4 @@ -import { LocalStorage } from '@audius/common' +import { LocalStorage } from '@audius/common/services' export const localStorage = new LocalStorage({ localStorage: diff --git a/packages/web/src/services/remote-config/__mocks__/remote-config-instance.ts b/packages/web/src/services/remote-config/__mocks__/remote-config-instance.ts index 01d9e713769..aeb84c9c28d 100644 --- a/packages/web/src/services/remote-config/__mocks__/remote-config-instance.ts +++ b/packages/web/src/services/remote-config/__mocks__/remote-config-instance.ts @@ -1,4 +1,4 @@ -import { RemoteConfigInstance } from '@audius/common' +import { RemoteConfigInstance } from '@audius/common/services' import { vitest } from 'vitest' let fakeConfig: Record = {} diff --git a/packages/web/src/services/remote-config/featureFlagHelpers.ts b/packages/web/src/services/remote-config/featureFlagHelpers.ts index 60f81175fee..b8b6c678cb7 100644 --- a/packages/web/src/services/remote-config/featureFlagHelpers.ts +++ b/packages/web/src/services/remote-config/featureFlagHelpers.ts @@ -1,8 +1,8 @@ import { - FeatureFlags, - FEATURE_FLAG_OVERRIDE_KEY, - OverrideSetting -} from '@audius/common' + OverrideSetting, + FEATURE_FLAG_OVERRIDE_KEY +} from '@audius/common/hooks' +import { FeatureFlags } from '@audius/common/services' import { remoteConfigInstance } from './remote-config-instance' diff --git a/packages/web/src/services/remote-config/remote-config-instance.ts b/packages/web/src/services/remote-config/remote-config-instance.ts index 5beff3cdadb..a369e5a7da8 100644 --- a/packages/web/src/services/remote-config/remote-config-instance.ts +++ b/packages/web/src/services/remote-config/remote-config-instance.ts @@ -1,4 +1,5 @@ -import { ErrorLevel, remoteConfig } from '@audius/common' +import { ErrorLevel } from '@audius/common/models' +import { remoteConfig } from '@audius/common/services' import optimizely, { Config } from '@optimizely/optimizely-sdk' import { isEmpty } from 'lodash' diff --git a/packages/web/src/services/serviceMonitoring.ts b/packages/web/src/services/serviceMonitoring.ts index 7ccfadc20d9..e7e22056285 100644 --- a/packages/web/src/services/serviceMonitoring.ts +++ b/packages/web/src/services/serviceMonitoring.ts @@ -1,9 +1,5 @@ -import { - Name, - MonitorPayload, - ServiceMonitorType, - IntKeys -} from '@audius/common' +import { Name, ServiceMonitorType, MonitorPayload } from '@audius/common/models' +import { IntKeys } from '@audius/common/services' import { track } from 'services/analytics' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' diff --git a/packages/web/src/services/solana/WithdrawUSDC.ts b/packages/web/src/services/solana/WithdrawUSDC.ts index 2a4cecdd625..bb3aee5f2cc 100644 --- a/packages/web/src/services/solana/WithdrawUSDC.ts +++ b/packages/web/src/services/solana/WithdrawUSDC.ts @@ -1,4 +1,7 @@ -import { getLookupTableAccounts, getRecentBlockhash } from '@audius/common' +import { + getRecentBlockhash, + getLookupTableAccounts +} from '@audius/common/services' import { MintName } from '@audius/sdk' import { createCloseAccountInstruction, diff --git a/packages/web/src/services/solana/solana.ts b/packages/web/src/services/solana/solana.ts index 7a02ee07324..2dacb710070 100644 --- a/packages/web/src/services/solana/solana.ts +++ b/packages/web/src/services/solana/solana.ts @@ -1,4 +1,5 @@ -import { SolanaWalletAddress, MintName, DEFAULT_MINT } from '@audius/common' +import { SolanaWalletAddress } from '@audius/common/models' +import { DEFAULT_MINT, MintName } from '@audius/common/services' import { Account, getMinimumBalanceForRentExemptAccount, diff --git a/packages/web/src/services/track-download.ts b/packages/web/src/services/track-download.ts index 28a95a2d010..dff0242495b 100644 --- a/packages/web/src/services/track-download.ts +++ b/packages/web/src/services/track-download.ts @@ -1,9 +1,9 @@ import { - TrackDownload as TrackDownloadBase, - type DownloadTrackArgs, DownloadFile, - tracksSocialActions -} from '@audius/common' + TrackDownload as TrackDownloadBase, + type DownloadTrackArgs +} from '@audius/common/services' +import { tracksSocialActions } from '@audius/common/store' import { downloadZip } from 'client-zip' import { audiusBackendInstance } from './audius-backend/audius-backend-instance' diff --git a/packages/web/src/services/wallet-client.ts b/packages/web/src/services/wallet-client.ts index 8f506d51cf1..48fb5bd3d25 100644 --- a/packages/web/src/services/wallet-client.ts +++ b/packages/web/src/services/wallet-client.ts @@ -1,4 +1,4 @@ -import { WalletClient } from '@audius/common' +import { WalletClient } from '@audius/common/services' import { apiClient } from './audius-api-client' import { audiusBackendInstance } from './audius-backend/audius-backend-instance' diff --git a/packages/web/src/services/web3-modal/index.ts b/packages/web/src/services/web3-modal/index.ts index 9192c54dd74..f8ad2af6315 100644 --- a/packages/web/src/services/web3-modal/index.ts +++ b/packages/web/src/services/web3-modal/index.ts @@ -1,4 +1,4 @@ -import { getErrorMessage } from '@audius/common' +import { getErrorMessage } from '@audius/common/utils' import type { IProviderOptions } from 'web3modal' import phantomIconPurpleSvg from 'assets/img/phantom-icon-purple.svg' diff --git a/packages/web/src/services/webVitals.ts b/packages/web/src/services/webVitals.ts index 018d4fc2bfc..ef48496e77b 100644 --- a/packages/web/src/services/webVitals.ts +++ b/packages/web/src/services/webVitals.ts @@ -1,4 +1,4 @@ -import { Name } from '@audius/common' +import { Name } from '@audius/common/models' import { Location } from 'history' import { getCLS, getFID, getLCP, getFCP, getTTFB } from 'web-vitals' diff --git a/packages/web/src/ssr/+onRenderHtml.tsx b/packages/web/src/ssr/+onRenderHtml.tsx index 4cb18f29a04..b0c494f0b12 100644 --- a/packages/web/src/ssr/+onRenderHtml.tsx +++ b/packages/web/src/ssr/+onRenderHtml.tsx @@ -1,4 +1,4 @@ -import { SsrPageProps } from '@audius/common' +import { SsrPageProps } from '@audius/common/models' import { createMemoryHistory } from 'history' import ReactDOMServer from 'react-dom/server' import { Helmet } from 'react-helmet' diff --git a/packages/web/src/ssr/SsrContext.tsx b/packages/web/src/ssr/SsrContext.tsx index f41bd04b154..5d38e11fab4 100644 --- a/packages/web/src/ssr/SsrContext.tsx +++ b/packages/web/src/ssr/SsrContext.tsx @@ -1,6 +1,7 @@ import { createContext, memo, useContext } from 'react' -import { Nullable, SsrPageProps } from '@audius/common' +import { SsrPageProps } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' import { History } from 'history' import { isMobile as isMobileClient } from 'utils/clientUtil' diff --git a/packages/web/src/ssr/track/+onBeforeRender.tsx b/packages/web/src/ssr/track/+onBeforeRender.tsx index fe6f8a745fe..3a923a6a7bb 100644 --- a/packages/web/src/ssr/track/+onBeforeRender.tsx +++ b/packages/web/src/ssr/track/+onBeforeRender.tsx @@ -1,4 +1,4 @@ -import type { Maybe } from '@audius/common' +import { Maybe } from '@audius/common/utils' import { sdk, full as FullSdk, diff --git a/packages/web/src/store/account/sagas.ts b/packages/web/src/store/account/sagas.ts index 349175264b6..017a25f73d2 100644 --- a/packages/web/src/store/account/sagas.ts +++ b/packages/web/src/store/account/sagas.ts @@ -1,10 +1,10 @@ import { accountActions, accountSelectors, + accountSagas as commonAccountSagas, settingsPageActions, - modalsActions, - accountSagas as commonAccountSagas -} from '@audius/common' + modalsActions +} from '@audius/common/store' import { call, getContext, put, select, takeEvery } from 'typed-redux-saga' import webCommonAccountSagas from 'common/store/account/sagas' diff --git a/packages/web/src/store/analytics/sagas.ts b/packages/web/src/store/analytics/sagas.ts index 3462d12dc76..ef876f965d9 100644 --- a/packages/web/src/store/analytics/sagas.ts +++ b/packages/web/src/store/analytics/sagas.ts @@ -1,4 +1,5 @@ -import { Name, getContext } from '@audius/common' +import { Name } from '@audius/common/models' +import { getContext } from '@audius/common/store' import { LOCATION_CHANGE } from 'connected-react-router' import { take } from 'redux-saga/effects' diff --git a/packages/web/src/store/application/ui/buy-audio/sagas.ts b/packages/web/src/store/application/ui/buy-audio/sagas.ts index 7e867525230..680f8369d1b 100644 --- a/packages/web/src/store/application/ui/buy-audio/sagas.ts +++ b/packages/web/src/store/application/ui/buy-audio/sagas.ts @@ -1,37 +1,39 @@ -/* eslint-disable new-cap */ +import { Name, ErrorLevel, BNWei } from '@audius/common/models' import { IntKeys, - Name, - getContext, + FeatureFlags, + deriveUserBankPubkey, + createUserBankIfNeeded, + LocalStorage +} from '@audius/common/services' +import { + solanaSelectors, + walletSelectors, walletActions, - convertBigIntToAmountObject, - convertWAudioToWei, - formatWei, - weiToString, - TOKEN_LISTING_MAP, - buyAudioSelectors, - PurchaseInfoErrorType, buyAudioActions, - OnRampProvider, + buyAudioSelectors, transactionDetailsActions, - TransactionMetadataType, + modalsActions, + OnRampProvider, + PurchaseInfoErrorType, + TOKEN_LISTING_MAP, TransactionType, TransactionMethod, - TransactionDetails, - walletSelectors, - BNWei, - createUserBankIfNeeded, - modalsActions, + TransactionMetadataType, + getContext, AmountObject, - FeatureFlags, - ErrorLevel, - LocalStorage, - solanaSelectors, - deriveUserBankPubkey, - convertWeiToWAudio, + TransactionDetails +} from '@audius/common/store' +import { + dayjs, isNullOrUndefined, - dayjs -} from '@audius/common' + weiToString, + formatWei, + convertBigIntToAmountObject, + convertWAudioToWei, + convertWeiToWAudio +} from '@audius/common/utils' +/* eslint-disable new-cap */ import { TransactionHandler } from '@audius/sdk/dist/core' import { QuoteResponse } from '@jup-ag/api' import { diff --git a/packages/web/src/store/application/ui/chat/sagas.ts b/packages/web/src/store/application/ui/chat/sagas.ts index dcd75c9dedb..527a79266d6 100644 --- a/packages/web/src/store/application/ui/chat/sagas.ts +++ b/packages/web/src/store/application/ui/chat/sagas.ts @@ -1,4 +1,4 @@ -import { chatActions } from '@audius/common' +import { chatActions } from '@audius/common/store' import { push as pushRoute } from 'connected-react-router' import { takeLatest } from 'redux-saga/effects' import { put } from 'typed-redux-saga' diff --git a/packages/web/src/store/application/ui/notifications/notificationsUISelectors.ts b/packages/web/src/store/application/ui/notifications/notificationsUISelectors.ts index c4bacf1d0c4..a5e6e17a8c3 100644 --- a/packages/web/src/store/application/ui/notifications/notificationsUISelectors.ts +++ b/packages/web/src/store/application/ui/notifications/notificationsUISelectors.ts @@ -1,8 +1,8 @@ import { - AnnouncementNotification, notificationsSelectors, - Nullable -} from '@audius/common' + AnnouncementNotification +} from '@audius/common/store' +import { Nullable } from '@audius/common/utils' import { AppState } from 'store/types' diff --git a/packages/web/src/store/application/ui/notifications/notificationsUISlice.ts b/packages/web/src/store/application/ui/notifications/notificationsUISlice.ts index 18da6ab237c..dc5260f82a8 100644 --- a/packages/web/src/store/application/ui/notifications/notificationsUISlice.ts +++ b/packages/web/src/store/application/ui/notifications/notificationsUISlice.ts @@ -1,4 +1,4 @@ -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import { createSlice, PayloadAction } from '@reduxjs/toolkit' export type NotificationsUIState = { diff --git a/packages/web/src/store/application/ui/setAsArtistPickConfirmation/actions.ts b/packages/web/src/store/application/ui/setAsArtistPickConfirmation/actions.ts index 985e0e443ba..3ed0253dffc 100644 --- a/packages/web/src/store/application/ui/setAsArtistPickConfirmation/actions.ts +++ b/packages/web/src/store/application/ui/setAsArtistPickConfirmation/actions.ts @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' // actions export const SHOW_SET_AS_ARTIST_PICK_CONFIRMATION = 'SET_AS_ARTIST_PICK/SHOW' diff --git a/packages/web/src/store/application/ui/setAsArtistPickConfirmation/types.ts b/packages/web/src/store/application/ui/setAsArtistPickConfirmation/types.ts index d070ffac18b..403f7b564b9 100644 --- a/packages/web/src/store/application/ui/setAsArtistPickConfirmation/types.ts +++ b/packages/web/src/store/application/ui/setAsArtistPickConfirmation/types.ts @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' export enum PinTrackAction { ADD = 'ADD', diff --git a/packages/web/src/store/application/ui/stemsUpload/sagas.ts b/packages/web/src/store/application/ui/stemsUpload/sagas.ts index 31af44f1c35..00611466778 100644 --- a/packages/web/src/store/application/ui/stemsUpload/sagas.ts +++ b/packages/web/src/store/application/ui/stemsUpload/sagas.ts @@ -1,11 +1,9 @@ +import { Name, Track, User } from '@audius/common/models' import { - Name, - Track, - User, cacheTracksSelectors, cacheUsersSelectors, stemsUploadActions -} from '@audius/common' +} from '@audius/common/store' import { takeEvery, put, call, select } from 'redux-saga/effects' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/store/application/ui/theme/sagas.ts b/packages/web/src/store/application/ui/theme/sagas.ts index 7990b94960b..93d2d9e1564 100644 --- a/packages/web/src/store/application/ui/theme/sagas.ts +++ b/packages/web/src/store/application/ui/theme/sagas.ts @@ -1,4 +1,6 @@ -import { Theme, themeActions, actionChannelDispatcher } from '@audius/common' +import { Theme } from '@audius/common/models' +import { themeActions } from '@audius/common/store' +import { actionChannelDispatcher } from '@audius/common/utils' import { PayloadAction } from '@reduxjs/toolkit' import { eventChannel } from 'redux-saga' import { spawn, takeEvery } from 'redux-saga/effects' diff --git a/packages/web/src/store/application/ui/userListModal/sagas.ts b/packages/web/src/store/application/ui/userListModal/sagas.ts index a7574bdc5d0..e4e62c5026e 100644 --- a/packages/web/src/store/application/ui/userListModal/sagas.ts +++ b/packages/web/src/store/application/ui/userListModal/sagas.ts @@ -1,16 +1,16 @@ +import { FavoriteType } from '@audius/common/models' import { - FavoriteType, topSupportersUserListActions as topSupporterActions, supportingUserListActions as supportingActions, - RepostType, repostsUserListActions as repostActions, notificationsUserListActions as notificationActions, mutualsUserListActions, followingUserListActions as followingActions, followersUserListActions as followerActions, favoritesUserListActions as favoritesActions, - relatedArtistsUserListActions -} from '@audius/common' + relatedArtistsUserListActions, + RepostType +} from '@audius/common/store' import { takeEvery, put } from 'redux-saga/effects' import { setUsers } from './slice' diff --git a/packages/web/src/store/application/ui/userListModal/slice.ts b/packages/web/src/store/application/ui/userListModal/slice.ts index 309dff4a4e1..addc936869a 100644 --- a/packages/web/src/store/application/ui/userListModal/slice.ts +++ b/packages/web/src/store/application/ui/userListModal/slice.ts @@ -1,4 +1,4 @@ -import { ID } from '@audius/common' +import { ID } from '@audius/common/models' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { UserListModalState, UserListType, UserListEntityType } from './types' diff --git a/packages/web/src/store/application/ui/withdraw-usdc/sagas.ts b/packages/web/src/store/application/ui/withdraw-usdc/sagas.ts index 026f213e8f1..9ce796e928f 100644 --- a/packages/web/src/store/application/ui/withdraw-usdc/sagas.ts +++ b/packages/web/src/store/application/ui/withdraw-usdc/sagas.ts @@ -1,24 +1,28 @@ import { - withdrawUSDCActions, - solanaSelectors, + Name, ErrorLevel, - SolanaWalletAddress, - getUSDCUserBank, - getContext, - TOKEN_LISTING_MAP, - getUserbankAccountInfo, + Status, + WithdrawUSDCTransferEventFields, BNUSDC, - relayVersionedTransaction, + SolanaWalletAddress +} from '@audius/common/models' +import { + getUserbankAccountInfo, relayTransaction, - formatUSDCWeiToFloorCentsNumber, - Name, - WithdrawUSDCTransferEventFields, - withdrawUSDCModalActions, + relayVersionedTransaction +} from '@audius/common/services' +import { + buyUSDCActions, + getUSDCUserBank, + solanaSelectors, + withdrawUSDCActions, WithdrawUSDCModalPages, + withdrawUSDCModalActions, + TOKEN_LISTING_MAP, WithdrawMethod, - buyUSDCActions, - Status -} from '@audius/common' + getContext +} from '@audius/common/store' +import { formatUSDCWeiToFloorCentsNumber } from '@audius/common/utils' import { createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync diff --git a/packages/web/src/store/configureStore.ts b/packages/web/src/store/configureStore.ts index 9e5ee403941..dfae87b0d62 100644 --- a/packages/web/src/store/configureStore.ts +++ b/packages/web/src/store/configureStore.ts @@ -1,4 +1,5 @@ -import { SsrPageProps, chatMiddleware, ErrorLevel, Name } from '@audius/common' +import { Name, ErrorLevel, SsrPageProps } from '@audius/common/models' +import { chatMiddleware } from '@audius/common/store' import { composeWithDevToolsLogOnlyInProduction } from '@redux-devtools/extension' import { configureScope, addBreadcrumb } from '@sentry/browser' import { routerMiddleware } from 'connected-react-router' diff --git a/packages/web/src/store/dragndrop/slice.ts b/packages/web/src/store/dragndrop/slice.ts index d9db2927001..9e13387f5ed 100644 --- a/packages/web/src/store/dragndrop/slice.ts +++ b/packages/web/src/store/dragndrop/slice.ts @@ -1,4 +1,4 @@ -import { ID, PlaylistLibraryKind } from '@audius/common' +import { ID, PlaylistLibraryKind } from '@audius/common/models' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { AppState } from 'store/types' diff --git a/packages/web/src/store/errors/actions.ts b/packages/web/src/store/errors/actions.ts index 1519ba865a8..d0abee55bb5 100644 --- a/packages/web/src/store/errors/actions.ts +++ b/packages/web/src/store/errors/actions.ts @@ -1,8 +1,8 @@ import { + ErrorLevel, AdditionalErrorReportInfo, - ReportToSentryArgs, - ErrorLevel -} from '@audius/common' + ReportToSentryArgs +} from '@audius/common/models' export const HANDLE_ERROR = 'ERROR/HANDLE_ERROR' export const OPEN_ERROR_PAGE = 'ERROR/OPEN_ERROR_PAGE' diff --git a/packages/web/src/store/errors/reducers.ts b/packages/web/src/store/errors/reducers.ts index 742dc9ba58b..b90fad58c1b 100644 --- a/packages/web/src/store/errors/reducers.ts +++ b/packages/web/src/store/errors/reducers.ts @@ -1,4 +1,4 @@ -import { SsrPageProps } from '@audius/common' +import { SsrPageProps } from '@audius/common/models' import { createReducer } from 'typesafe-actions' import { diff --git a/packages/web/src/store/errors/reportToSentry.ts b/packages/web/src/store/errors/reportToSentry.ts index f2af13b9512..1d29992d969 100644 --- a/packages/web/src/store/errors/reportToSentry.ts +++ b/packages/web/src/store/errors/reportToSentry.ts @@ -1,4 +1,5 @@ -import { getErrorMessage, ReportToSentryArgs, ErrorLevel } from '@audius/common' +import { ErrorLevel, ReportToSentryArgs } from '@audius/common/models' +import { getErrorMessage } from '@audius/common/utils' import { withScope, captureException } from '@sentry/browser' import type { SeverityLevel } from '@sentry/types' diff --git a/packages/web/src/store/errors/sagas.ts b/packages/web/src/store/errors/sagas.ts index 6d38c6a211d..e1b75256d9f 100644 --- a/packages/web/src/store/errors/sagas.ts +++ b/packages/web/src/store/errors/sagas.ts @@ -1,4 +1,4 @@ -import { toastActions } from '@audius/common' +import { toastActions } from '@audius/common/store' import { takeEvery, put } from 'redux-saga/effects' import * as errorActions from './actions' diff --git a/packages/web/src/store/lineup/lineupForRoute.js b/packages/web/src/store/lineup/lineupForRoute.js index df95e7dceb0..659564d08b8 100644 --- a/packages/web/src/store/lineup/lineupForRoute.js +++ b/packages/web/src/store/lineup/lineupForRoute.js @@ -1,13 +1,13 @@ import { - trackPageSelectors, trendingPageSelectors, + trackPageSelectors, searchResultsPageSelectors, savedPageSelectors, profilePageSelectors, historyPageSelectors, feedPageSelectors, collectionPageSelectors -} from '@audius/common' +} from '@audius/common/store' import { matchPath } from 'react-router' import { diff --git a/packages/web/src/store/lineup/store.test.js b/packages/web/src/store/lineup/store.test.js index 135320738ff..8bfc967925f 100644 --- a/packages/web/src/store/lineup/store.test.js +++ b/packages/web/src/store/lineup/store.test.js @@ -1,13 +1,13 @@ +import { Kind } from '@audius/common/models' import { - Kind, cacheReducer, - LineupBaseActions, lineupReducer, + LineupBaseActions, queueReducer, initialQueueState, playerReducer, initialPlayerState -} from '@audius/common' +} from '@audius/common/store' import { combineReducers } from 'redux' import { all } from 'redux-saga/effects' import { expectSaga } from 'redux-saga-test-plan' diff --git a/packages/web/src/store/notifications/sagas.ts b/packages/web/src/store/notifications/sagas.ts index 3ace240634c..ef6f289c64c 100644 --- a/packages/web/src/store/notifications/sagas.ts +++ b/packages/web/src/store/notifications/sagas.ts @@ -1,4 +1,5 @@ -import { accountSelectors, getContext, waitForValue } from '@audius/common' +import { accountSelectors, getContext } from '@audius/common/store' +import { waitForValue } from '@audius/common/utils' import { eventChannel } from 'redux-saga' import { call, delay, fork, take } from 'typed-redux-saga' diff --git a/packages/web/src/store/reachability/sagas.ts b/packages/web/src/store/reachability/sagas.ts index f5816d14468..99d8a1349aa 100644 --- a/packages/web/src/store/reachability/sagas.ts +++ b/packages/web/src/store/reachability/sagas.ts @@ -2,7 +2,7 @@ import { reachabilityActions, reachabilitySelectors, getContext -} from '@audius/common' +} from '@audius/common/store' import { delay, race, put, all, take, select, call } from 'typed-redux-saga' import { isMobileWeb } from 'common/utils/isMobileWeb' diff --git a/packages/web/src/store/reducers.ts b/packages/web/src/store/reducers.ts index 51ac9d9e6f0..70358334b8d 100644 --- a/packages/web/src/store/reducers.ts +++ b/packages/web/src/store/reducers.ts @@ -1,9 +1,9 @@ +import { SsrPageProps } from '@audius/common/models' import { queueReducer as queue, remoteConfigReducer as remoteConfig, - reducers as clientStoreReducers, - SsrPageProps -} from '@audius/common' + reducers as clientStoreReducers +} from '@audius/common/store' import { connectRouter } from 'connected-react-router' import { History } from 'history' import localForage from 'localforage' diff --git a/packages/web/src/store/sagas.ts b/packages/web/src/store/sagas.ts index 3fb436d51f7..c7a5127450c 100644 --- a/packages/web/src/store/sagas.ts +++ b/packages/web/src/store/sagas.ts @@ -1,30 +1,30 @@ import { + buyCryptoSagas, buyUSDCSagas, castSagas, - playerSagas as commonPlayerSagas, - playbackPositionSagas, chatSagas, - gatedContentSagas, - purchaseContentSagas, + reachabilitySagas as commonReachabilitySagas, remoteConfigSagas, + solanaSagas, + relatedArtistsSagas, deletePlaylistConfirmationModalUISagas as deletePlaylistConfirmationModalSagas, duplicateAddConfirmationModalUISagas as duplicateAddConfirmationModalSagas, - uploadConfirmationModalUISagas as uploadConfirmationModalSagas, - publishTrackConfirmationModalUISagas as publishTrackConfirmationModalSagas, - publishPlaylistConfirmationModalUISagas as publishPlaylistConfirmationModalSagas, mobileOverflowMenuUISagas as overflowMenuSagas, + publishPlaylistConfirmationModalUISagas as publishPlaylistConfirmationModalSagas, shareModalUISagas as shareModalSagas, stripeModalUISagas as stripeModalSagas, - toastSagas, vipDiscordModalSagas, - reachabilitySagas as commonReachabilitySagas, + toastSagas, + uploadConfirmationModalUISagas as uploadConfirmationModalSagas, + publishTrackConfirmationModalUISagas as publishTrackConfirmationModalSagas, searchUsersModalSagas, - relatedArtistsSagas, - solanaSagas, - confirmerSagas, - buyCryptoSagas, - modalsSagas -} from '@audius/common' + modalsSagas, + playerSagas as commonPlayerSagas, + playbackPositionSagas, + gatedContentSagas, + purchaseContentSagas, + confirmerSagas +} from '@audius/common/store' import { all, fork } from 'redux-saga/effects' import addToCollectionSagas from 'common/store/add-to-collection/sagas' diff --git a/packages/web/src/store/sign-out/sagas.ts b/packages/web/src/store/sign-out/sagas.ts index d009adedd86..5bff40ddbb0 100644 --- a/packages/web/src/store/sign-out/sagas.ts +++ b/packages/web/src/store/sign-out/sagas.ts @@ -1,10 +1,10 @@ +import { Name } from '@audius/common/models' import { - Name, - signOutActions, - getContext, accountActions, - tokenDashboardPageActions -} from '@audius/common' + tokenDashboardPageActions, + signOutActions, + getContext +} from '@audius/common/store' import { takeLatest, put } from 'redux-saga/effects' import { make } from 'common/store/analytics/actions' diff --git a/packages/web/src/store/sign-out/signOut.ts b/packages/web/src/store/sign-out/signOut.ts index e827c6020b1..a5e7026dfd1 100644 --- a/packages/web/src/store/sign-out/signOut.ts +++ b/packages/web/src/store/sign-out/signOut.ts @@ -1,4 +1,4 @@ -import { AudiusBackend, LocalStorage } from '@audius/common' +import { LocalStorage, AudiusBackend } from '@audius/common/services' import { removeHasRequestedBrowserPermission } from 'utils/browserNotifications' diff --git a/packages/web/src/store/storeContext.ts b/packages/web/src/store/storeContext.ts index 51051b12a4c..2c63f23fb31 100644 --- a/packages/web/src/store/storeContext.ts +++ b/packages/web/src/store/storeContext.ts @@ -1,9 +1,9 @@ import { - SolanaClient, - CommonStoreContext, + FeatureFlags, OpenSeaClient, - FeatureFlags -} from '@audius/common' + SolanaClient +} from '@audius/common/services' +import { CommonStoreContext } from '@audius/common/store' import { setTag, configureScope } from '@sentry/browser' import * as analytics from 'services/analytics' diff --git a/packages/web/src/store/token-dashboard/connectNewWalletSaga.ts b/packages/web/src/store/token-dashboard/connectNewWalletSaga.ts index bb8630e4456..7306633b735 100644 --- a/packages/web/src/store/token-dashboard/connectNewWalletSaga.ts +++ b/packages/web/src/store/token-dashboard/connectNewWalletSaga.ts @@ -1,4 +1,5 @@ -import { getContext, Name, tokenDashboardPageActions } from '@audius/common' +import { Name } from '@audius/common/models' +import { tokenDashboardPageActions, getContext } from '@audius/common/store' import { captureException } from '@sentry/browser' import { fork, put, takeEvery } from 'typed-redux-saga' diff --git a/packages/web/src/store/token-dashboard/disconnectWallet.ts b/packages/web/src/store/token-dashboard/disconnectWallet.ts index 5d53818180d..5596b9ef008 100644 --- a/packages/web/src/store/token-dashboard/disconnectWallet.ts +++ b/packages/web/src/store/token-dashboard/disconnectWallet.ts @@ -1,4 +1,4 @@ -import { Chain } from '@audius/common' +import { Chain } from '@audius/common/models' import { call } from 'typed-redux-saga' import { diff --git a/packages/web/src/store/token-dashboard/establishWalletConnection.ts b/packages/web/src/store/token-dashboard/establishWalletConnection.ts index f44c4e4dc61..d02a3b69bc3 100644 --- a/packages/web/src/store/token-dashboard/establishWalletConnection.ts +++ b/packages/web/src/store/token-dashboard/establishWalletConnection.ts @@ -1,10 +1,7 @@ -import { - BooleanKeys, - Chain, - getContext, - getErrorMessage, - tokenDashboardPageActions -} from '@audius/common' +import { Chain } from '@audius/common/models' +import { BooleanKeys } from '@audius/common/services' +import { tokenDashboardPageActions, getContext } from '@audius/common/store' +import { getErrorMessage } from '@audius/common/utils' import { call, put } from 'typed-redux-saga' import { createSession } from 'services/web3-modal' diff --git a/packages/web/src/store/token-dashboard/getWalletAddress.ts b/packages/web/src/store/token-dashboard/getWalletAddress.ts index e7073d30f29..aaa06d71dde 100644 --- a/packages/web/src/store/token-dashboard/getWalletAddress.ts +++ b/packages/web/src/store/token-dashboard/getWalletAddress.ts @@ -1,4 +1,4 @@ -import { Chain } from '@audius/common' +import { Chain } from '@audius/common/models' import { call } from 'typed-redux-saga' import { WalletConnection } from './types' diff --git a/packages/web/src/store/token-dashboard/sagas.ts b/packages/web/src/store/token-dashboard/sagas.ts index 244d2aa6c42..2e2dddb051d 100644 --- a/packages/web/src/store/token-dashboard/sagas.ts +++ b/packages/web/src/store/token-dashboard/sagas.ts @@ -1,11 +1,11 @@ import { - weiToString, - tokenDashboardPageActions, - TokenDashboardPageModalState, tokenDashboardPageSelectors, + tokenDashboardPageActions, walletActions, - modalsActions -} from '@audius/common' + modalsActions, + TokenDashboardPageModalState +} from '@audius/common/store' +import { weiToString } from '@audius/common/utils' import { all, put, race, select, take, takeLatest } from 'typed-redux-saga' import commonTokenDashboardSagas from 'common/store/pages/token-dashboard/sagas' diff --git a/packages/web/src/store/token-dashboard/signMessage.ts b/packages/web/src/store/token-dashboard/signMessage.ts index 4c393b942a9..e333ff479d3 100644 --- a/packages/web/src/store/token-dashboard/signMessage.ts +++ b/packages/web/src/store/token-dashboard/signMessage.ts @@ -1,10 +1,10 @@ +import { Chain } from '@audius/common/models' +import { PhantomProvider } from '@audius/common/services' import { accountSelectors, - Chain, - tokenDashboardPageActions, tokenDashboardPageSelectors, - PhantomProvider -} from '@audius/common' + tokenDashboardPageActions +} from '@audius/common/store' import { call, put, select } from 'typed-redux-saga' import { WalletConnection } from './types' diff --git a/packages/web/src/store/token-dashboard/types.ts b/packages/web/src/store/token-dashboard/types.ts index d4177432ab4..d8984c39c2b 100644 --- a/packages/web/src/store/token-dashboard/types.ts +++ b/packages/web/src/store/token-dashboard/types.ts @@ -1,4 +1,5 @@ -import { Chain, PhantomProvider } from '@audius/common' +import { Chain } from '@audius/common/models' +import { PhantomProvider } from '@audius/common/services' export type PhantomWalletConnection = { chain: Chain.Sol diff --git a/packages/web/src/store/types.ts b/packages/web/src/store/types.ts index 18b9f69d423..d1bf092796b 100644 --- a/packages/web/src/store/types.ts +++ b/packages/web/src/store/types.ts @@ -1,21 +1,21 @@ import { averageColorReducer, - ChangePasswordState, - SmartCollectionState, remixesPageReducer as RemixesPageReducer, - HistoryPageState, - CollectionsPageState, queueReducer as QueueReducer, - ReachabilityState, remoteConfigReducer as RemoteConfigReducer, stemsUploadReducer as StemsUploadReducer, - RepostsPageState, - NotificationUsersPageState, - FollowingPageState, - FollowersPageState, + ChangePasswordState, + CollectionsPageState, + HistoryPageState, + SmartCollectionState, + ReachabilityState, + CommonState, FavoritesPageState, - CommonState -} from '@audius/common' + FollowersPageState, + FollowingPageState, + NotificationUsersPageState, + RepostsPageState +} from '@audius/common/store' import { RouterState } from 'connected-react-router' import SignOnPageState from 'common/store/pages/signon/types' diff --git a/packages/web/src/utils/appLinks.ts b/packages/web/src/utils/appLinks.ts index 0c9ad5d2ddb..a94ea8edc4e 100644 --- a/packages/web/src/utils/appLinks.ts +++ b/packages/web/src/utils/appLinks.ts @@ -1,4 +1,4 @@ -import { MobileOS } from '@audius/common' +import { MobileOS } from '@audius/common/models' import { getMobileOS } from './clientUtil' import { IOS_APP_STORE_LINK, IOS_WEBSITE_STORE_LINK } from './route' diff --git a/packages/web/src/utils/browserNotifications.ts b/packages/web/src/utils/browserNotifications.ts index 6736f42c752..e152c2bf9f9 100644 --- a/packages/web/src/utils/browserNotifications.ts +++ b/packages/web/src/utils/browserNotifications.ts @@ -1,4 +1,4 @@ -import { AudiusBackend } from '@audius/common' +import { AudiusBackend } from '@audius/common/services' import { env } from 'services/env' import { isElectron } from 'utils/clientUtil' diff --git a/packages/web/src/utils/clientUtil.ts b/packages/web/src/utils/clientUtil.ts index 005b16cb9a1..7fe301126f7 100644 --- a/packages/web/src/utils/clientUtil.ts +++ b/packages/web/src/utils/clientUtil.ts @@ -1,4 +1,4 @@ -import { Client, OS, MobileOS } from '@audius/common' +import { Client, OS, MobileOS } from '@audius/common/models' declare global { interface Window { diff --git a/packages/web/src/utils/dateUtils.ts b/packages/web/src/utils/dateUtils.ts index ccfdc3b37d3..2d24a35313a 100644 --- a/packages/web/src/utils/dateUtils.ts +++ b/packages/web/src/utils/dateUtils.ts @@ -1,4 +1,4 @@ -import { getLocalTimezone } from '@audius/common' +import { getLocalTimezone } from '@audius/common/utils' import moment from 'moment' import { Nullable } from 'vitest' diff --git a/packages/web/src/utils/domUtils.ts b/packages/web/src/utils/domUtils.ts index 7a61506d738..080ea1fe17c 100644 --- a/packages/web/src/utils/domUtils.ts +++ b/packages/web/src/utils/domUtils.ts @@ -1,4 +1,4 @@ -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' export const findAncestor = (el: Element, selector: string) => { if (el.closest) { diff --git a/packages/web/src/utils/errorSagas.ts b/packages/web/src/utils/errorSagas.ts index 6a5b04d4736..199cf281a24 100644 --- a/packages/web/src/utils/errorSagas.ts +++ b/packages/web/src/utils/errorSagas.ts @@ -1,4 +1,4 @@ -import { AdditionalErrorReportInfo } from '@audius/common' +import { AdditionalErrorReportInfo } from '@audius/common/models' import { takeEvery, put } from 'redux-saga/effects' import * as errorActions from 'store/errors/actions' diff --git a/packages/web/src/utils/gdpr.ts b/packages/web/src/utils/gdpr.ts index c1d1182b5c2..742af00b117 100644 --- a/packages/web/src/utils/gdpr.ts +++ b/packages/web/src/utils/gdpr.ts @@ -1,4 +1,4 @@ -import { Nullable } from '@audius/common' +import { Nullable } from '@audius/common/utils' import { getLocation } from 'services/Location' import { env } from 'services/env' diff --git a/packages/web/src/utils/restrictedHandles.ts b/packages/web/src/utils/restrictedHandles.ts index 9e9145aa080..23a20656cc8 100644 --- a/packages/web/src/utils/restrictedHandles.ts +++ b/packages/web/src/utils/restrictedHandles.ts @@ -1,4 +1,4 @@ -import { restrictedHandles as commonRestrictedHandles } from '@audius/common' +import { restrictedHandles as commonRestrictedHandles } from '@audius/common/utils' import { orderedRoutes } from 'utils/route' diff --git a/packages/web/src/utils/route.ts b/packages/web/src/utils/route.ts index 69c9c50cde6..74c394c8f53 100644 --- a/packages/web/src/utils/route.ts +++ b/packages/web/src/utils/route.ts @@ -1,4 +1,6 @@ -import { Env, ID, encodeUrlName, getHash } from '@audius/common' +import { ID } from '@audius/common/models' +import { Env } from '@audius/common/services' +import { encodeUrlName, getHash } from '@audius/common/utils' import { push as pushRoute } from 'connected-react-router' import { Location } from 'history' import { matchPath } from 'react-router' diff --git a/packages/web/src/utils/route/collectionRouteParser.ts b/packages/web/src/utils/route/collectionRouteParser.ts index da3ca098c04..2afee2ff733 100644 --- a/packages/web/src/utils/route/collectionRouteParser.ts +++ b/packages/web/src/utils/route/collectionRouteParser.ts @@ -1,4 +1,5 @@ -import { ID, decodeHashId } from '@audius/common' +import { ID } from '@audius/common/models' +import { decodeHashId } from '@audius/common/utils' import { matchPath } from 'react-router-dom' import { diff --git a/packages/web/src/utils/route/trackRouteParser.ts b/packages/web/src/utils/route/trackRouteParser.ts index a409426e4bb..62a97456961 100644 --- a/packages/web/src/utils/route/trackRouteParser.ts +++ b/packages/web/src/utils/route/trackRouteParser.ts @@ -1,4 +1,5 @@ -import { ID, decodeHashId } from '@audius/common' +import { ID } from '@audius/common/models' +import { decodeHashId } from '@audius/common/utils' import { matchPath } from 'react-router-dom' import { TRACK_ID_PAGE, TRACK_PAGE } from 'utils/route' diff --git a/packages/web/src/utils/route/userRouteParser.ts b/packages/web/src/utils/route/userRouteParser.ts index 43a26fb7059..9a5e32f2db6 100644 --- a/packages/web/src/utils/route/userRouteParser.ts +++ b/packages/web/src/utils/route/userRouteParser.ts @@ -1,4 +1,6 @@ -import { ID, decodeHashId, ProfilePageTabRoute } from '@audius/common' +import { ID } from '@audius/common/models' +import { ProfilePageTabRoute } from '@audius/common/store' +import { decodeHashId } from '@audius/common/utils' import { matchPath } from 'react-router-dom' import { USER_ID_PAGE, PROFILE_PAGE, staticRoutes } from 'utils/route' diff --git a/packages/web/src/utils/sagaHelpers.ts b/packages/web/src/utils/sagaHelpers.ts index 10d6893675c..15f3002dd57 100644 --- a/packages/web/src/utils/sagaHelpers.ts +++ b/packages/web/src/utils/sagaHelpers.ts @@ -1,4 +1,4 @@ -import { waitForAccount } from '@audius/common' +import { waitForAccount } from '@audius/common/utils' import { call } from 'typed-redux-saga' import { waitForBackendSetup } from 'common/store/backend/sagas' diff --git a/packages/web/src/utils/sagaPollingDaemons.ts b/packages/web/src/utils/sagaPollingDaemons.ts index 0db15fd8d86..1bd83096079 100644 --- a/packages/web/src/utils/sagaPollingDaemons.ts +++ b/packages/web/src/utils/sagaPollingDaemons.ts @@ -1,4 +1,4 @@ -import { getContext } from '@audius/common' +import { getContext } from '@audius/common/store' import { Action } from 'redux' import { eventChannel } from 'redux-saga' import { select, put, take, delay } from 'redux-saga/effects' diff --git a/packages/web/src/utils/stems.ts b/packages/web/src/utils/stems.ts index 5afd507e954..675e2b556bf 100644 --- a/packages/web/src/utils/stems.ts +++ b/packages/web/src/utils/stems.ts @@ -1,4 +1,4 @@ -import { StemCategory } from '@audius/common' +import { StemCategory } from '@audius/common/models' export const stemDropdownRows = [ StemCategory.INSTRUMENTAL, diff --git a/packages/web/src/utils/theme/theme.ts b/packages/web/src/utils/theme/theme.ts index aabb83317a4..51b9b1df6f0 100644 --- a/packages/web/src/utils/theme/theme.ts +++ b/packages/web/src/utils/theme/theme.ts @@ -1,4 +1,4 @@ -import { Theme } from '@audius/common' +import { Theme } from '@audius/common/models' import DarkTheme from './dark' import DefaultTheme from './default' diff --git a/packages/web/src/utils/tweet.ts b/packages/web/src/utils/tweet.ts index 99b1cdd1370..8bec5b7f685 100644 --- a/packages/web/src/utils/tweet.ts +++ b/packages/web/src/utils/tweet.ts @@ -1,4 +1,4 @@ -import { makeTwitterShareUrl } from '@audius/common' +import { makeTwitterShareUrl } from '@audius/common/utils' export const openTwitterLink = (url: string | null, text: string) => { const twitterShareLink = makeTwitterShareUrl(url, text) diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 2cecddb9f4b..a04806c3271 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -11,7 +11,7 @@ "strict": true, "forceConsistentCasingInFileNames": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, @@ -19,10 +19,12 @@ "jsxImportSource": "@emotion/react", "downlevelIteration": true, "noFallthroughCasesInSwitch": true, + "suppressImplicitAnyIndexErrors": true, + "ignoreDeprecations": "5.0", "types": ["vite/client"], "paths": { - "@audius/trpc-server": ["../trpc-server/src/index.ts"], + "~/*": ["../../common/src/*"] } }, - "include": ["src"] + "include": ["src", "src/**/*.css"] } diff --git a/packages/web/vite.config.ts b/packages/web/vite.config.ts index 9d5e4a9771b..9d426086a9c 100644 --- a/packages/web/vite.config.ts +++ b/packages/web/vite.config.ts @@ -10,6 +10,7 @@ import glslify from 'vite-plugin-glslify' import svgr from 'vite-plugin-svgr' import { env as APP_ENV } from './src/services/env' +import path from 'path' const fixAcceptHeader404 = () => ({ // Fix issue with vite dev server and `wait-on` @@ -61,11 +62,6 @@ export default defineConfig(({ mode }) => { } }, plugins: [ - // TODO: Enable once https://github.com/aleclarson/vite-tsconfig-paths/issues/110 - // is resolved - // tsconfigPaths({ - // root: './packages' - // }), glslify(), svgr({ include: '**/*.svg' @@ -119,7 +115,7 @@ export default defineConfig(({ mode }) => { ], resolve: { alias: { - // Should be able to use vite-tsconfig-paths instead + // Can't use vite-tsconfig-paths because of vike app: '/src/app', assets: '/src/assets', common: '/src/common', @@ -132,6 +128,7 @@ export default defineConfig(({ mode }) => { workers: '/src/workers', utils: '/src/utils', ssr: '/src/ssr', + '~': path.resolve(__dirname, '../../packages/common/src'), os: require.resolve('os-browserify'), path: require.resolve('path-browserify'), diff --git a/protocol-dashboard/src/components/UserInfo/AudiusProfileBadges.tsx b/protocol-dashboard/src/components/UserInfo/AudiusProfileBadges.tsx index b40a9b17f43..160dde42fc5 100644 --- a/protocol-dashboard/src/components/UserInfo/AudiusProfileBadges.tsx +++ b/protocol-dashboard/src/components/UserInfo/AudiusProfileBadges.tsx @@ -1,6 +1,5 @@ import { cloneElement, ReactElement } from 'react' -import { BadgeTier, badgeTiers, Nullable } from '@audius/common' import { User } from '@audius/sdk' import IconBronzeBadgeSVG from 'assets/img/iconBronzeBadge.svg?react' @@ -8,6 +7,9 @@ import IconGoldBadgeSVG from 'assets/img/iconGoldBadge.svg?react' import IconPlatinumBadgeSVG from 'assets/img/iconPlatinumBadge.svg?react' import IconSilverBadgeSVG from 'assets/img/iconSilverBadge.svg?react' import IconVerifiedSVG from 'assets/img/iconVerified.svg?react' +import { BadgeTier } from '@audius/common/models' +import { Nullable } from '@audius/common/utils' +import { badgeTiers } from '@audius/common/store' import cn from 'classnames' diff --git a/protocol-dashboard/tsconfig.json b/protocol-dashboard/tsconfig.json index 5b2d451fdfd..3fa8b1f5d4e 100644 --- a/protocol-dashboard/tsconfig.json +++ b/protocol-dashboard/tsconfig.json @@ -32,6 +32,7 @@ "models/*": ["./src/models/*"], "types": ["./src/types"], "assets/*": ["./src/assets/*"], + "~/*": ["../packages/common/src/*"] } }, "include": ["src"], diff --git a/protocol-dashboard/vite.config.ts b/protocol-dashboard/vite.config.ts index be2c21b1595..a952a97cfc6 100644 --- a/protocol-dashboard/vite.config.ts +++ b/protocol-dashboard/vite.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'vite' +import path from 'path' import react from '@vitejs/plugin-react-swc' import svgr from 'vite-plugin-svgr' import { nodePolyfills } from 'vite-plugin-node-polyfills' @@ -31,7 +32,8 @@ export default defineConfig({ hooks: '/src/hooks', models: '/src/models', types: '/src/types', - assets: '/src/assets' + assets: '/src/assets', + '~': path.resolve(__dirname, '../packages/common/src') } },