diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index f6a185fbaa1..00000000000 --- a/.eslintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": ["standard", "standard-react", "prettier"], - "env": { - "browser": true, - "jest": true, - "mocha": true, - "node": true - }, - "rules": { - "camelcase": 0, - "no-mixed-operators": 0, - "no-new": 0, - "react/jsx-indent": 0, - "react/prop-types": 0 - }, - "globals": { - "cy": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000000..b7d38819a2f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,110 @@ +const path = require("path") + +module.exports = { + parser: "@typescript-eslint/parser", + + plugins: [ + "react-hooks", + "@typescript-eslint", + // TODO: Add support for Graphql + /*, "graphql" */ + ], + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:@typescript-eslint/recommended", + "prettier", + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 6, + project: "./tsconfig.json", + sourceType: "module", + }, + settings: { + react: { + version: "detect", + }, + }, + env: { + es6: true, + browser: true, + jest: true, + node: true, + }, + rules: { + "@typescript-eslint/ban-ts-ignore": 0, + "@typescript-eslint/camelcase": 0, + "@typescript-eslint/explicit-function-return-type": 0, + "@typescript-eslint/explicit-member-accessibility": 0, + "@typescript-eslint/indent": 0, + "@typescript-eslint/member-delimiter-style": 0, + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-inferrable-types": 0, + "@typescript-eslint/no-use-before-define": 0, + "@typescript-eslint/no-unused-vars": 0, + "@typescript-eslint/no-var-requires": 0, + "react/display-name": 0, + "react/prop-types": 0, + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn", + "sort-imports": [ + "warn", + { + // Unfortunately there's no autofixer for this + ignoreDeclarationSort: true, + }, + ], + + // FIXME: Investigate / reenable these rules. Disabled to introduce eslint + // into codebase. + "no-async-promise-executor": 0, + "no-case-declarations": 0, + "no-console": 0, + "no-constant-condition": 0, + "no-empty-pattern": 0, + "no-extra-boolean-cast": 0, + "no-inner-declarations": 0, + "no-irregular-whitespace": 0, + "no-prototype-builtins": 0, + "no-undef": 0, + "no-unreachable": 0, + "no-useless-escape": 0, + "prefer-const": 0, + "prefer-rest-params": 0, + "react/jsx-key": 0, + "react/jsx-no-target-blank": 0, + "react/no-direct-mutation-state": 0, + "react/no-find-dom-node": 0, + "react/no-unescaped-entities": 0, + "@typescript-eslint/no-empty-function": 0, + "@typescript-eslint/no-empty-interface": 0, + "@typescript-eslint/no-non-null-assertion": 0, + + // "@typescript-eslint/no-unused-vars": [ + // "error", + // { + // argsIgnorePattern: "^_", + // }, + // ], + // "no-console": [ + // "error", + // { + // allow: ["warn", "error"], + // }, + // ], + + // TODO: Add support for Graphql, but first need to fetch .json schema + // "graphql/template-strings": [ + // "error", + // { + // env: "relay", + // schemaJsonFilepath: path.resolve(__dirname, "./data/schema.json"), + // tagName: "graphql", + // }, + // ], + }, +} diff --git a/package.json b/package.json index 8f14b7daee7..866716b50aa 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "force", "version": "1.0.0", "private": true, + "license": "MIT", "engines": { "node": "12", "yarn": "1.x.x" @@ -20,6 +21,7 @@ "cypress": "./node_modules/.bin/cypress open", "integrate": "./scripts/quicklink-to-project.sh", "jest": "JEST_JUNIT_OUTPUT=reports/junit/js-test-results.xml jest --runInBand", + "lint": "eslint --cache --cache-location '.cache/eslint/' --ext ts,tsx --ignore-pattern 'src/v2/__generated__'", "mocha": "scripts/mocha.sh", "prepare": "patch-package", "prettier-project": "yarn run prettier-write 'src/**/*.{ts,tsx,js,jsx}'", @@ -41,12 +43,6 @@ "unlink-all": "yalc remove --all && yarn --check-files", "webpack": "node --max_old_space_size=2048 -r dotenv/config -r @babel/register node_modules/.bin/webpack --config ./webpack" }, - "prettier": { - "bracketSpacing": true, - "semi": false, - "singleQuote": false, - "trailingComma": "es5" - }, "husky": { "hooks": { "pre-commit": "lint-staged", @@ -55,13 +51,33 @@ }, "lint-staged": { "*.@(js|jsx|ts|tsx)": [ - "npm run prettier-write --", - "git add" - ], - "{package.json,yarn.lock}": [ - "node ./scripts/check-for-links.js" + "yarn lint --fix", + "yarn prettier-write" ] }, + "reporterEnabled": "mocha-junit-reporter, spec", + "mochaJunitReporterReporterOptions": { + "mochaFile": "reports/mocha/test-results.xml" + }, + "nyc": { + "check-coverage": true, + "report-dir": "./.nyc_output/", + "reporter": [ + "lcov", + "text-summary" + ], + "extension": [ + ".coffee", + ".js" + ], + "lines": 0 + }, + "prettier": { + "bracketSpacing": true, + "semi": false, + "singleQuote": false, + "trailingComma": "es5" + }, "resolutions": { "@types/react": "16.9.34", "babel-core": "7.0.0-bridge.0", @@ -112,7 +128,6 @@ "artsy-ezel-components": "artsy/artsy-ezel-components", "artsy-morgan": "artsy/artsy-morgan", "artsy-xapp": "artsy/artsy-xapp", - "babel-eslint": "7.2.3", "babel-loader": "8.0.6", "babel-plugin-dynamic-import-node": "1.2.0", "babel-plugin-inline-react-svg": "0.2.0", @@ -304,7 +319,10 @@ "@types/underscore.string": "0.0.32", "@types/webpack": "4.4.24", "@types/webpack-env": "1.13.6", + "@typescript-eslint/eslint-plugin": "2.30.0", + "@typescript-eslint/parser": "2.30.0", "babel-core": "7.0.0-bridge.0", + "babel-eslint": "10.1.0", "babel-jest": "24.8.0", "babel-plugin-relay": "7.1.0", "benv": "3.3.0", @@ -316,15 +334,11 @@ "electron": "3.0.16", "enzyme": "3.10.0", "enzyme-adapter-react-16": "1.14.0", - "eslint": "5.6.1", - "eslint-config-prettier": "3.1.0", - "eslint-config-standard": "12.0.0", - "eslint-config-standard-react": "7.0.2", - "eslint-plugin-import": "2.14.0", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", - "eslint-plugin-react": "7.11.1", - "eslint-plugin-standard": "4.0.0", + "eslint": "6.8.0", + "eslint-config-prettier": "6.11.0", + "eslint-plugin-graphql": "3.1.1", + "eslint-plugin-react": "7.19.0", + "eslint-plugin-react-hooks": "3.0.0", "fork-ts-checker-notifier-webpack-plugin": "0.4.0", "fork-ts-checker-webpack-plugin": "0.4.10", "friendly-errors-webpack-plugin": "1.6.1", @@ -344,7 +358,7 @@ "jsdom-global": "3.0.2", "json-loader": "0.5.7", "konami-js": "0.0.2", - "lint-staged": "9.2.5", + "lint-staged": "10.0.8", "mime": "2.4.0", "mocha": "3.4.1", "mocha-junit-reporter": "1.22.0", @@ -372,10 +386,6 @@ "stylus-loader": "3.0.2", "supertest": "2.0.1", "terser-webpack-plugin": "2.3.5", - "tslint": "5.11.0", - "tslint-config-prettier": "1.15.0", - "tslint-config-standard": "8.0.1", - "tslint-react": "3.6.0", "typescript-styled-plugin": "0.15.0", "vscode-apollo-relay": "1.5.0", "wait-on": "3.3.0", @@ -387,28 +397,9 @@ "webpack-manifest-plugin": "2.0.4", "webpack-merge": "4.2.1", "webpack-notifier": "1.7.0", - "webpack-retry-chunk-load-plugin": "1.2.0", - "yalc": "1.0.0-pre.34" + "webpack-retry-chunk-load-plugin": "1.2.0" }, - "license": "MIT", "optionalDependencies": { "fsevents": "*" - }, - "reporterEnabled": "mocha-junit-reporter, spec", - "mochaJunitReporterReporterOptions": { - "mochaFile": "reports/mocha/test-results.xml" - }, - "nyc": { - "check-coverage": true, - "report-dir": "./.nyc_output/", - "reporter": [ - "lcov", - "text-summary" - ], - "extension": [ - ".coffee", - ".js" - ], - "lines": 0 } } diff --git a/scripts/check-for-links.js b/scripts/check-for-links.js deleted file mode 100644 index d5ffa38ab04..00000000000 --- a/scripts/check-for-links.js +++ /dev/null @@ -1,69 +0,0 @@ -const { exec } = require("child_process") -const { createReadStream } = require("fs") -const chalk = require("chalk") - -const fileHasText = (file, text) => - new Promise((resolve, reject) => { - const stream = createReadStream(file) - let hasText = false - - stream.on("data", data => { - if (!hasText) { - hasText = !!(data + "").match(text) - } else { - stream.close() - } - }) - - stream.on("error", err => { - reject(err) - }) - stream.on("close", () => { - resolve(hasText) - }) - }) - -exec( - "yarn yalc check", - { - cwd: process.cwd(), - env: process.env, - shell: true, - }, - async (err, stdout) => { - if (err) { - const file = process.argv[2] - - // If there's no links in the lock file, ignore - if ( - file.includes("yarn.lock") && - !(await fileHasText(file, "file:.yalc")) - ) { - return - } - - // If there's no links in the package.json, ignore - if ( - file.includes("package.json") && - !(await fileHasText(file, "file:.yalc")) - ) { - return - } - - console.log("") - console.log( - chalk.yellow( - `Linking detected, can't commit ${file} until everything is unlinked.\n` - ) - ) - console.log("Linked packages:") - console.log(stdout.split(":")[1].split("]")[0] + "]\n") - console.log( - `Run ${chalk.bold( - "yarn unlink-all" - )} to fix. (Will run a yarn install).` - ) - process.exit(1) - } - } -) diff --git a/scripts/quicklink-to-project.sh b/scripts/quicklink-to-project.sh deleted file mode 100755 index 173377ec3ac..00000000000 --- a/scripts/quicklink-to-project.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -if [ -z "$1" ] && [ -z "$PROJECT_PATH" ]; then - echo "Must supply a project name or set the PROJECT_PATH env" -fi - -PROJECT=${PROJECT_PATH:-../$1} - -if [ ! -d "$PROJECT" ]; then - echo "$(realpath $PROJECT) doesn't exist, ensure project name is correct or PROJECT_PATH is pointing to a valid directory" - exit 1 -fi - -cd $PROJECT - -# Does package have integrate command? -cat package.json | jq -e .scripts.integrate &>2 - -if [ $? -ne 0 ]; then - # TODO: Reference documentation on the integration process - echo "$PROJECT doesn't have an `integrate` script in its package.json" - exit 1 -fi - -yarn integrate force \ No newline at end of file diff --git a/scripts/quicklink.sh b/scripts/quicklink.sh deleted file mode 100755 index 09209e6108c..00000000000 --- a/scripts/quicklink.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# Add package as a "linked" package to force -echo "" -echo "Linking $1" -npx yalc add $1 - -# Try to install force's dependencies (retry if it fails) -echo "" -echo "Installing dependencies" -n=0 -until [ $n -ge 3 ] -do - yarn --check-files && break - - echo "Installing force dependencies failed, retrying... ($n/3)" - - n=$[$n+1] - sleep 1 -done - -echo "" -echo "Beginning service" -if [ -z "$ENABLE_DEBUGGER" ]; then - # Start force without debugger - TERM_PROGRAM=other yarn start -else - # Start force with debugger - yarn start -fi \ No newline at end of file diff --git a/src/desktop/apps/art_keeps_going/routes.tsx b/src/desktop/apps/art_keeps_going/routes.tsx index 640cbc77d93..babfda21980 100644 --- a/src/desktop/apps/art_keeps_going/routes.tsx +++ b/src/desktop/apps/art_keeps_going/routes.tsx @@ -5,7 +5,7 @@ import { routes } from "v2/Apps/FeatureAKG/routes" import JSONPage from "../../components/json_page" import React from "react" import { buildServerAppContext } from "desktop/lib/buildServerAppContext" -import { Request, Response, NextFunction } from "express" +import { NextFunction, Request, Response } from "express" export const landingPage = async ( req: Request, diff --git a/src/desktop/apps/article/__tests__/editorial_features.jest.ts b/src/desktop/apps/article/__tests__/editorial_features.jest.ts index b34b1b62afc..e00328484bb 100644 --- a/src/desktop/apps/article/__tests__/editorial_features.jest.ts +++ b/src/desktop/apps/article/__tests__/editorial_features.jest.ts @@ -1,8 +1,8 @@ import { - isCustomEditorial, getCustomEditorialId, - isVanguardSubArticle, getVanguardSubArticleContent, + isCustomEditorial, + isVanguardSubArticle, } from "../editorial_features" import { StandardArticle } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Articles" diff --git a/src/desktop/apps/article/__tests__/helpers.jest.tsx b/src/desktop/apps/article/__tests__/helpers.jest.tsx index be981742466..7a8393c546a 100644 --- a/src/desktop/apps/article/__tests__/helpers.jest.tsx +++ b/src/desktop/apps/article/__tests__/helpers.jest.tsx @@ -1,11 +1,11 @@ import { shouldAdRender } from "desktop/apps/article/helpers" import { - NewsArticle as NewsArticleFixture, FeatureArticle, - StandardArticle, - VideoArticle, + NewsArticle as NewsArticleFixture, SeriesArticle, + StandardArticle, SuperArticle, + VideoArticle, VideoArticleUnpublished, } from "reaction/Components/Publishing/Fixtures/Articles" import React from "react" @@ -15,11 +15,11 @@ import { mount } from "enzyme" import { ArticleLayout } from "desktop/apps/article/components/layouts/Article" import { SystemContextProvider } from "reaction/Artsy" import { - isUnpublishedVideo, getBodyClass, getJsonLd, getLayoutTemplate, getSuperArticleTemplates, + isUnpublishedVideo, } from "../helpers" describe("ad display logic in Feature and Standard Articles", () => { diff --git a/src/desktop/apps/article/components/EditButton.tsx b/src/desktop/apps/article/components/EditButton.tsx index 57b1429d8f2..364b43e1da2 100644 --- a/src/desktop/apps/article/components/EditButton.tsx +++ b/src/desktop/apps/article/components/EditButton.tsx @@ -2,7 +2,7 @@ import * as React from "react" import ChannelMemberQuery from "desktop/apps/article/queries/channelMember" import { positronql } from "desktop/lib/positronql" import { data as sd } from "sharify" -import { map, includes } from "lodash" +import { includes, map } from "lodash" import { Box, space } from "@artsy/palette" interface EditButtonProps { diff --git a/src/desktop/apps/article/components/InfiniteScrollNewsArticle.tsx b/src/desktop/apps/article/components/InfiniteScrollNewsArticle.tsx index 618e486c038..e9e5203f84b 100644 --- a/src/desktop/apps/article/components/InfiniteScrollNewsArticle.tsx +++ b/src/desktop/apps/article/components/InfiniteScrollNewsArticle.tsx @@ -17,7 +17,7 @@ import { NewsDateDivider } from "reaction/Components/Publishing/News/NewsDateDiv const Cookies = require("desktop/components/cookies/index.coffee") import { shouldAdRender } from "desktop/apps/article/helpers" import { handleScrollingAuthModal } from "desktop/lib/openAuthModal" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" export interface Props { article?: ArticleData diff --git a/src/desktop/apps/article/components/__tests__/InfiniteScrollArticle.jest.tsx b/src/desktop/apps/article/components/__tests__/InfiniteScrollArticle.jest.tsx index 8f77378d0d4..b157f48aae4 100644 --- a/src/desktop/apps/article/components/__tests__/InfiniteScrollArticle.jest.tsx +++ b/src/desktop/apps/article/components/__tests__/InfiniteScrollArticle.jest.tsx @@ -3,8 +3,8 @@ import { mount } from "enzyme" import { SystemContextProvider } from "@artsy/reaction/dist/Artsy" import { InfiniteScrollArticle } from "../InfiniteScrollArticle" import { - StandardArticle, ShortStandardArticle, + StandardArticle, } from "@artsy/reaction/dist/Components/Publishing/Fixtures/Articles" import { Article } from "@artsy/reaction/dist/Components/Publishing/Article" import { clone } from "lodash" diff --git a/src/desktop/apps/article/components/layouts/Article.tsx b/src/desktop/apps/article/components/layouts/Article.tsx index 65679271945..ec6fe05e035 100644 --- a/src/desktop/apps/article/components/layouts/Article.tsx +++ b/src/desktop/apps/article/components/layouts/Article.tsx @@ -4,10 +4,10 @@ import { AppProps } from "../App" import { InfiniteScrollArticle } from "../InfiniteScrollArticle" import { shouldAdRender } from "desktop/apps/article/helpers" import { - openAuthModal, handleScrollingAuthModal, + openAuthModal, } from "desktop/lib/openAuthModal" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" const SuperArticleView = require("desktop/components/article/client/super_article.coffee") const ArticleModel = require("desktop/models/article.coffee") const Cookies = require("desktop/components/cookies/index.coffee") diff --git a/src/desktop/apps/article/routes.tsx b/src/desktop/apps/article/routes.tsx index f16fae259ba..5c9094a03f1 100644 --- a/src/desktop/apps/article/routes.tsx +++ b/src/desktop/apps/article/routes.tsx @@ -4,32 +4,32 @@ import { URL, resolve } from "url" import { App } from "desktop/apps/article/components/App" import ArticleQuery from "desktop/apps/article/queries/article" import { - SuperSubArticlesQuery, SuperArticleQuery, + SuperSubArticlesQuery, } from "desktop/apps/article/queries/superArticle" import { positronql } from "desktop/lib/positronql" import { data as sd } from "sharify" import { stitch } from "@artsy/stitch" import { getCurrentUnixTimestamp } from "@artsy/reaction/dist/Components/Publishing/Constants" import { - isCustomEditorial, getCustomEditorialId, - isVanguardSubArticle, getVanguardSubArticleContent, + isCustomEditorial, + isVanguardSubArticle, } from "./editorial_features" import { slugify } from "underscore.string" import { - isUnpublishedVideo, getBodyClass, getJsonLd, getLayoutTemplate, getSuperArticleTemplates, + isUnpublishedVideo, } from "./helpers" import cheerio from "cheerio" import React from "react" import { - partnerQuery, auctionQuery, + partnerQuery, } from "desktop/apps/article/queries/promotedContent" import { ArticleMeta } from "@artsy/reaction/dist/Components/Publishing/ArticleMeta" import { GalleryInsightsRedirects } from "./gallery_insights_redirects" diff --git a/src/desktop/apps/articles/components/AuthWrapper.tsx b/src/desktop/apps/articles/components/AuthWrapper.tsx index 1bf6e885458..c46def4a774 100644 --- a/src/desktop/apps/articles/components/AuthWrapper.tsx +++ b/src/desktop/apps/articles/components/AuthWrapper.tsx @@ -2,7 +2,7 @@ import React from "react" import { data as sd } from "sharify" import qs from "querystring" import { handleScrollingAuthModal } from "desktop/lib/openAuthModal" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" const Cookies = require("desktop/components/cookies/index.coffee") const mediator = require("desktop/lib/mediator.coffee") diff --git a/src/desktop/apps/articles/routes.ts b/src/desktop/apps/articles/routes.ts index 201a9b8e05c..3ed4a6e0a26 100644 --- a/src/desktop/apps/articles/routes.ts +++ b/src/desktop/apps/articles/routes.ts @@ -5,7 +5,7 @@ import { newsPanelQuery, } from "./queries/news_articles_query" import { positronql as _positronql } from "desktop/lib/positronql" -import { map, sortBy, first, last, reject } from "lodash" +import { first, last, map, reject, sortBy } from "lodash" const { crop } = require("desktop/components/resizer/index.coffee") const { PARSELY_KEY, PARSELY_SECRET } = require("../../config.coffee") const _topParselyArticles = require("desktop/components/util/parsely.coffee") diff --git a/src/desktop/apps/artsy_in_miami/components/MiamiFairWeekPage.tsx b/src/desktop/apps/artsy_in_miami/components/MiamiFairWeekPage.tsx index ffe78e7b63d..17c197594f0 100644 --- a/src/desktop/apps/artsy_in_miami/components/MiamiFairWeekPage.tsx +++ b/src/desktop/apps/artsy_in_miami/components/MiamiFairWeekPage.tsx @@ -2,7 +2,7 @@ import React from "react" import styled, { ThemeProvider } from "styled-components" import colors from "v2/Assets/Colors" -import { Row, Col } from "@artsy/palette" +import { Col, Row } from "@artsy/palette" import Text from "v2/Components/Text" import Title from "v2/Components/Title" diff --git a/src/desktop/apps/auction_reaction/routes.jest.ts b/src/desktop/apps/auction_reaction/routes.jest.ts index faf168f8158..69cfb9a4190 100644 --- a/src/desktop/apps/auction_reaction/routes.jest.ts +++ b/src/desktop/apps/auction_reaction/routes.jest.ts @@ -1,4 +1,4 @@ -import { bidderRegistration, auctionFAQRoute } from "./routes" +import { auctionFAQRoute, bidderRegistration } from "./routes" import { stitch } from "@artsy/stitch" jest.mock("v2/Artsy/Router/server", () => { diff --git a/src/desktop/apps/auction_reaction/server.tsx b/src/desktop/apps/auction_reaction/server.tsx index fc2eea8098e..9132f00ee99 100644 --- a/src/desktop/apps/auction_reaction/server.tsx +++ b/src/desktop/apps/auction_reaction/server.tsx @@ -1,5 +1,5 @@ import express from "express" -import { bidderRegistration, auctionFAQRoute, confirmBidRoute } from "./routes" +import { auctionFAQRoute, bidderRegistration, confirmBidRoute } from "./routes" export const app = express() diff --git a/src/desktop/apps/authentication/__tests__/helpers.jest.ts b/src/desktop/apps/authentication/__tests__/helpers.jest.ts index d8ab3d10348..b7ee9361e4d 100644 --- a/src/desktop/apps/authentication/__tests__/helpers.jest.ts +++ b/src/desktop/apps/authentication/__tests__/helpers.jest.ts @@ -1,8 +1,8 @@ import { + apiAuthWithRedirectUrl, + getRedirect, handleSubmit, setCookies, - getRedirect, - apiAuthWithRedirectUrl, } from "../helpers" import Backbone from "backbone" import $ from "jquery" diff --git a/src/desktop/apps/authentication/__tests__/routes.jest.ts b/src/desktop/apps/authentication/__tests__/routes.jest.ts index 53f05cc9046..7e424ba4976 100644 --- a/src/desktop/apps/authentication/__tests__/routes.jest.ts +++ b/src/desktop/apps/authentication/__tests__/routes.jest.ts @@ -1,6 +1,6 @@ import { AuthStatic } from "../components/AuthStatic" import { MobileAuthStatic } from "../components/MobileAuthStatic" -import { index, resetPassword, redirectLoggedInHome } from "../routes" +import { index, redirectLoggedInHome, resetPassword } from "../routes" jest.mock("@artsy/stitch", () => ({ stitch: jest.fn(), diff --git a/src/desktop/apps/authentication/components/AuthStatic.tsx b/src/desktop/apps/authentication/components/AuthStatic.tsx index 3d711edd9a1..3a9ad897ee4 100644 --- a/src/desktop/apps/authentication/components/AuthStatic.tsx +++ b/src/desktop/apps/authentication/components/AuthStatic.tsx @@ -1,6 +1,6 @@ import React from "react" import { FormSwitcher } from "v2/Components/Authentication/FormSwitcher" -import { ModalType, ModalOptions } from "v2/Components/Authentication/Types" +import { ModalOptions, ModalType } from "v2/Components/Authentication/Types" import { ModalHeader } from "v2/Components/Modal/ModalHeader" import { handleSubmit } from "../helpers" import { Box, Flex } from "@artsy/palette" diff --git a/src/desktop/apps/authentication/components/MobileAuthStatic.tsx b/src/desktop/apps/authentication/components/MobileAuthStatic.tsx index 3deb142e60c..fc22bbd65a6 100644 --- a/src/desktop/apps/authentication/components/MobileAuthStatic.tsx +++ b/src/desktop/apps/authentication/components/MobileAuthStatic.tsx @@ -2,8 +2,8 @@ import React from "react" import styled from "styled-components" import { FormSwitcher } from "v2/Components/Authentication/FormSwitcher" import { handleSubmit } from "../helpers" -import { ModalType, ModalOptions } from "v2/Components/Authentication/Types" -import { Box, color, Flex } from "@artsy/palette" +import { ModalOptions, ModalType } from "v2/Components/Authentication/Types" +import { Box, Flex, color } from "@artsy/palette" interface Props { type: string diff --git a/src/desktop/apps/authentication/components/ModalContainer.tsx b/src/desktop/apps/authentication/components/ModalContainer.tsx index 2bdc41e41a0..166e450e428 100644 --- a/src/desktop/apps/authentication/components/ModalContainer.tsx +++ b/src/desktop/apps/authentication/components/ModalContainer.tsx @@ -3,8 +3,8 @@ import React from "react" import { data as sd } from "sharify" import { - createdAccount, AuthService, + createdAccount, successfullyLoggedIn, } from "@artsy/cohesion" import { handleSubmit, setCookies } from "../helpers" diff --git a/src/desktop/apps/authentication/helpers.ts b/src/desktop/apps/authentication/helpers.ts index adea70c3a1e..1035f60a76c 100644 --- a/src/desktop/apps/authentication/helpers.ts +++ b/src/desktop/apps/authentication/helpers.ts @@ -1,14 +1,14 @@ import Cookies from "cookies-js" -import { ModalType, ModalOptions } from "v2/Components/Authentication/Types" +import { ModalOptions, ModalType } from "v2/Components/Authentication/Types" import { data as sd } from "sharify" import * as qs from "query-string" import { Response } from "express" import { captureException } from "@sentry/browser" import { - createdAccount, AuthService, - successfullyLoggedIn, + createdAccount, resetYourPassword, + successfullyLoggedIn, } from "@artsy/cohesion" import { omit } from "lodash" diff --git a/src/desktop/apps/authentication/index.ts b/src/desktop/apps/authentication/index.ts index daf2e011c85..c1cfeecbe47 100644 --- a/src/desktop/apps/authentication/index.ts +++ b/src/desktop/apps/authentication/index.ts @@ -1,5 +1,5 @@ import express from "express" -import { index, resetPassword, redirectLoggedInHome } from "./routes" +import { index, redirectLoggedInHome, resetPassword } from "./routes" export const app = express() diff --git a/src/desktop/apps/consign/components/create_account/index.tsx b/src/desktop/apps/consign/components/create_account/index.tsx index e1408fc1dd1..f8fc397c542 100644 --- a/src/desktop/apps/consign/components/create_account/index.tsx +++ b/src/desktop/apps/consign/components/create_account/index.tsx @@ -6,7 +6,7 @@ import { handleSubmit } from "desktop/apps/authentication/helpers" import { ModalHeader } from "v2/Components/Modal/ModalHeader" import { updateAuthFormStateAndClearError } from "../../client/actions" import { ModalType } from "v2/Components/Authentication/Types" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" interface CreateAccountProps { contextPath: string diff --git a/src/desktop/apps/editorial_features/components/gucci/components/nav/header.tsx b/src/desktop/apps/editorial_features/components/gucci/components/nav/header.tsx index 7ccaacab840..9a0b932657d 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/nav/header.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/nav/header.tsx @@ -2,7 +2,7 @@ import styled from "styled-components" import React from "react" import Icon from "reaction/Components/Icon" import { PartnerInline } from "reaction/Components/Publishing/Partner/PartnerInline" -import { media, Flex, Sans, Serif } from "@artsy/palette" +import { Flex, Sans, Serif, media } from "@artsy/palette" import { Media } from "@artsy/reaction/dist/Utils/Responsive" interface HeaderProps { diff --git a/src/desktop/apps/editorial_features/components/gucci/components/nav/sections_nav.tsx b/src/desktop/apps/editorial_features/components/gucci/components/nav/sections_nav.tsx index 992bc221c7d..105a0868b9b 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/nav/sections_nav.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/nav/sections_nav.tsx @@ -1,6 +1,6 @@ -import styled, { keyframes, css } from "styled-components" +import styled, { css, keyframes } from "styled-components" import React from "react" -import { color, Flex, Sans } from "@artsy/palette" +import { Flex, Sans, color } from "@artsy/palette" interface SectionsNavProps { animated?: boolean diff --git a/src/desktop/apps/editorial_features/components/gucci/components/section/section_text.tsx b/src/desktop/apps/editorial_features/components/gucci/components/section/section_text.tsx index 0bd7409e834..7e2687c4d5b 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/section/section_text.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/section/section_text.tsx @@ -4,7 +4,7 @@ import styled from "styled-components" import { data as sd } from "sharify" import { Share } from "reaction/Components/Publishing/Byline/Share" import { Text } from "reaction/Components/Publishing" -import { Flex, Sans, space, media } from "@artsy/palette" +import { Flex, Sans, media, space } from "@artsy/palette" import { Media } from "@artsy/reaction/dist/Utils/Responsive" interface SectionTextProps { diff --git a/src/desktop/apps/editorial_features/components/gucci/components/section/section_video.tsx b/src/desktop/apps/editorial_features/components/gucci/components/section/section_video.tsx index fd4c3b1837b..d3cf0622cb7 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/section/section_video.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/section/section_video.tsx @@ -3,7 +3,7 @@ import React from "react" import styled from "styled-components" import { unica } from "reaction/Assets/Fonts" import { Video } from "reaction/Components/Publishing" -import { media, Box, Flex, Sans } from "@artsy/palette" +import { Box, Flex, Sans, media } from "@artsy/palette" interface SectionVideoProps { section: any @@ -98,10 +98,7 @@ const SectionVideoContainer = styled(Box)` `}; ` -const VideoPreview = - styled.div < - { backgroundSrc: string } > - ` +const VideoPreview = styled.div<{ backgroundSrc: string }>` height: 59vw; max-height: 668px; position: relative; diff --git a/src/desktop/apps/editorial_features/components/gucci/components/series/series_footer.tsx b/src/desktop/apps/editorial_features/components/gucci/components/series/series_footer.tsx index cb67b91fc97..e42d14fa65c 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/series/series_footer.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/series/series_footer.tsx @@ -1,6 +1,6 @@ import React from "react" -import { Text, PartnerBlock } from "reaction/Components/Publishing" -import { Flex, Box, Sans } from "@artsy/palette" +import { PartnerBlock, Text } from "reaction/Components/Publishing" +import { Box, Flex, Sans } from "@artsy/palette" import { Media } from "@artsy/reaction/dist/Utils/Responsive" interface SeriesFooterProps { diff --git a/src/desktop/apps/editorial_features/components/gucci/components/series/series_header.tsx b/src/desktop/apps/editorial_features/components/gucci/components/series/series_header.tsx index 16d8e94b348..fade5d40b93 100644 --- a/src/desktop/apps/editorial_features/components/gucci/components/series/series_header.tsx +++ b/src/desktop/apps/editorial_features/components/gucci/components/series/series_header.tsx @@ -1,4 +1,4 @@ -import { media, Box } from "@artsy/palette" +import { Box, media } from "@artsy/palette" import styled from "styled-components" import React from "react" import Waypoint from "react-waypoint" diff --git a/src/desktop/apps/feature-reaction/server.tsx b/src/desktop/apps/feature-reaction/server.tsx index 58776612b69..d4ffe9f1af0 100644 --- a/src/desktop/apps/feature-reaction/server.tsx +++ b/src/desktop/apps/feature-reaction/server.tsx @@ -3,7 +3,7 @@ import { stitch } from "@artsy/stitch" import { routes as featureRoutes } from "v2/Apps/Feature/routes" import React from "react" import { buildServerAppContext } from "desktop/lib/buildServerAppContext" -import express, { Request, Response, NextFunction } from "express" +import express, { NextFunction, Request, Response } from "express" export const app = express() diff --git a/src/desktop/components/artistSignupModal/__tests__/artistSignupModal.tsx b/src/desktop/components/artistSignupModal/__tests__/artistSignupModal.tsx index 82a57e7aefb..3ecbfa53204 100644 --- a/src/desktop/components/artistSignupModal/__tests__/artistSignupModal.tsx +++ b/src/desktop/components/artistSignupModal/__tests__/artistSignupModal.tsx @@ -1,4 +1,4 @@ -import { setupArtistSignUpModal, setCookie, query } from "../artistSignupModal" +import { query, setCookie, setupArtistSignUpModal } from "../artistSignupModal" import * as helpers from "desktop/lib/openAuthModal" jest.mock("desktop/components/cookies/index.coffee", () => ({ diff --git a/src/desktop/components/artistSignupModal/artistSignupModal.tsx b/src/desktop/components/artistSignupModal/artistSignupModal.tsx index dcdf10559f0..ed6c373bdce 100644 --- a/src/desktop/components/artistSignupModal/artistSignupModal.tsx +++ b/src/desktop/components/artistSignupModal/artistSignupModal.tsx @@ -1,7 +1,7 @@ import { get } from "lodash" import { data as sd } from "sharify" import { handleScrollingAuthModal } from "desktop/lib/openAuthModal" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" const Cookies = require("desktop/components/cookies/index.coffee") const mediator = require("desktop/lib/mediator.coffee") diff --git a/src/desktop/components/fair_week_marketing/PageScaffold.tsx b/src/desktop/components/fair_week_marketing/PageScaffold.tsx index a7ad850b71f..3532d37eadd 100644 --- a/src/desktop/components/fair_week_marketing/PageScaffold.tsx +++ b/src/desktop/components/fair_week_marketing/PageScaffold.tsx @@ -1,7 +1,7 @@ import React from "react" import styled, { ThemeProvider } from "styled-components" import colors from "v2/Assets/Colors" -import { Row, Col } from "@artsy/palette" +import { Col, Row } from "@artsy/palette" import Text from "v2/Components/Text" import Title from "v2/Components/Title" diff --git a/src/desktop/components/fair_week_marketing/__tests__/PageScaffold.jest.tsx b/src/desktop/components/fair_week_marketing/__tests__/PageScaffold.jest.tsx index e78eeb11e85..08ea0bb7187 100644 --- a/src/desktop/components/fair_week_marketing/__tests__/PageScaffold.jest.tsx +++ b/src/desktop/components/fair_week_marketing/__tests__/PageScaffold.jest.tsx @@ -1,5 +1,5 @@ import React from "react" -import { extend, cloneDeep } from "lodash" +import { cloneDeep, extend } from "lodash" import { mount } from "enzyme" import { FairWeekPageScaffold } from "../PageScaffold" diff --git a/src/desktop/components/marketing_signup_modal/triggerMarketingModal.ts b/src/desktop/components/marketing_signup_modal/triggerMarketingModal.ts index ce9838aabe6..3d629a44a0a 100644 --- a/src/desktop/components/marketing_signup_modal/triggerMarketingModal.ts +++ b/src/desktop/components/marketing_signup_modal/triggerMarketingModal.ts @@ -5,8 +5,8 @@ import { handleScrollingAuthModal, openAuthModal, } from "desktop/lib/openAuthModal" -import { ModalType, ModalOptions } from "v2/Components/Authentication/Types" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ModalOptions, ModalType } from "v2/Components/Authentication/Types" +import { ContextModule, Intent } from "@artsy/cohesion" export const triggerMarketingModal = ( intent: Intent, diff --git a/src/desktop/components/react/stitch_components/NavBar.tsx b/src/desktop/components/react/stitch_components/NavBar.tsx index d10193fae66..6cbac9097b9 100644 --- a/src/desktop/components/react/stitch_components/NavBar.tsx +++ b/src/desktop/components/react/stitch_components/NavBar.tsx @@ -4,7 +4,7 @@ import { NavBar as ReactionNavBar } from "v2/Components/NavBar" import { FlashBanner } from "v2/Components/FlashBanner" import { data as sd } from "sharify" -import { SystemContextProvider, SystemContextProps } from "v2/Artsy" +import { SystemContextProps, SystemContextProvider } from "v2/Artsy" import { StagingBanner } from "./StagingBanner" const mediator = require("desktop/lib/mediator.coffee") diff --git a/src/desktop/lib/__tests__/openAuthModal.jest.ts b/src/desktop/lib/__tests__/openAuthModal.jest.ts index 90ca1b6c662..fedd0a63c6d 100644 --- a/src/desktop/lib/__tests__/openAuthModal.jest.ts +++ b/src/desktop/lib/__tests__/openAuthModal.jest.ts @@ -1,6 +1,6 @@ -import { openAuthModal, handleScrollingAuthModal } from "../openAuthModal" +import { handleScrollingAuthModal, openAuthModal } from "../openAuthModal" import { ModalType } from "v2/Components/Authentication/Types" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" jest.mock("desktop/lib/mediator.coffee", () => ({ trigger: jest.fn(), diff --git a/src/desktop/lib/openAuthModal.ts b/src/desktop/lib/openAuthModal.ts index c81ea6719f4..f755392e88c 100644 --- a/src/desktop/lib/openAuthModal.ts +++ b/src/desktop/lib/openAuthModal.ts @@ -1,4 +1,4 @@ -import { ModalType, ModalOptions } from "v2/Components/Authentication/Types" +import { ModalOptions, ModalType } from "v2/Components/Authentication/Types" import { data as sd } from "sharify" const mediator = require("desktop/lib/mediator.coffee") diff --git a/src/lib/__tests__/volley.jest.ts b/src/lib/__tests__/volley.jest.ts index 999a47a66c7..3e3a571d0cf 100644 --- a/src/lib/__tests__/volley.jest.ts +++ b/src/lib/__tests__/volley.jest.ts @@ -12,7 +12,7 @@ jest.mock("sharify", () => ({ }, })) -import { reportLoadTimeToVolley, metricPayload } from "../volley" +import { metricPayload, reportLoadTimeToVolley } from "../volley" describe("metricsPayload", () => { it("should return null if the duration is null", () => { diff --git a/src/lib/middleware/__tests__/unsupportedBrowser.jest.ts b/src/lib/middleware/__tests__/unsupportedBrowser.jest.ts index db31d0a404c..324672068d3 100644 --- a/src/lib/middleware/__tests__/unsupportedBrowser.jest.ts +++ b/src/lib/middleware/__tests__/unsupportedBrowser.jest.ts @@ -1,6 +1,6 @@ import { - isUnsupported, getRedirectTo, + isUnsupported, unsupportedBrowserCheck, } from "../unsupportedBrowser" import useragent from "useragent" diff --git a/src/lib/middleware/pageCacheMiddleware.ts b/src/lib/middleware/pageCacheMiddleware.ts index 17bf952ed7d..b097327714f 100644 --- a/src/lib/middleware/pageCacheMiddleware.ts +++ b/src/lib/middleware/pageCacheMiddleware.ts @@ -2,17 +2,17 @@ import { // @ts-ignore PAGE_CACHE_ENABLED, // @ts-ignore - PAGE_CACHE_TYPES, + PAGE_CACHE_EXPIRY_SECONDS, // @ts-ignore PAGE_CACHE_NAMESPACE, // @ts-ignore - PAGE_CACHE_VERSION, + PAGE_CACHE_RETRIEVAL_TIMEOUT_MS, // @ts-ignore - PAGE_CACHE_EXPIRY_SECONDS, + PAGE_CACHE_TYPES, // @ts-ignore - PAGE_CACHE_RETRIEVAL_TIMEOUT_MS, + PAGE_CACHE_VERSION, } from "../../config" -import { Request, Response, NextFunction } from "express" +import { NextFunction, Request, Response } from "express" const cache = require("lib/cache.coffee") const runningTests = Object.keys( require("desktop/components/split_test/running_tests.coffee") diff --git a/src/lib/volley.ts b/src/lib/volley.ts index c9f1dfd086a..595f80b93f6 100644 --- a/src/lib/volley.ts +++ b/src/lib/volley.ts @@ -2,11 +2,11 @@ import { data as sd } from "sharify" import request from "superagent" import { getDomComplete, - getLoadEventEnd, - getFirstPaint, - getFirstContentfulPaint, getDomContentLoadedEnd, getDomContentLoadedStart, + getFirstContentfulPaint, + getFirstPaint, + getLoadEventEnd, getTTI, } from "./userPerformanceMetrics" @@ -45,16 +45,18 @@ export async function reportLoadTimeToVolley( metricsMap: MetricMap = defaultMetrics ) { if (sd.VOLLEY_ENDPOINT) { - const metrics = (await Promise.all( - Object.keys(metricsMap).map(async metricName => - metricPayload( - pageType, - deviceType, - metricName, - await metricsMap[metricName]() + const metrics = ( + await Promise.all( + Object.keys(metricsMap).map(async metricName => + metricPayload( + pageType, + deviceType, + metricName, + await metricsMap[metricName]() + ) ) ) - )).filter(metric => metric != null) + ).filter(metric => metric != null) if (metrics.length > 0) { return request.post(sd.VOLLEY_ENDPOINT).send({ serviceName: "force", diff --git a/src/v2/Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionEntity.tsx b/src/v2/Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionEntity.tsx index 52e123da519..60dbfd3b9f8 100644 --- a/src/v2/Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionEntity.tsx +++ b/src/v2/Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionEntity.tsx @@ -1,4 +1,4 @@ -import { Box, color, Flex, Image, Sans, Serif } from "@artsy/palette" +import { Box, Flex, Image, Sans, Serif, color } from "@artsy/palette" import { ArtistCollectionEntity_collection } from "v2/__generated__/ArtistCollectionEntity_collection.graphql" import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" @@ -64,7 +64,7 @@ export class ArtistCollectionEntity extends React.Component { const artistName = get(artworks[i].artist, a => a.name) const alt = `${artistName ? artistName + ", " : ""}${ artworks[i].title - }` + }` return ( @@ -80,13 +80,13 @@ export class ArtistCollectionEntity extends React.Component { ) }) ) : ( - - )} + + )} {formattedTitle} @@ -131,7 +131,7 @@ const SingleImgContainer = styled(Box)` } ` -const ImgOverlay = styled(Box) <{ width: number }>` +const ImgOverlay = styled(Box)<{ width: number }>` height: 125px; background-color: ${color("black30")}; opacity: 0.1; @@ -141,7 +141,7 @@ const ImgOverlay = styled(Box) <{ width: number }>` z-index: 7; ` -export const ArtworkImage = styled(Image) <{ width: number }>` +export const ArtworkImage = styled(Image)<{ width: number }>` width: ${({ width }) => width}px; height: 125px; background-color: ${color("black10")}; diff --git a/src/v2/Apps/Artist/Components/ArtistConsignButton.tsx b/src/v2/Apps/Artist/Components/ArtistConsignButton.tsx index 905d66944f9..a4ce130d716 100644 --- a/src/v2/Apps/Artist/Components/ArtistConsignButton.tsx +++ b/src/v2/Apps/Artist/Components/ArtistConsignButton.tsx @@ -9,10 +9,10 @@ import { BorderBox, Box, Button, - color, Flex, Image, Sans, + color, } from "@artsy/palette" import { AnalyticsSchema, useTracking } from "v2/Artsy" @@ -58,85 +58,85 @@ interface Tracking { export const ArtistConsignButtonLarge: React.FC = props => { - const { showImage, imageURL, headline, consignURL } = getData(props) - - return ( - { - props.trackGetStartedClick({ - destinationPath: consignURL, - }) - }} - > - - - - {showImage && ( - - )} - - - {headline} - - - - Consign with Artsy - - - - - - - - - - - ) - } + const { showImage, imageURL, headline, consignURL } = getData(props) -export const ArtistConsignButtonSmall: React.FC = props => { - const { showImage, imageURL, headline, consignURL } = getData(props) - - return ( - { - props.trackGetStartedClick({ - destinationPath: consignURL, - }) - }} - > - - - {showImage && } + return ( + { + props.trackGetStartedClick({ + destinationPath: consignURL, + }) + }} + > + + + + {showImage && ( + + )} {headline} - + Consign with Artsy - - - - + - - - ) - } + + + + + + + ) +} + +export const ArtistConsignButtonSmall: React.FC = props => { + const { showImage, imageURL, headline, consignURL } = getData(props) + + return ( + { + props.trackGetStartedClick({ + destinationPath: consignURL, + }) + }} + > + + + {showImage && } + + + {headline} + + + + Consign with Artsy + + + + + + + + + + ) +} function getData(props) { const { diff --git a/src/v2/Apps/Artist/Components/ArtistHeader.tsx b/src/v2/Apps/Artist/Components/ArtistHeader.tsx index cf962e1e140..0e1d09c2ada 100644 --- a/src/v2/Apps/Artist/Components/ArtistHeader.tsx +++ b/src/v2/Apps/Artist/Components/ArtistHeader.tsx @@ -1,10 +1,10 @@ -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Box, Button, Flex, Image, Sans, Serif, Spacer } from "@artsy/palette" import { ArtistHeader_artist } from "v2/__generated__/ArtistHeader_artist.graphql" import { StyledLink } from "v2/Apps/Artist/Components/StyledLink" import { HorizontalPadding } from "v2/Apps/Components/HorizontalPadding" import { Mediator, SystemContextConsumer } from "v2/Artsy" -import { track, Track } from "v2/Artsy/Analytics" +import { Track, track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" import { RouterLink } from "v2/Artsy/Router/RouterLink" import { Carousel } from "v2/Components/Carousel" diff --git a/src/v2/Apps/Artist/Components/ArtistIndicator.tsx b/src/v2/Apps/Artist/Components/ArtistIndicator.tsx index 5d0fa4a5f97..363d284b349 100644 --- a/src/v2/Apps/Artist/Components/ArtistIndicator.tsx +++ b/src/v2/Apps/Artist/Components/ArtistIndicator.tsx @@ -1,4 +1,4 @@ -import { color, Flex, Sans } from "@artsy/palette" +import { Flex, Sans, color } from "@artsy/palette" import React from "react" import { diff --git a/src/v2/Apps/Artist/Components/__stories__/ArtistConsignButton.story.tsx b/src/v2/Apps/Artist/Components/__stories__/ArtistConsignButton.story.tsx index f88ea6d6830..7b6812966bd 100644 --- a/src/v2/Apps/Artist/Components/__stories__/ArtistConsignButton.story.tsx +++ b/src/v2/Apps/Artist/Components/__stories__/ArtistConsignButton.story.tsx @@ -1,5 +1,5 @@ import React from "react" -import { graphql, QueryRenderer } from "react-relay" +import { QueryRenderer, graphql } from "react-relay" import { storiesOf } from "storybook/storiesOf" import { ArtistConsignButtonQuery } from "v2/__generated__/ArtistConsignButtonQuery.graphql" diff --git a/src/v2/Apps/Artist/Routes/Articles/ArtistArticles.tsx b/src/v2/Apps/Artist/Routes/Articles/ArtistArticles.tsx index 1e995627df1..a9b7434fd9c 100644 --- a/src/v2/Apps/Artist/Routes/Articles/ArtistArticles.tsx +++ b/src/v2/Apps/Artist/Routes/Articles/ArtistArticles.tsx @@ -2,7 +2,7 @@ import { Box, Col, Row } from "@artsy/palette" import { ArtistArticles_artist } from "v2/__generated__/ArtistArticles_artist.graphql" import { PaginationFragmentContainer as Pagination } from "v2/Components/Pagination" import React, { Component } from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import styled from "styled-components" import { ArticleItem } from "./ArtistArticle" @@ -24,7 +24,7 @@ interface ArtistArticlesProps { export class ArtistArticles extends Component< ArtistArticlesProps, LoadingAreaState - > { +> { state = { isLoading: false, } diff --git a/src/v2/Apps/Artist/Routes/AuctionResults/Components/AuctionFilters/YearCreated.tsx b/src/v2/Apps/Artist/Routes/AuctionResults/Components/AuctionFilters/YearCreated.tsx index 7b3e9da5211..20613444ced 100644 --- a/src/v2/Apps/Artist/Routes/AuctionResults/Components/AuctionFilters/YearCreated.tsx +++ b/src/v2/Apps/Artist/Routes/AuctionResults/Components/AuctionFilters/YearCreated.tsx @@ -42,7 +42,7 @@ export const YearCreated: React.FC = () => { filterContext.setFilter("createdAfterYear", earliestCreatedYear) filterContext.setFilter("createdBeforeYear", latestCreatedYear) }, - [earliestCreatedYear, latestCreatedYear] + [earliestCreatedYear, latestCreatedYear, filterContext] ) if ( diff --git a/src/v2/Apps/Artist/Routes/CV/CVItem.tsx b/src/v2/Apps/Artist/Routes/CV/CVItem.tsx index 78f00f28d87..3afd326461f 100644 --- a/src/v2/Apps/Artist/Routes/CV/CVItem.tsx +++ b/src/v2/Apps/Artist/Routes/CV/CVItem.tsx @@ -12,14 +12,14 @@ import { Sans, Separator, Serif, - space, Spacer, + space, } from "@artsy/palette" import { + RelayPaginationProp, createPaginationContainer, graphql, - RelayPaginationProp, } from "react-relay" import { ShowEntry } from "./ShowEntry" @@ -123,26 +123,26 @@ export class CVItem extends Component { {this.renderEntries(yearGroup, "2")} ) : ( - - {!sm && !md && ( - - {isFirst && ( - - {this.props.category} - - )} - - )} - - - {year} - - - - {this.renderEntries(yearGroup)} + + {!sm && !md && ( + + {isFirst && ( + + {this.props.category} + + )} - - ) + )} + + + {year} + + + + {this.renderEntries(yearGroup)} + + + ) })} {this.hasMore && ( diff --git a/src/v2/Apps/Artist/Routes/Consign/Components/ArtistConsignMarketTrends.tsx b/src/v2/Apps/Artist/Routes/Consign/Components/ArtistConsignMarketTrends.tsx index f2227db8f81..594868fdd51 100644 --- a/src/v2/Apps/Artist/Routes/Consign/Components/ArtistConsignMarketTrends.tsx +++ b/src/v2/Apps/Artist/Routes/Consign/Components/ArtistConsignMarketTrends.tsx @@ -1,4 +1,4 @@ -import { Box, Button, color, Flex, Sans, Serif } from "@artsy/palette" +import { Box, Button, Flex, Sans, Serif, color } from "@artsy/palette" import { AnalyticsSchema, useTracking } from "v2/Artsy" import { RouterLink } from "v2/Artsy/Router/RouterLink" import React from "react" diff --git a/src/v2/Apps/Artist/Routes/Consign/Components/SectionContainer.tsx b/src/v2/Apps/Artist/Routes/Consign/Components/SectionContainer.tsx index 8aa73107277..32e130c78ea 100644 --- a/src/v2/Apps/Artist/Routes/Consign/Components/SectionContainer.tsx +++ b/src/v2/Apps/Artist/Routes/Consign/Components/SectionContainer.tsx @@ -1,4 +1,4 @@ -import { Color, color, Flex, FlexProps } from "@artsy/palette" +import { Color, Flex, FlexProps, color } from "@artsy/palette" import React from "react" // Doesn't exist in design system diff --git a/src/v2/Apps/Artist/Routes/Overview/Components/ArtistArtworkFilter.tsx b/src/v2/Apps/Artist/Routes/Overview/Components/ArtistArtworkFilter.tsx index 161000c5342..3f9d0ea9c01 100644 --- a/src/v2/Apps/Artist/Routes/Overview/Components/ArtistArtworkFilter.tsx +++ b/src/v2/Apps/Artist/Routes/Overview/Components/ArtistArtworkFilter.tsx @@ -5,7 +5,7 @@ import { ArtworkFilterContextProvider } from "v2/Components/v2/ArtworkFilter/Art import { updateUrl } from "v2/Components/v2/ArtworkFilter/Utils/urlBuilder" import { Match, RouterState, withRouter } from "found" import React from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { ZeroState } from "./ZeroState" interface ArtistArtworkFilterProps { diff --git a/src/v2/Apps/Artist/Routes/Overview/Components/ArtistRecommendations.tsx b/src/v2/Apps/Artist/Routes/Overview/Components/ArtistRecommendations.tsx index f36704df705..a8df5ba2cdf 100644 --- a/src/v2/Apps/Artist/Routes/Overview/Components/ArtistRecommendations.tsx +++ b/src/v2/Apps/Artist/Routes/Overview/Components/ArtistRecommendations.tsx @@ -7,9 +7,9 @@ import { renderWithLoadProgress } from "v2/Artsy/Relay/renderWithLoadProgress" import { SystemQueryRenderer as QueryRenderer } from "v2/Artsy/Relay/SystemQueryRenderer" import React, { useContext, useState } from "react" import { + RelayPaginationProp, createPaginationContainer, graphql, - RelayPaginationProp, } from "react-relay" import { get } from "v2/Utils/get" import createLogger from "v2/Utils/logger" diff --git a/src/v2/Apps/Artist/Routes/Overview/Components/RecommendedArtist.tsx b/src/v2/Apps/Artist/Routes/Overview/Components/RecommendedArtist.tsx index f697a17a4f5..70738826cd2 100644 --- a/src/v2/Apps/Artist/Routes/Overview/Components/RecommendedArtist.tsx +++ b/src/v2/Apps/Artist/Routes/Overview/Components/RecommendedArtist.tsx @@ -1,4 +1,4 @@ -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Box, EntityHeader, Sans, Spacer } from "@artsy/palette" import { RecommendedArtist_artist } from "v2/__generated__/RecommendedArtist_artist.graphql" import { SystemContext } from "v2/Artsy" @@ -30,7 +30,7 @@ const handleOpenAuth = (mediator, artist) => { context_module: Schema.ContextModule.RecommendedArtists, }) class RecommendedArtistWithTracking extends React.Component< -RecommendedArtistProps + RecommendedArtistProps > { @track({ type: Schema.Type.Thumbnail, diff --git a/src/v2/Apps/Artist/Routes/Overview/Components/ZeroState.tsx b/src/v2/Apps/Artist/Routes/Overview/Components/ZeroState.tsx index 052f0232e66..32a31f32a2a 100644 --- a/src/v2/Apps/Artist/Routes/Overview/Components/ZeroState.tsx +++ b/src/v2/Apps/Artist/Routes/Overview/Components/ZeroState.tsx @@ -1,4 +1,4 @@ -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Link, Message } from "@artsy/palette" import { useSystemContext } from "v2/Artsy" import { FollowArtistButtonFragmentContainer as FollowArtistButton } from "v2/Components/FollowButton/FollowArtistButton" diff --git a/src/v2/Apps/Artist/Routes/Overview/index.tsx b/src/v2/Apps/Artist/Routes/Overview/index.tsx index d22f3c7cab3..2f6a1a92b23 100644 --- a/src/v2/Apps/Artist/Routes/Overview/index.tsx +++ b/src/v2/Apps/Artist/Routes/Overview/index.tsx @@ -28,7 +28,7 @@ import { StyledLink } from "v2/Apps/Artist/Components/StyledLink" import { WorksForSaleRailQueryRenderer as WorksForSaleRail } from "v2/Apps/Artist/Routes/Overview/Components/WorksForSaleRail" import { pMedia } from "v2/Components/Helpers" import React from "react" -import { createFragmentContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createFragmentContainer, graphql } from "react-relay" import { Track, TrackingProp } from "react-tracking" import styled from "styled-components" import { get } from "v2/Utils/get" diff --git a/src/v2/Apps/Artist/Routes/Shows/ArtistShows.tsx b/src/v2/Apps/Artist/Routes/Shows/ArtistShows.tsx index 0d6a159fa86..c0c77e20dc0 100644 --- a/src/v2/Apps/Artist/Routes/Shows/ArtistShows.tsx +++ b/src/v2/Apps/Artist/Routes/Shows/ArtistShows.tsx @@ -2,7 +2,7 @@ import { Box, Col, Flex, Row, Sans, Spacer } from "@artsy/palette" import { ArtistShows_artist } from "v2/__generated__/ArtistShows_artist.graphql" import { PaginationFragmentContainer as Pagination } from "v2/Components/Pagination" import React, { Component } from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" import { Media } from "v2/Utils/Responsive" import { ArtistShowBlockItem } from "./ArtistShowBlockItem" @@ -126,29 +126,29 @@ class ArtistShows extends Component { )} ) : ( - - {this.props.artist.showsConnection.edges.map( - ({ node }, index) => { - return ( - - + + {this.props.artist.showsConnection.edges.map( + ({ node }, index) => { + return ( + + - - - - - ) - } - )} - - )} + + + + + ) + } + )} + + )} diff --git a/src/v2/Apps/Artist/routes.tsx b/src/v2/Apps/Artist/routes.tsx index 8f4639272e1..e980d439671 100644 --- a/src/v2/Apps/Artist/routes.tsx +++ b/src/v2/Apps/Artist/routes.tsx @@ -135,7 +135,6 @@ export const routes: RouteConfig[] = [ OverviewRoute.preload() }, displayNavigationTabs: true, - ignoreScrollBehavior: true, query: graphql` query routes_OverviewQuery($artistID: String!) @raw_response_type { artist(id: $artistID) { diff --git a/src/v2/Apps/Artwork/Components/ArtworkDetails/ArtworkDetailsAboutTheWorkFromPartner.tsx b/src/v2/Apps/Artwork/Components/ArtworkDetails/ArtworkDetailsAboutTheWorkFromPartner.tsx index a890bd199e7..a5fe47a1431 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkDetails/ArtworkDetailsAboutTheWorkFromPartner.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkDetails/ArtworkDetailsAboutTheWorkFromPartner.tsx @@ -15,7 +15,7 @@ import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" import Events from "v2/Utils/Events" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Box, EntityHeader, @@ -41,7 +41,7 @@ export interface ArtworkDetailsAboutTheWorkFromPartnerProps { } ) export class ArtworkDetailsAboutTheWorkFromPartner extends React.Component< -ArtworkDetailsAboutTheWorkFromPartnerProps + ArtworkDetailsAboutTheWorkFromPartnerProps > { @track({ action_type: Schema.ActionType.Click, diff --git a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkActions.tsx b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkActions.tsx index 8d99a171e60..a4370823bc7 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkActions.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkActions.tsx @@ -17,7 +17,6 @@ import { ContextModule } from "@artsy/cohesion" import { BellFillIcon, BellIcon, - color, DownloadIcon, EditIcon, Flex, @@ -31,6 +30,7 @@ import { Sans, ShareIcon, Spacer, + color, } from "@artsy/palette" import { userIsAdmin } from "v2/Utils/user" import { ArtworkPopoutPanel } from "./ArtworkPopoutPanel" @@ -49,8 +49,8 @@ interface ArtworkActionsState { @track() export class ArtworkActions extends React.Component< -ArtworkActionsProps, -ArtworkActionsState + ArtworkActionsProps, + ArtworkActionsState > { state = { showSharePanel: false, @@ -311,14 +311,14 @@ export const ArtworkActionsFragmentContainer = createFragmentContainer( interface UtilButtonProps { name: - | "bell" - | "edit" - | "download" - | "genome" - | "heart" - | "more" - | "share" - | "viewInRoom" + | "bell" + | "edit" + | "download" + | "genome" + | "heart" + | "more" + | "share" + | "viewInRoom" href?: string onClick?: () => void selected?: boolean @@ -329,7 +329,7 @@ interface UtilButtonProps { export class UtilButton extends React.Component< UtilButtonProps, { hovered: boolean } - > { +> { state = { hovered: false, } @@ -391,15 +391,15 @@ export class UtilButton extends React.Component< )} ) : ( - <> - - {label && ( - - {label} - - )} - - )} + <> + + {label && ( + + {label} + + )} + + )} ) } diff --git a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkImageBrowser.tsx b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkImageBrowser.tsx index 9be238ae6bb..6ad7a48c2c4 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkImageBrowser.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkImageBrowser.tsx @@ -6,7 +6,7 @@ import React from "react" import styled from "styled-components" import { Media } from "v2/Utils/Responsive" -import { Box, ChevronIcon, Col, color, Flex, space } from "@artsy/palette" +import { Box, ChevronIcon, Col, Flex, color, space } from "@artsy/palette" interface ArtworkBrowserProps { imageAlt: string @@ -31,7 +31,7 @@ export const ArtworkImageBrowser = (props: ArtworkBrowserProps) => { export class LargeArtworkImageBrowser extends React.Component< ArtworkBrowserProps - > { +> { render() { const hasMultipleImages = this.props.images.length > 1 const { imageAlt, images, setCarouselRef } = this.props @@ -116,7 +116,7 @@ export class LargeArtworkImageBrowser extends React.Component< export class SmallArtworkImageBrowser extends React.Component< ArtworkBrowserProps - > { +> { render() { const { images, imageAlt, setCarouselRef } = this.props // FIXME: During SSR pass want to hide other images. Work around for lack diff --git a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkPopoutPanel.tsx b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkPopoutPanel.tsx index 9c3d58142be..a2ec9f47798 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkPopoutPanel.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkPopoutPanel.tsx @@ -1,4 +1,4 @@ -import { Box, color, Flex, Sans, space } from "@artsy/palette" +import { Box, Flex, Sans, color, space } from "@artsy/palette" import Icon from "v2/Components/Icon" import React from "react" import styled from "styled-components" @@ -10,7 +10,7 @@ interface ArtworkPopoutPanelProps { export class ArtworkPopoutPanel extends React.Component< ArtworkPopoutPanelProps - > { +> { render() { return ( diff --git a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkSharePanel.tsx b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkSharePanel.tsx index c43dedf8053..1d0c4965ac0 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkSharePanel.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkImageBrowser/ArtworkSharePanel.tsx @@ -1,4 +1,4 @@ -import { color, Flex, media, Sans, Separator } from "@artsy/palette" +import { Flex, Sans, Separator, color, media } from "@artsy/palette" import { ArtworkSharePanel_artwork } from "v2/__generated__/ArtworkSharePanel_artwork.graphql" import Icon from "v2/Components/Icon" import React from "react" @@ -30,7 +30,7 @@ const COPY_LABELS = { export class ArtworkSharePanel extends React.Component< ArtworkSharePanelProps, ArtworkSharePanelState - > { +> { private input: HTMLInputElement state = { diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarArtists.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarArtists.tsx index 662e8f0646c..0c39d1c1f51 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarArtists.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarArtists.tsx @@ -6,7 +6,7 @@ import { FollowIcon } from "v2/Components/FollowIcon" import React from "react" import { createFragmentContainer, graphql } from "react-relay" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { ArtworkSidebarArtists_artwork } from "v2/__generated__/ArtworkSidebarArtists_artwork.graphql" import { FollowArtistButtonFragmentContainer as FollowArtistButton } from "v2/Components/FollowButton/FollowArtistButton" import { openAuthToFollowSave } from "v2/Utils/openAuthModal" @@ -24,10 +24,10 @@ export class ArtworkSidebarArtists extends React.Component { {artist.name} ) : ( - - {artist.name} - - ) + + {artist.name} + + ) } handleOpenAuth = (mediator, artist) => { diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx index 6a82029af3b..9a31ac536e6 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx @@ -1,4 +1,4 @@ -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Box, Button, @@ -23,10 +23,10 @@ import currency from "currency.js" import { Router } from "found" import React, { FC, useContext } from "react" import { + RelayProp, commitMutation, createFragmentContainer, graphql, - RelayProp, } from "react-relay" import { ErrorWithMetadata } from "v2/Utils/errors" import { get } from "v2/Utils/get" diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarBidAction.jest.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarBidAction.jest.tsx index 6f5327eebe4..5e77b50ce26 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarBidAction.jest.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarBidAction.jest.tsx @@ -8,9 +8,9 @@ import { ArtworkFromTimedAuctionRegistrationOpen, BidderPendingApproval, IDVedUser, + NoUser, NotIDVedUser, NotRegisteredToBid, - NoUser, RegistedBidderWithBids, RegisteredBidder, SaleRequiringIDV, diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx index 33383a251b8..dc4b15284a6 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx @@ -17,7 +17,7 @@ import { import { Button } from "@artsy/palette" import { mount } from "enzyme" import React from "react" -import { commitMutation as _commitMutation, RelayProp } from "react-relay" +import { RelayProp, commitMutation as _commitMutation } from "react-relay" import { ArtworkSidebarCommercialContainer } from "v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial" import { ErrorModal } from "v2/Components/Modal/ErrorModal" diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/index.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/index.tsx index b7d8cccb3a6..41d8a910303 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/index.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/index.tsx @@ -1,4 +1,4 @@ -import { Box, space, Spacer } from "@artsy/palette" +import { Box, Spacer, space } from "@artsy/palette" import { renderWithLoadProgress } from "v2/Artsy/Relay/renderWithLoadProgress" import { AuctionTimerFragmentContainer as AuctionTimer } from "v2/Components/AuctionTimer" import React, { Component, useContext } from "react" @@ -64,12 +64,12 @@ export class ArtworkSidebar extends Component { )} ) : ( - - - - - - )} + + + + + + )} diff --git a/src/v2/Apps/Artwork/Components/OtherWorks/RelatedWorksArtworkGrid.tsx b/src/v2/Apps/Artwork/Components/OtherWorks/RelatedWorksArtworkGrid.tsx index 5de42a343f0..29e659d5d71 100644 --- a/src/v2/Apps/Artwork/Components/OtherWorks/RelatedWorksArtworkGrid.tsx +++ b/src/v2/Apps/Artwork/Components/OtherWorks/RelatedWorksArtworkGrid.tsx @@ -15,7 +15,7 @@ import createLogger from "v2/Utils/logger" import { ContextModule } from "@artsy/cohesion" import { SystemQueryRenderer as QueryRenderer } from "v2/Artsy/Relay/SystemQueryRenderer" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" const logger = createLogger("RelatedWorksArtworkGrid.tsx") @@ -36,8 +36,8 @@ interface RelatedWorksArtworkGridState { context_module: Schema.ContextModule.RelatedWorks, }) class RelatedWorksArtworkGrid extends React.Component< -RelatedWorksArtworkGridProps, -RelatedWorksArtworkGridState + RelatedWorksArtworkGridProps, + RelatedWorksArtworkGridState > { state = { isLoading: false, @@ -106,15 +106,15 @@ RelatedWorksArtworkGridState {this.state.isLoading ? ( ) : ( - - )} + + )} ) diff --git a/src/v2/Apps/Artwork/Components/PricingContext.tsx b/src/v2/Apps/Artwork/Components/PricingContext.tsx index a5902a2f29b..d6f3db27b70 100644 --- a/src/v2/Apps/Artwork/Components/PricingContext.tsx +++ b/src/v2/Apps/Artwork/Components/PricingContext.tsx @@ -15,7 +15,7 @@ import React from "react" import { createFragmentContainer, graphql } from "react-relay" import Waypoint from "react-waypoint" import Events from "v2/Utils/Events" -import { createCollectUrl, FilterCategory } from "./../Utils/createCollectUrl" +import { FilterCategory, createCollectUrl } from "./../Utils/createCollectUrl" import { PricingContextModal } from "./PricingContextModal" interface PricingContextProps { @@ -82,8 +82,8 @@ export class PricingContext extends React.Component { artwork.listPrice.__typename === "PriceRange" ? artwork.listPrice.maxPrice.minor || artwork.listPrice.minPrice.minor : artwork.listPrice.__typename === "Money" - ? artwork.listPrice.minor - : 0 + ? artwork.listPrice.minor + : 0 const artworkFallsBeforeFirstBin = priceCents < artwork.pricingContext.bins[0].minPriceCents @@ -127,7 +127,7 @@ export class PricingContext extends React.Component { const title = isLastBin ? `${bin.minPrice}+` : // TODO: use artwork's currency - `${isFirstBin ? "$0" : bin.minPrice}–${bin.maxPrice}` + `${isFirstBin ? "$0" : bin.minPrice}–${bin.maxPrice}` const artworkFallsInThisBin = (isFirstBin && artworkFallsBeforeFirstBin) || (isLastBin && artworkFallsAfterLastBin) || @@ -148,9 +148,9 @@ export class PricingContext extends React.Component { onHover: this.barchartHover.bind(this), highlightLabel: artworkFallsInThisBin ? { - title, - description: "This work", - } + title, + description: "This work", + } : undefined, } } diff --git a/src/v2/Apps/Artwork/Components/__tests__/ArtistInfo.jest.tsx b/src/v2/Apps/Artwork/Components/__tests__/ArtistInfo.jest.tsx index 2e8cf4242e5..4cd9a8dde49 100644 --- a/src/v2/Apps/Artwork/Components/__tests__/ArtistInfo.jest.tsx +++ b/src/v2/Apps/Artwork/Components/__tests__/ArtistInfo.jest.tsx @@ -4,7 +4,7 @@ import { mockTracking } from "v2/Artsy/Analytics" import { FollowArtistButtonFragmentContainer as FollowArtistButton } from "v2/Components/FollowButton/FollowArtistButton" import { mount } from "enzyme" import React from "react" -import { graphql, RelayProp } from "react-relay" +import { RelayProp, graphql } from "react-relay" import { ArtistInfo } from "../ArtistInfo" jest.unmock("react-tracking") diff --git a/src/v2/Apps/Auction/Components/AuctionFAQ.tsx b/src/v2/Apps/Auction/Components/AuctionFAQ.tsx index 7e800bb7c4e..2e1fd6d69aa 100644 --- a/src/v2/Apps/Auction/Components/AuctionFAQ.tsx +++ b/src/v2/Apps/Auction/Components/AuctionFAQ.tsx @@ -1,4 +1,4 @@ -import { Box, media, Serif, space, Spacer, Theme, Toggle } from "@artsy/palette" +import { Box, Serif, Spacer, Theme, Toggle, media, space } from "@artsy/palette" import { AuctionFAQ_viewer } from "v2/__generated__/AuctionFAQ_viewer.graphql" import React from "react" import Markdown from "react-markdown" diff --git a/src/v2/Apps/Auction/Components/BidForm.tsx b/src/v2/Apps/Auction/Components/BidForm.tsx index dd6f8e03840..47fdf65688a 100644 --- a/src/v2/Apps/Auction/Components/BidForm.tsx +++ b/src/v2/Apps/Auction/Components/BidForm.tsx @@ -15,7 +15,7 @@ import { } from "formik" import { dropWhile, find } from "lodash" import React from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import { data as sd } from "sharify" import Yup from "yup" @@ -46,7 +46,7 @@ export interface FormValues { selectedBid: string } -Yup.addMethod(Yup.string, "present", function (message) { +Yup.addMethod(Yup.string, "present", function(message) { return this.test("test-present", message, value => { return this.trim() .required(message) diff --git a/src/v2/Apps/Auction/Components/LotInfo.tsx b/src/v2/Apps/Auction/Components/LotInfo.tsx index 1d4b09d982f..6f295999c90 100644 --- a/src/v2/Apps/Auction/Components/LotInfo.tsx +++ b/src/v2/Apps/Auction/Components/LotInfo.tsx @@ -2,7 +2,7 @@ import { Box, Flex, ResponsiveImage, Sans, Serif } from "@artsy/palette" import { LotInfo_artwork } from "v2/__generated__/LotInfo_artwork.graphql" import { LotInfo_saleArtwork } from "v2/__generated__/LotInfo_saleArtwork.graphql" import React from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" interface Props { artwork: LotInfo_artwork diff --git a/src/v2/Apps/Auction/Components/RegistrationForm.tsx b/src/v2/Apps/Auction/Components/RegistrationForm.tsx index b59e0097a45..a288dac9303 100644 --- a/src/v2/Apps/Auction/Components/RegistrationForm.tsx +++ b/src/v2/Apps/Auction/Components/RegistrationForm.tsx @@ -13,9 +13,9 @@ import { import React, { useEffect, useState } from "react" import { Elements, - injectStripe, ReactStripeElements, StripeProvider, + injectStripe, } from "react-stripe-elements" import { data as sd } from "sharify" import * as Yup from "yup" @@ -117,7 +117,7 @@ const InnerForm: React.FC = props => { ) } -Yup.addMethod(Yup.string, "present", function (message) { +Yup.addMethod(Yup.string, "present", function(message) { return this.test("test-present", message, value => { return this.trim() .required(message) diff --git a/src/v2/Apps/Auction/Routes/ConfirmBid/index.tsx b/src/v2/Apps/Auction/Routes/ConfirmBid/index.tsx index fdbf3b4c7d4..1cd6536aa21 100644 --- a/src/v2/Apps/Auction/Routes/ConfirmBid/index.tsx +++ b/src/v2/Apps/Auction/Routes/ConfirmBid/index.tsx @@ -10,8 +10,8 @@ import { import { routes_ConfirmBidQueryResponse } from "v2/__generated__/routes_ConfirmBidQuery.graphql" import { BidFormFragmentContainer as BidForm, - determineDisplayRequirements, FormValues, + determineDisplayRequirements, } from "v2/Apps/Auction/Components/BidForm" import { LotInfoFragmentContainer as LotInfo } from "v2/Apps/Auction/Components/LotInfo" import { bidderPositionQuery } from "v2/Apps/Auction/Routes/ConfirmBid/BidderPositionQuery" @@ -25,16 +25,16 @@ import { isEmpty } from "lodash" import React, { useEffect, useState } from "react" import { Title } from "react-head" import { + RelayProp, commitMutation, createFragmentContainer, graphql, - RelayProp, } from "react-relay" import { Elements, - injectStripe, ReactStripeElements, StripeProvider, + injectStripe, } from "react-stripe-elements" import { data as sd } from "sharify" import { get } from "v2/Utils/get" diff --git a/src/v2/Apps/Auction/Routes/Register/index.tsx b/src/v2/Apps/Auction/Routes/Register/index.tsx index 55d6228d7ff..f581644fdef 100644 --- a/src/v2/Apps/Auction/Routes/Register/index.tsx +++ b/src/v2/Apps/Auction/Routes/Register/index.tsx @@ -17,10 +17,10 @@ import { FormikHelpers as FormikActions } from "formik" import React from "react" import { Title } from "react-head" import { + RelayProp, commitMutation, createFragmentContainer, graphql, - RelayProp, } from "react-relay" import { TrackingProp } from "react-tracking" import { data as sd } from "sharify" diff --git a/src/v2/Apps/Auction/Routes/__tests__/Register.jest.tsx b/src/v2/Apps/Auction/Routes/__tests__/Register.jest.tsx index c4002d346b8..de815ae9349 100644 --- a/src/v2/Apps/Auction/Routes/__tests__/Register.jest.tsx +++ b/src/v2/Apps/Auction/Routes/__tests__/Register.jest.tsx @@ -10,8 +10,8 @@ import { expectOne } from "v2/DevTools/RootTestPage" import { routes_RegisterQueryRawResponse } from "v2/__generated__/routes_RegisterQuery.graphql" import { RegisterQueryResponseFixture, - RegisterQueryResponseFixtureWithoutVerificationNeeded, RegisterQueryResponseFixtureWithVerifiedUser, + RegisterQueryResponseFixtureWithoutVerificationNeeded, } from "../../__fixtures__/routes_RegisterQuery" import { createBidderSuccessful } from "../__fixtures__/MutationResults/createBidder" import { diff --git a/src/v2/Apps/Auction/Routes/__tests__/Utils/ConfirmBidTestPage.tsx b/src/v2/Apps/Auction/Routes/__tests__/Utils/ConfirmBidTestPage.tsx index 3cd14844678..2296f3e45f8 100644 --- a/src/v2/Apps/Auction/Routes/__tests__/Utils/ConfirmBidTestPage.tsx +++ b/src/v2/Apps/Auction/Routes/__tests__/Utils/ConfirmBidTestPage.tsx @@ -2,7 +2,7 @@ import { Checkbox, LargeSelect } from "@artsy/palette" import { ValidFormValues } from "v2/Apps/Auction/Routes/__tests__/Utils/RegisterTestPage" import { Address, AddressForm } from "v2/Components/AddressForm" -import { expectOne, RootTestPage } from "v2/DevTools/RootTestPage" +import { RootTestPage, expectOne } from "v2/DevTools/RootTestPage" export class ConfirmBidTestPage extends RootTestPage { get confirmBidButton() { diff --git a/src/v2/Apps/Auction/Routes/__tests__/Utils/RegisterTestPage.tsx b/src/v2/Apps/Auction/Routes/__tests__/Utils/RegisterTestPage.tsx index 8af69ea9f40..494bc182c77 100644 --- a/src/v2/Apps/Auction/Routes/__tests__/Utils/RegisterTestPage.tsx +++ b/src/v2/Apps/Auction/Routes/__tests__/Utils/RegisterTestPage.tsx @@ -1,6 +1,6 @@ import { Checkbox } from "@artsy/palette" import { Address, AddressForm } from "v2/Components/AddressForm" -import { expectOne, RootTestPage } from "v2/DevTools/RootTestPage" +import { RootTestPage, expectOne } from "v2/DevTools/RootTestPage" export const ValidFormValues = { name: "Example Name", diff --git a/src/v2/Apps/Auction/routes.tsx b/src/v2/Apps/Auction/routes.tsx index f4cef748b78..dc70db32978 100644 --- a/src/v2/Apps/Auction/routes.tsx +++ b/src/v2/Apps/Auction/routes.tsx @@ -4,7 +4,7 @@ import { RedirectException, RouteConfig } from "found" import React from "react" import { graphql } from "react-relay" import createLogger from "v2/Utils/logger" -import { confirmBidRedirect, Redirect, registerRedirect } from "./getRedirect" +import { Redirect, confirmBidRedirect, registerRedirect } from "./getRedirect" const logger = createLogger("Apps/Auction/routes") diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/ArtistSeriesEntity.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/ArtistSeriesEntity.tsx index 5a6ab731840..98448e7c973 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/ArtistSeriesEntity.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/ArtistSeriesEntity.tsx @@ -1,4 +1,4 @@ -import { Box, color, Flex, Sans, Serif } from "@artsy/palette" +import { Box, Flex, Sans, Serif, color } from "@artsy/palette" import { ArtistSeriesEntity_member } from "v2/__generated__/ArtistSeriesEntity_member.graphql" import { AnalyticsSchema } from "v2/Artsy/Analytics" import { useTracking } from "v2/Artsy/Analytics/useTracking" @@ -52,25 +52,25 @@ export const ArtistSeriesEntity: React.FC = ({ {bgImages!.length ? bgImages.map((url, i) => { - const hit = artworks![i] - const artistName = get(hit!.artist, a => a!.name) - const alt = `${artistName ? artistName + ", " : ""}${ - hit!.title + const hit = artworks![i] + const artistName = get(hit!.artist, a => a!.name) + const alt = `${artistName ? artistName + ", " : ""}${ + hit!.title }` - return ( - - - {url && ( - - )} - - ) - }) + return ( + + + {url && ( + + )} + + ) + }) : headerImage && } { @@ -101,7 +101,7 @@ export const ArtworkImage = styled.img<{ width: number }>` opacity: 0.9; ` -const ImgOverlay = styled(Box) <{ width: number }>` +const ImgOverlay = styled(Box)<{ width: number }>` height: 125px; background-color: ${color("black30")}; opacity: 0.1; diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/index.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/index.tsx index bfd8b971250..f51551ce791 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/index.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/ArtistSeriesRail/index.tsx @@ -1,4 +1,4 @@ -import { Box, color, Serif } from "@artsy/palette" +import { Box, Serif, color } from "@artsy/palette" import { ArtistSeriesRail_collectionGroup } from "v2/__generated__/ArtistSeriesRail_collectionGroup.graphql" import { AnalyticsSchema } from "v2/Artsy/Analytics" import { useTracking } from "v2/Artsy/Analytics/useTracking" diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/FeaturedCollectionsRails/index.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/FeaturedCollectionsRails/index.tsx index bcd0075ee13..b668323dc77 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/FeaturedCollectionsRails/index.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/FeaturedCollectionsRails/index.tsx @@ -1,11 +1,11 @@ import { Box, - color, Flex, ResponsiveImage, Sans, Serif, Spacer, + color, } from "@artsy/palette" import { FeaturedCollectionsRails_collectionGroup } from "v2/__generated__/FeaturedCollectionsRails_collectionGroup.graphql" import * as Schema from "v2/Artsy/Analytics/Schema" diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/OtherCollectionEntity.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/OtherCollectionEntity.tsx index c3ab2f4676d..c49746342b1 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/OtherCollectionEntity.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/OtherCollectionEntity.tsx @@ -1,4 +1,4 @@ -import { Box, color, Flex, ResponsiveImage, Serif } from "@artsy/palette" +import { Box, Flex, ResponsiveImage, Serif, color } from "@artsy/palette" import { OtherCollectionEntity_member } from "v2/__generated__/OtherCollectionEntity_member.graphql" import * as Schema from "v2/Artsy/Analytics/Schema" import { useTracking } from "v2/Artsy/Analytics/useTracking" diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/index.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/index.tsx index 8e1f7d2defa..698e74ec37d 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/index.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/CollectionsHubRails/OtherCollectionsRail/index.tsx @@ -1,4 +1,4 @@ -import { Box, color, Serif } from "@artsy/palette" +import { Box, Serif, color } from "@artsy/palette" import { OtherCollectionsRail_collectionGroup } from "v2/__generated__/OtherCollectionsRail_collectionGroup.graphql" import * as Schema from "v2/Artsy/Analytics/Schema" import { useTracking } from "v2/Artsy/Analytics/useTracking" diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/Header/__tests__/Header.jest.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/Header/__tests__/Header.jest.tsx index 7b49b0708f3..1937b4079e5 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/Header/__tests__/Header.jest.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/Header/__tests__/Header.jest.tsx @@ -11,7 +11,7 @@ import { mount } from "enzyme" import { cloneDeep } from "lodash" import React from "react" import sharify from "sharify" -import { CollectionHeader, getFeaturedArtists, Props } from "../index" +import { CollectionHeader, Props, getFeaturedArtists } from "../index" jest.mock("sharify", () => ({ get data() { diff --git a/src/v2/Apps/Collect/Routes/Collection/Components/Header/index.tsx b/src/v2/Apps/Collect/Routes/Collection/Components/Header/index.tsx index 2bb469425bf..7d5112db52b 100644 --- a/src/v2/Apps/Collect/Routes/Collection/Components/Header/index.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/Components/Header/index.tsx @@ -1,16 +1,16 @@ -import { Intent, ContextModule } from "@artsy/cohesion" -import { breakpoints, EntityHeader, ReadMore } from "@artsy/palette" +import { ContextModule, Intent } from "@artsy/cohesion" +import { EntityHeader, ReadMore, breakpoints } from "@artsy/palette" import { Box, Col, - color, Flex, Grid, - media, Row, Sans, Serif, Spacer, + color, + media, } from "@artsy/palette" import { Header_artworks } from "v2/__generated__/Header_artworks.graphql" import { Header_collection } from "v2/__generated__/Header_collection.graphql" @@ -205,13 +205,13 @@ export const CollectionHeader: FC = ({ artworks, collection }) => { )} ) : ( - - )} + + )} = ({ artworks, collection }) => { content={htmlUnsafeDescription || ""} /> ) : ( - htmlUnsafeDescription - )} + htmlUnsafeDescription + )} {collection.description && } @@ -277,7 +277,7 @@ export const CollectionHeader: FC = ({ artworks, collection }) => { ) } -const CollectionSingleImageHeader = styled(Box) <{ +const CollectionSingleImageHeader = styled(Box)<{ headerImageUrl: string height: number }>` diff --git a/src/v2/Apps/Collect/Routes/Collection/index.tsx b/src/v2/Apps/Collect/Routes/Collection/index.tsx index f4565d42e8c..3e41d1f99e4 100644 --- a/src/v2/Apps/Collect/Routes/Collection/index.tsx +++ b/src/v2/Apps/Collect/Routes/Collection/index.tsx @@ -1,4 +1,4 @@ -import { Box, breakpoints, Separator } from "@artsy/palette" +import { Box, Separator, breakpoints } from "@artsy/palette" import { Collection_collection } from "v2/__generated__/Collection_collection.graphql" import { SeoProductsForArtworks } from "v2/Apps/Collect/Components/SeoProductsForArtworks" import { SeoProductsForCollections } from "v2/Apps/Collect/Components/SeoProductsForCollections" @@ -14,7 +14,7 @@ import { Match } from "found" import { HttpError } from "found" import React, { Component } from "react" import { Link, Meta, Title } from "react-head" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { data as sd } from "sharify" import truncate from "trunc-html" import { CollectionAppQuery } from "./CollectionAppQuery" @@ -71,7 +71,7 @@ export class CollectionApp extends Component { const metadataDescription = description ? `Buy, bid, and inquire on ${title} on Artsy. ` + - truncate(description, 158).text + truncate(description, 158).text : `Buy, bid, and inquire on ${title} on Artsy.` const showCollectionHubs = collection.linkedCollections.length > 0 diff --git a/src/v2/Apps/Conversation/Components/Conversations.tsx b/src/v2/Apps/Conversation/Components/Conversations.tsx index 85dcf5ce059..85c190472eb 100644 --- a/src/v2/Apps/Conversation/Components/Conversations.tsx +++ b/src/v2/Apps/Conversation/Components/Conversations.tsx @@ -1,7 +1,7 @@ -import { Box, media, color } from "@artsy/palette" +import { Box, color, media } from "@artsy/palette" import { Conversations_me } from "v2/__generated__/Conversations_me.graphql" import React from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { ConversationSnippetFragmentContainer as ConversationSnippet } from "./ConversationSnippet" import { NoMessages } from "./NoMessages" import styled from "styled-components" @@ -32,8 +32,8 @@ const Conversations: React.FC = props => { ))} ) : ( - - )} + + )} ) diff --git a/src/v2/Apps/Conversation/Components/Details.tsx b/src/v2/Apps/Conversation/Components/Details.tsx index 9d7079d79ce..a5cee519565 100644 --- a/src/v2/Apps/Conversation/Components/Details.tsx +++ b/src/v2/Apps/Conversation/Components/Details.tsx @@ -1,4 +1,4 @@ -import { Flex, FlexProps, color, EntityHeader, Separator } from "@artsy/palette" +import { EntityHeader, Flex, FlexProps, Separator, color } from "@artsy/palette" import React, { FC } from "react" import styled from "styled-components" import { createFragmentContainer, graphql } from "react-relay" diff --git a/src/v2/Apps/Conversation/Components/InboxHeaders.tsx b/src/v2/Apps/Conversation/Components/InboxHeaders.tsx index e7f070b388e..05d44c5ef6e 100644 --- a/src/v2/Apps/Conversation/Components/InboxHeaders.tsx +++ b/src/v2/Apps/Conversation/Components/InboxHeaders.tsx @@ -1,13 +1,13 @@ import React, { FC } from "react" import styled from "styled-components" import { - Flex, ArrowLeftIcon, - color, - Sans, + Flex, + FlexProps, InfoCircleIcon, + Sans, Separator, - FlexProps, + color, } from "@artsy/palette" import { RouterLink } from "v2/Artsy/Router/RouterLink" import { Media } from "v2/Utils/Responsive" @@ -15,7 +15,7 @@ import { Media } from "v2/Utils/Responsive" interface BorderedFlexProps extends FlexProps { bordered?: boolean } -const BorderedFlex = styled(Flex) ` +const BorderedFlex = styled(Flex)` ${props => props.bordered ? `border-right: 1px solid ${color("black10")};` : ""} height: 100%; @@ -113,8 +113,8 @@ export const FullHeader: FC> = props => { Conversation with {props.partnerName} ) : ( - <>{props.children} - )} + <>{props.children} + )} diff --git a/src/v2/Apps/Conversation/Components/Reply.tsx b/src/v2/Apps/Conversation/Components/Reply.tsx index e3fe61fff80..7017c82a486 100644 --- a/src/v2/Apps/Conversation/Components/Reply.tsx +++ b/src/v2/Apps/Conversation/Components/Reply.tsx @@ -1,12 +1,12 @@ -import { Button, color, Flex, media, FlexProps } from "@artsy/palette" +import { Button, Flex, FlexProps, color, media } from "@artsy/palette" import { Conversation_conversation } from "v2/__generated__/Conversation_conversation.graphql" import React, { useRef, useState } from "react" import { Environment } from "react-relay" import styled from "styled-components" import { SendConversationMessage } from "../Mutation/SendConversationMessage" -import { right, RightProps } from "styled-system" +import { RightProps, right } from "styled-system" -const StyledFlex = styled(Flex) ` +const StyledFlex = styled(Flex)` ${right}; border-top: 1px solid ${color("black10")}; position: fixed; @@ -19,7 +19,7 @@ const StyledFlex = styled(Flex) ` `} ` -const FullWidthFlex = styled(Flex) <{ height?: string }>` +const FullWidthFlex = styled(Flex)<{ height?: string }>` div { width: 100%; height: ${({ height }) => height}; diff --git a/src/v2/Apps/Conversation/ConversationApp.tsx b/src/v2/Apps/Conversation/ConversationApp.tsx index 24d8f334671..6a5f5435615 100644 --- a/src/v2/Apps/Conversation/ConversationApp.tsx +++ b/src/v2/Apps/Conversation/ConversationApp.tsx @@ -3,7 +3,7 @@ import { AppContainer } from "v2/Apps/Components/AppContainer" import { ConversationsFragmentContainer as Conversations } from "v2/Apps/Conversation/Components/Conversations" import { findCurrentRoute } from "v2/Artsy/Router/Utils/findCurrentRoute" import { Match, Router } from "found" -import React, { useEffect, useState, useContext } from "react" +import React, { useContext, useEffect, useState } from "react" import { Title } from "react-head" import { createFragmentContainer, graphql } from "react-relay" import { Flex, Spinner, breakpoints } from "@artsy/palette" diff --git a/src/v2/Apps/Conversation/Mutation/SendConversationMessage.ts b/src/v2/Apps/Conversation/Mutation/SendConversationMessage.ts index d9424ac1625..4ef484d7886 100644 --- a/src/v2/Apps/Conversation/Mutation/SendConversationMessage.ts +++ b/src/v2/Apps/Conversation/Mutation/SendConversationMessage.ts @@ -1,12 +1,12 @@ import { Conversation_conversation } from "v2/__generated__/Conversation_conversation.graphql" import { SendConversationMessageMutation } from "v2/__generated__/SendConversationMessageMutation.graphql" import { - commitMutation, ConnectionHandler, Environment, - graphql, MutationConfig, RecordSourceSelectorProxy, + commitMutation, + graphql, } from "relay-runtime" export const SendConversationMessage = ( diff --git a/src/v2/Apps/Conversation/Routes/Conversation/index.tsx b/src/v2/Apps/Conversation/Routes/Conversation/index.tsx index 6cc6198eed3..0db461c861f 100644 --- a/src/v2/Apps/Conversation/Routes/Conversation/index.tsx +++ b/src/v2/Apps/Conversation/Routes/Conversation/index.tsx @@ -1,4 +1,4 @@ -import { Title, Flex } from "@artsy/palette" +import { Flex, Title } from "@artsy/palette" import { Conversation_me } from "v2/__generated__/Conversation_me.graphql" import { AppContainer } from "v2/Apps/Components/AppContainer" import { ConversationFragmentContainer as Conversation } from "v2/Apps/Conversation/Components/Conversation" @@ -13,8 +13,8 @@ import { userHasLabFeature } from "v2/Utils/user" import { Media } from "v2/Utils/Responsive" import { Conversations_me } from "v2/__generated__/Conversations_me.graphql" import { - FullHeader, ConversationHeader, + FullHeader, } from "v2/Apps/Conversation/Components/InboxHeaders" import { DetailsFragmentContainer as Details } from "../../Components/Details" interface ConversationRouteProps { @@ -23,7 +23,7 @@ interface ConversationRouteProps { match: Match } -export const ConversationRoute: React.FC = (props) => { +export const ConversationRoute: React.FC = props => { const { me } = props const { user } = useContext(SystemContext) const isEnabled = userHasLabFeature(user, "User Conversations View") diff --git a/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx b/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx index c14f819b24b..ff04589814f 100644 --- a/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx +++ b/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx @@ -8,10 +8,10 @@ import { ErrorModal } from "v2/Components/Modal/ErrorModal" import React, { useState } from "react" import { Title as HeadTitle } from "react-head" import { + RelayProp, commitMutation, createFragmentContainer, graphql, - RelayProp, } from "react-relay" import { useTracking } from "react-tracking" import createLogger from "v2/Utils/logger" diff --git a/src/v2/Apps/Order/Components/CreditCardInput.tsx b/src/v2/Apps/Order/Components/CreditCardInput.tsx index 856aeee5166..27bbd5c1247 100644 --- a/src/v2/Apps/Order/Components/CreditCardInput.tsx +++ b/src/v2/Apps/Order/Components/CreditCardInput.tsx @@ -1,8 +1,8 @@ -import { BorderBox, color, Sans, themeProps } from "@artsy/palette" +import { BorderBox, Sans, color, themeProps } from "@artsy/palette" import { fontFamily } from "@artsy/palette/dist/platform/fonts" import { - border as inputBorder, BorderProps as InputBorderProps, + border as inputBorder, } from "v2/Components/Mixins" import React from "react" import { CardElement } from "react-stripe-elements" @@ -32,7 +32,7 @@ interface CreditCardInputState { export class CreditCardInput extends React.Component< CreditCardInputProps, CreditCardInputState - > { +> { state = { focused: false, } diff --git a/src/v2/Apps/Order/Components/PaymentPicker.tsx b/src/v2/Apps/Order/Components/PaymentPicker.tsx index d001032d59a..5f9398f1fe3 100644 --- a/src/v2/Apps/Order/Components/PaymentPicker.tsx +++ b/src/v2/Apps/Order/Components/PaymentPicker.tsx @@ -16,7 +16,7 @@ import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" import React from "react" import { createFragmentContainer, graphql } from "react-relay" -import { injectStripe, ReactStripeElements } from "react-stripe-elements" +import { ReactStripeElements, injectStripe } from "react-stripe-elements" import { BorderedRadio, @@ -54,7 +54,7 @@ interface PaymentPickerState { export class PaymentPicker extends React.Component< PaymentPickerProps, PaymentPickerState - > { +> { state = { hideBillingAddress: true, stripeError: null, @@ -72,9 +72,9 @@ export class PaymentPicker extends React.Component< } else { return this.props.me.creditCards.edges.length ? { - type: "existing", - id: this.props.me.creditCards.edges[0].node.internalID, - } + type: "existing", + id: this.props.me.creditCards.edges[0].node.internalID, + } : { type: "new" } } } diff --git a/src/v2/Apps/Order/Components/StickyFooter.tsx b/src/v2/Apps/Order/Components/StickyFooter.tsx index 8d4c3d360dd..36121693090 100644 --- a/src/v2/Apps/Order/Components/StickyFooter.tsx +++ b/src/v2/Apps/Order/Components/StickyFooter.tsx @@ -1,4 +1,4 @@ -import { color, Flex, Link, Sans, Spacer } from "@artsy/palette" +import { Flex, Link, Sans, Spacer, color } from "@artsy/palette" import { SystemContextConsumer } from "v2/Artsy" import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" diff --git a/src/v2/Apps/Order/Components/__stories__/ArtworkSummaryItem.story.tsx b/src/v2/Apps/Order/Components/__stories__/ArtworkSummaryItem.story.tsx index 852c289760e..225b409640b 100644 --- a/src/v2/Apps/Order/Components/__stories__/ArtworkSummaryItem.story.tsx +++ b/src/v2/Apps/Order/Components/__stories__/ArtworkSummaryItem.story.tsx @@ -1,6 +1,9 @@ import { Flex } from "@artsy/palette" import { ArtworkSummaryItem_order } from "v2/__generated__/ArtworkSummaryItem_order.graphql" -import { mockResolver, UntouchedBuyOrder } from "v2/Apps/__tests__/Fixtures/Order" +import { + UntouchedBuyOrder, + mockResolver, +} from "v2/Apps/__tests__/Fixtures/Order" import { MockRelayRenderer } from "v2/DevTools" import React from "react" import { graphql } from "react-relay" diff --git a/src/v2/Apps/Order/Components/__stories__/OfferHistoryItem.story.tsx b/src/v2/Apps/Order/Components/__stories__/OfferHistoryItem.story.tsx index 8cf7d042e77..50d5dd26914 100644 --- a/src/v2/Apps/Order/Components/__stories__/OfferHistoryItem.story.tsx +++ b/src/v2/Apps/Order/Components/__stories__/OfferHistoryItem.story.tsx @@ -2,10 +2,10 @@ import { Flex } from "@artsy/palette" import { OfferHistoryItem_order } from "v2/__generated__/OfferHistoryItem_order.graphql" import { Buyer, - mockResolver, - Offers, OfferWithTotals, + Offers, UntouchedOfferOrder, + mockResolver, } from "v2/Apps/__tests__/Fixtures/Order" import { MockRelayRenderer } from "v2/DevTools" import React from "react" @@ -26,19 +26,19 @@ const render = ( extraOrderProps?: Partial, extraComponentProps?: Partial> ) => ( - ( - - )} - mockResolvers={mockResolver({ - ...UntouchedOfferOrder, - buyer: Buyer, - lastOffer: OfferWithTotals, - ...extraOrderProps, - })} - query={orderQuery} - /> - ) + ( + + )} + mockResolvers={mockResolver({ + ...UntouchedOfferOrder, + buyer: Buyer, + lastOffer: OfferWithTotals, + ...extraOrderProps, + })} + query={orderQuery} + /> +) storiesOf("Apps/Order/Components", module).add("OfferHistoryItem", () => { return ( diff --git a/src/v2/Apps/Order/Components/__tests__/OfferHistoryItem.jest.tsx b/src/v2/Apps/Order/Components/__tests__/OfferHistoryItem.jest.tsx index 8fd30e5cc1b..fe6749c53b6 100644 --- a/src/v2/Apps/Order/Components/__tests__/OfferHistoryItem.jest.tsx +++ b/src/v2/Apps/Order/Components/__tests__/OfferHistoryItem.jest.tsx @@ -4,8 +4,8 @@ import { OfferHistoryItemTestQueryResponse, } from "v2/__generated__/OfferHistoryItemTestQuery.graphql" import { - Offers, OfferWithTotals, + Offers, UntouchedOfferOrder, } from "v2/Apps/__tests__/Fixtures/Order" import { renderRelayTree } from "v2/DevTools" diff --git a/src/v2/Apps/Order/Components/__tests__/OfferInput.jest.tsx b/src/v2/Apps/Order/Components/__tests__/OfferInput.jest.tsx index bd0da31727a..e4289fadf5a 100644 --- a/src/v2/Apps/Order/Components/__tests__/OfferInput.jest.tsx +++ b/src/v2/Apps/Order/Components/__tests__/OfferInput.jest.tsx @@ -1,4 +1,4 @@ -import { mount, ReactWrapper } from "enzyme" +import { ReactWrapper, mount } from "enzyme" import React from "react" import { OfferInput, OfferInputProps } from "../OfferInput" diff --git a/src/v2/Apps/Order/Components/__tests__/OfferNote.jest.tsx b/src/v2/Apps/Order/Components/__tests__/OfferNote.jest.tsx index 4b39e69fa8b..f04bd0854a2 100644 --- a/src/v2/Apps/Order/Components/__tests__/OfferNote.jest.tsx +++ b/src/v2/Apps/Order/Components/__tests__/OfferNote.jest.tsx @@ -1,6 +1,6 @@ import { Link } from "@artsy/palette" import { SystemContextProvider } from "v2/Artsy" -import { mount, ReactWrapper } from "enzyme" +import { ReactWrapper, mount } from "enzyme" import React from "react" import { ExtractProps } from "v2/Utils/ExtractProps" import { OfferNote } from "../OfferNote" diff --git a/src/v2/Apps/Order/Routes/Accept/index.tsx b/src/v2/Apps/Order/Routes/Accept/index.tsx index 6fea328eda8..0ed96358e54 100644 --- a/src/v2/Apps/Order/Routes/Accept/index.tsx +++ b/src/v2/Apps/Order/Routes/Accept/index.tsx @@ -7,11 +7,11 @@ import { RouteConfig, Router } from "found" import React, { Component } from "react" import { Media } from "v2/Utils/Responsive" import { - counterofferFlowSteps, OrderStepper, + counterofferFlowSteps, } from "../../Components/OrderStepper" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import { AcceptOfferMutation } from "v2/__generated__/AcceptOfferMutation.graphql" import { ConditionsOfSaleDisclaimer } from "v2/Apps/Order/Components/ConditionsOfSaleDisclaimer" @@ -96,7 +96,7 @@ export class Accept extends Component { logger.error(error) switch (error.code) { case "capture_failed": { - const parsedData = get(error, (e) => JSON.parse(e.data), {}) + const parsedData = get(error, e => JSON.parse(e.data), {}) // https://stripe.com/docs/declines/codes if (parsedData.decline_code === "insufficient_funds") { @@ -148,7 +148,7 @@ export class Accept extends Component { artistId() { return get( this.props.order, - (o) => o.lineItems.edges[0].node.artwork.artists[0].slug + o => o.lineItems.edges[0].node.artwork.artists[0].slug ) } @@ -221,7 +221,7 @@ export class Accept extends Component { - {(className) => ( + {className => ( )} diff --git a/src/v2/Apps/Order/Routes/Counter/index.tsx b/src/v2/Apps/Order/Routes/Counter/index.tsx index c1045d5d4f8..65f42df0522 100644 --- a/src/v2/Apps/Order/Routes/Counter/index.tsx +++ b/src/v2/Apps/Order/Routes/Counter/index.tsx @@ -6,8 +6,8 @@ import { ArtworkSummaryItemFragmentContainer as ArtworkSummaryItem } from "v2/Ap import { ConditionsOfSaleDisclaimer } from "v2/Apps/Order/Components/ConditionsOfSaleDisclaimer" import { CreditCardSummaryItemFragmentContainer as CreditCardSummaryItem } from "v2/Apps/Order/Components/CreditCardSummaryItem" import { - counterofferFlowSteps, OrderStepper, + counterofferFlowSteps, } from "v2/Apps/Order/Components/OrderStepper" import { ShippingSummaryItemFragmentContainer as ShippingSummaryItem } from "v2/Apps/Order/Components/ShippingSummaryItem" import { TransactionDetailsSummaryItemFragmentContainer as TransactionDetailsSummaryItem } from "v2/Apps/Order/Components/TransactionDetailsSummaryItem" @@ -22,7 +22,7 @@ import * as Schema from "v2/Artsy/Analytics/Schema" import { CountdownTimer } from "v2/Components/CountdownTimer" import { Router } from "found" import React, { Component } from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import createLogger from "v2/Utils/logger" import { Media } from "v2/Utils/Responsive" @@ -110,7 +110,7 @@ export class CounterRoute extends Component { } } - @track((props) => ({ + @track(props => ({ action_type: Schema.ActionType.SubmittedCounterOffer, order_id: props.order.internalID, })) diff --git a/src/v2/Apps/Order/Routes/Offer/index.tsx b/src/v2/Apps/Order/Routes/Offer/index.tsx index 4e7fe03ed40..c7fdc36be89 100644 --- a/src/v2/Apps/Order/Routes/Offer/index.tsx +++ b/src/v2/Apps/Order/Routes/Offer/index.tsx @@ -26,10 +26,10 @@ import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics" import { Router } from "found" import React, { Component } from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import createLogger from "v2/Utils/logger" import { Media } from "v2/Utils/Responsive" -import { offerFlowSteps, OrderStepper } from "../../Components/OrderStepper" +import { OrderStepper, offerFlowSteps } from "../../Components/OrderStepper" export interface OfferProps { order: Offer_order @@ -60,7 +60,7 @@ export class OfferRoute extends Component { highSpeedBumpEncountered: false, } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.FocusedOnOfferInput, flow: Schema.Flow.MakeOffer, @@ -69,7 +69,7 @@ export class OfferRoute extends Component { // noop } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferTooLow, flow: Schema.Flow.MakeOffer, @@ -84,7 +84,7 @@ export class OfferRoute extends Component { }) } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferHigherThanListPrice, flow: Schema.Flow.MakeOffer, @@ -235,7 +235,7 @@ export class OfferRoute extends Component { showError={ this.state.formIsDirty && this.state.offerValue <= 0 } - onChange={(offerValue) => this.setState({ offerValue })} + onChange={offerValue => this.setState({ offerValue })} onFocus={this.onOfferInputFocus.bind(this)} /> @@ -247,7 +247,7 @@ export class OfferRoute extends Component { + onChange={offerNoteValue => this.setState({ offerNoteValue }) } artworkId={artworkId} diff --git a/src/v2/Apps/Order/Routes/Payment/index.tsx b/src/v2/Apps/Order/Routes/Payment/index.tsx index 7267ea9a462..82d81862053 100644 --- a/src/v2/Apps/Order/Routes/Payment/index.tsx +++ b/src/v2/Apps/Order/Routes/Payment/index.tsx @@ -5,9 +5,9 @@ import { PaymentRouteSetOrderPaymentMutation } from "v2/__generated__/PaymentRou import { HorizontalPadding } from "v2/Apps/Components/HorizontalPadding" import { ArtworkSummaryItemFragmentContainer as ArtworkSummaryItem } from "v2/Apps/Order/Components/ArtworkSummaryItem" import { + OrderStepper, buyNowFlowSteps, offerFlowSteps, - OrderStepper, } from "v2/Apps/Order/Components/OrderStepper" import { TransactionDetailsSummaryItemFragmentContainer as TransactionDetailsSummaryItem } from "v2/Apps/Order/Components/TransactionDetailsSummaryItem" import { TwoColumnLayout } from "v2/Apps/Order/Components/TwoColumnLayout" @@ -30,7 +30,7 @@ import { } from "v2/Apps/Order/Utils/commitMutation" import { AnalyticsSchema, track } from "v2/Artsy" -export const ContinueButton = (props) => ( +export const ContinueButton = props => ( diff --git a/src/v2/Apps/Order/Routes/Reject/index.tsx b/src/v2/Apps/Order/Routes/Reject/index.tsx index 4529dfdf09e..d4be5712388 100644 --- a/src/v2/Apps/Order/Routes/Reject/index.tsx +++ b/src/v2/Apps/Order/Routes/Reject/index.tsx @@ -14,8 +14,8 @@ import { Media } from "v2/Utils/Responsive" import { logger } from "../Respond" import { - counterofferFlowSteps, OrderStepper, + counterofferFlowSteps, } from "v2/Apps/Order/Components/OrderStepper" import { Dialog, injectDialog } from "v2/Apps/Order/Dialogs" @@ -23,7 +23,7 @@ import { CommitMutation, injectCommitMutation, } from "v2/Apps/Order/Utils/commitMutation" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" interface RejectProps { order: Reject_order diff --git a/src/v2/Apps/Order/Routes/Respond/index.tsx b/src/v2/Apps/Order/Routes/Respond/index.tsx index 98f01e91a72..e12fe6fa013 100644 --- a/src/v2/Apps/Order/Routes/Respond/index.tsx +++ b/src/v2/Apps/Order/Routes/Respond/index.tsx @@ -28,15 +28,15 @@ import * as Schema from "v2/Artsy/Analytics/Schema" import { CountdownTimer } from "v2/Components/CountdownTimer" import { Router } from "found" import React, { Component } from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import createLogger from "v2/Utils/logger" import { Media } from "v2/Utils/Responsive" import { ArtworkSummaryItemFragmentContainer as ArtworkSummaryItem } from "../../Components/ArtworkSummaryItem" import { CreditCardSummaryItemFragmentContainer as CreditCardSummaryItem } from "../../Components/CreditCardSummaryItem" import { OfferHistoryItemFragmentContainer as OfferHistoryItem } from "../../Components/OfferHistoryItem" import { - counterofferFlowSteps, OrderStepper, + counterofferFlowSteps, } from "../../Components/OrderStepper" import { ShippingSummaryItemFragmentContainer as ShippingSummaryItem } from "../../Components/ShippingSummaryItem" @@ -71,7 +71,7 @@ export class RespondRoute extends Component { highSpeedBumpEncountered: false, } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.FocusedOnOfferInput, flow: Schema.Flow.MakeOffer, @@ -80,7 +80,7 @@ export class RespondRoute extends Component { // noop } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferTooLow, flow: Schema.Flow.MakeOffer, @@ -95,7 +95,7 @@ export class RespondRoute extends Component { }) } - @track((props) => ({ + @track(props => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferHigherThanListPrice, flow: Schema.Flow.MakeOffer, @@ -272,7 +272,7 @@ export class RespondRoute extends Component { showError={ this.state.formIsDirty && this.state.offerValue <= 0 } - onChange={(offerValue) => this.setState({ offerValue })} + onChange={offerValue => this.setState({ offerValue })} onFocus={this.onOfferInputFocus.bind(this)} /> @@ -282,7 +282,7 @@ export class RespondRoute extends Component { > + onChange={offerNoteValue => this.setState({ offerNoteValue }) } artworkId={artworkId} diff --git a/src/v2/Apps/Order/Routes/Review/index.tsx b/src/v2/Apps/Order/Routes/Review/index.tsx index 4e4ca2bd8ba..aa51f611064 100644 --- a/src/v2/Apps/Order/Routes/Review/index.tsx +++ b/src/v2/Apps/Order/Routes/Review/index.tsx @@ -7,9 +7,9 @@ import { ArtworkSummaryItemFragmentContainer as ArtworkSummaryItem } from "v2/Ap import { ConditionsOfSaleDisclaimer } from "v2/Apps/Order/Components/ConditionsOfSaleDisclaimer" import { ItemReviewFragmentContainer as ItemReview } from "v2/Apps/Order/Components/ItemReview" import { + OrderStepper, buyNowFlowSteps, offerFlowSteps, - OrderStepper, } from "v2/Apps/Order/Components/OrderStepper" import { ShippingSummaryItemFragmentContainer as ShippingSummaryItem } from "v2/Apps/Order/Components/ShippingSummaryItem" import { TransactionDetailsSummaryItemFragmentContainer as TransactionDetailsSummaryItem } from "v2/Apps/Order/Components/TransactionDetailsSummaryItem" @@ -22,7 +22,7 @@ import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" import { RouteConfig, Router } from "found" import React, { Component } from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import { data as sd } from "sharify" import { get } from "v2/Utils/get" import createLogger from "v2/Utils/logger" @@ -65,7 +65,7 @@ export class ReviewRoute extends Component { } } - @track((props) => ({ + @track(props => ({ action_type: props.order.mode === "BUY" ? Schema.ActionType.SubmittedOrder @@ -97,7 +97,7 @@ export class ReviewRoute extends Component { ) { this.state.stripe .handleCardAction(orderOrError.actionData.clientSecret) - .then((result) => { + .then(result => { if (result.error) { this.props.dialog.showErrorDialog({ title: "An error occurred", @@ -115,7 +115,7 @@ export class ReviewRoute extends Component { ) { this.state.stripe .handleCardSetup(orderOrError.actionData.clientSecret) - .then((result) => { + .then(result => { if (result.error) { this.props.dialog.showErrorDialog({ title: "An error occurred", @@ -289,14 +289,14 @@ export class ReviewRoute extends Component { artistId() { return get( this.props.order, - (o) => o.lineItems.edges[0].node.artwork.artists[0].slug + o => o.lineItems.edges[0].node.artwork.artists[0].slug ) } routeToArtworkPage() { const artworkId = get( this.props.order, - (o) => o.lineItems.edges[0].node.artwork.slug + o => o.lineItems.edges[0].node.artwork.slug ) // Don't confirm whether or not you want to leave the page this.props.route.onTransition = () => null diff --git a/src/v2/Apps/Order/Routes/Shipping/index.tsx b/src/v2/Apps/Order/Routes/Shipping/index.tsx index bdaeb778bd9..fe494671f15 100644 --- a/src/v2/Apps/Order/Routes/Shipping/index.tsx +++ b/src/v2/Apps/Order/Routes/Shipping/index.tsx @@ -17,9 +17,9 @@ import { import { HorizontalPadding } from "v2/Apps/Components/HorizontalPadding" import { ArtworkSummaryItemFragmentContainer as ArtworkSummaryItem } from "v2/Apps/Order/Components/ArtworkSummaryItem" import { + OrderStepper, buyNowFlowSteps, offerFlowSteps, - OrderStepper, } from "v2/Apps/Order/Components/OrderStepper" import { PhoneNumber, @@ -49,7 +49,7 @@ import { import { Router } from "found" import { pick } from "lodash" import React, { Component } from "react" -import { createFragmentContainer, graphql, RelayProp } from "react-relay" +import { RelayProp, createFragmentContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" import createLogger from "v2/Utils/logger" import { Media } from "v2/Utils/Responsive" @@ -231,7 +231,7 @@ export class ShippingRoute extends Component { handleSubmitError(error: { code: string; data: string }) { logger.error(error) - const parsedData = get(error, (e) => JSON.parse(e.data), {}) + const parsedData = get(error, e => JSON.parse(e.data), {}) if ( error.code === "missing_region" || error.code === "missing_country" || @@ -267,8 +267,7 @@ export class ShippingRoute extends Component { country: validatePresence(country), postalCode: usOrCanada && validatePresence(postalCode), } - const hasErrors = - Object.keys(errors).filter((key) => errors[key]).length > 0 + const hasErrors = Object.keys(errors).filter(key => errors[key]).length > 0 return { errors, @@ -301,7 +300,7 @@ export class ShippingRoute extends Component { }) } - onPhoneNumberChange: PhoneNumberChangeHandler = (phoneNumber) => { + onPhoneNumberChange: PhoneNumberChangeHandler = phoneNumber => { const { error } = this.validatePhoneNumber(phoneNumber) this.setState({ phoneNumber, @@ -335,7 +334,7 @@ export class ShippingRoute extends Component { } = this.state const artwork = get( this.props, - (props) => props.order.lineItems.edges[0].node.artwork + props => props.order.lineItems.edges[0].node.artwork ) return ( diff --git a/src/v2/Apps/Order/Routes/Status/index.tsx b/src/v2/Apps/Order/Routes/Status/index.tsx index 460f5c223db..5752707feee 100644 --- a/src/v2/Apps/Order/Routes/Status/index.tsx +++ b/src/v2/Apps/Order/Routes/Status/index.tsx @@ -2,11 +2,11 @@ import { Button, Flex, Join, - media, Message, Sans, Serif, Spacer, + media, } from "@artsy/palette" import { Status_order } from "v2/__generated__/Status_order.graphql" import { HorizontalPadding } from "v2/Apps/Components/HorizontalPadding" @@ -205,7 +205,7 @@ export class StatusRoute extends Component { getFulfilmentDescription(): React.ReactNode { const fulfillment = get( this.props.order, - (o) => o.lineItems.edges[0].node.fulfillments.edges[0].node + o => o.lineItems.edges[0].node.fulfillments.edges[0].node ) if (!fulfillment) { diff --git a/src/v2/Apps/Order/Routes/__tests__/Accept.jest.tsx b/src/v2/Apps/Order/Routes/__tests__/Accept.jest.tsx index c50c0079e5a..9a20165e51b 100644 --- a/src/v2/Apps/Order/Routes/__tests__/Accept.jest.tsx +++ b/src/v2/Apps/Order/Routes/__tests__/Accept.jest.tsx @@ -2,8 +2,8 @@ import { AcceptTestQueryRawResponse } from "v2/__generated__/AcceptTestQuery.gra import { Buyer, OfferOrderWithShippingDetails, - Offers, OfferWithTotals, + Offers, } from "v2/Apps/__tests__/Fixtures/Order" import { createTestEnv } from "v2/DevTools/createTestEnv" import { DateTime } from "luxon" diff --git a/src/v2/Apps/Order/Routes/__tests__/Counter.jest.tsx b/src/v2/Apps/Order/Routes/__tests__/Counter.jest.tsx index c7144cf31e9..87ae3e69ba3 100644 --- a/src/v2/Apps/Order/Routes/__tests__/Counter.jest.tsx +++ b/src/v2/Apps/Order/Routes/__tests__/Counter.jest.tsx @@ -1,8 +1,8 @@ import { CounterTestQueryRawResponse } from "v2/__generated__/CounterTestQuery.graphql" import { OfferOrderWithShippingDetails, - Offers, OfferWithTotals, + Offers, } from "v2/Apps/__tests__/Fixtures/Order" import { createTestEnv } from "v2/DevTools/createTestEnv" import { DateTime } from "luxon" diff --git a/src/v2/Apps/Order/Routes/__tests__/Respond.jest.tsx b/src/v2/Apps/Order/Routes/__tests__/Respond.jest.tsx index 3da20e1a1af..e7a3ef99435 100644 --- a/src/v2/Apps/Order/Routes/__tests__/Respond.jest.tsx +++ b/src/v2/Apps/Order/Routes/__tests__/Respond.jest.tsx @@ -4,8 +4,8 @@ import { Buyer, OfferOrderWithShippingDetails, OfferOrderWithShippingDetailsAndNote, - Offers, OfferWithTotals, + Offers, } from "v2/Apps/__tests__/Fixtures/Order" import { OfferHistoryItemFragmentContainer } from "v2/Apps/Order/Components/OfferHistoryItem" import { DateTime } from "luxon" diff --git a/src/v2/Apps/Order/Routes/__tests__/Utils/OrderAppTestPage.tsx b/src/v2/Apps/Order/Routes/__tests__/Utils/OrderAppTestPage.tsx index 003320b5563..657b2a0ec8e 100644 --- a/src/v2/Apps/Order/Routes/__tests__/Utils/OrderAppTestPage.tsx +++ b/src/v2/Apps/Order/Routes/__tests__/Utils/OrderAppTestPage.tsx @@ -9,7 +9,7 @@ import { ShippingSummaryItemFragmentContainer } from "v2/Apps/Order/Components/S import { TransactionDetailsSummaryItem } from "v2/Apps/Order/Components/TransactionDetailsSummaryItem" import { CountdownTimer } from "v2/Components/CountdownTimer" import { ModalButton, ModalDialog } from "v2/Components/Modal/ModalDialog" -import { expectOne, RootTestPage } from "v2/DevTools/RootTestPage" +import { RootTestPage, expectOne } from "v2/DevTools/RootTestPage" export class OrderAppTestPage extends RootTestPage { /** COMPONENT SELECTORS **/ diff --git a/src/v2/Apps/Order/Utils/commitMutation.tsx b/src/v2/Apps/Order/Utils/commitMutation.tsx index 09fc5d6128a..1f5213f8d7f 100644 --- a/src/v2/Apps/Order/Utils/commitMutation.tsx +++ b/src/v2/Apps/Order/Utils/commitMutation.tsx @@ -1,8 +1,8 @@ import { SystemContext } from "v2/Artsy" import React, { useContext } from "react" import { - commitMutation as relayCommitMutation, GraphQLTaggedNode, + commitMutation as relayCommitMutation, } from "react-relay" import { Environment } from "relay-runtime" @@ -32,7 +32,7 @@ const MutationContext = React.createContext({ class ProvideMutationContext extends React.Component< { relayEnvironment: Environment }, { isCommittingMutation: boolean } - > { +> { execQueue: Array<() => Promise> = [] state = { isCommittingMutation: false } commitMutation: CommitMutation = ({ variables, mutation }) => { diff --git a/src/v2/Apps/Order/__tests__/getRedirect.jest.ts b/src/v2/Apps/Order/__tests__/getRedirect.jest.ts index e484e42eebb..b92aebc0663 100644 --- a/src/v2/Apps/Order/__tests__/getRedirect.jest.ts +++ b/src/v2/Apps/Order/__tests__/getRedirect.jest.ts @@ -1,4 +1,4 @@ -import { getRedirect, RedirectRecord } from "../getRedirect" +import { RedirectRecord, getRedirect } from "../getRedirect" describe("getRedirect", () => { const aNonMatchingPredicate = ({}) => null diff --git a/src/v2/Apps/Purchase/Components/PurchaseHistory.tsx b/src/v2/Apps/Purchase/Components/PurchaseHistory.tsx index 8c953b14dd1..f755c2e733b 100644 --- a/src/v2/Apps/Purchase/Components/PurchaseHistory.tsx +++ b/src/v2/Apps/Purchase/Components/PurchaseHistory.tsx @@ -12,7 +12,7 @@ import { } from "@artsy/palette" import { PurchaseHistory_me } from "v2/__generated__/PurchaseHistory_me.graphql" import React, { useState } from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" interface OrderRowProps { @@ -128,8 +128,8 @@ const PurchaseHistory: React.FC = ( {myOrders.length ? ( myOrders.map(order => ) ) : ( - No Orders - )} + No Orders + )} = ( /> ) : ( - - ) + + ) } export const PurchaseHistoryFragmentContainer = createRefetchContainer( diff --git a/src/v2/Apps/Search/Components/GenericSearchResultItem.tsx b/src/v2/Apps/Search/Components/GenericSearchResultItem.tsx index 7930e15fe43..dba8f1e48c4 100644 --- a/src/v2/Apps/Search/Components/GenericSearchResultItem.tsx +++ b/src/v2/Apps/Search/Components/GenericSearchResultItem.tsx @@ -1,12 +1,12 @@ import { Box, - color, Flex, Image, Link, Sans, Serif, Spacer, + color, } from "@artsy/palette" import { track } from "v2/Artsy/Analytics" import * as Schema from "v2/Artsy/Analytics/Schema" @@ -28,7 +28,7 @@ interface GenericSearchResultItemProps { @track() export class GenericSearchResultItem extends React.Component< -GenericSearchResultItemProps + GenericSearchResultItemProps > { @track((props: GenericSearchResultItemProps) => ({ action_type: Schema.ActionType.SelectedItemFromSearchPage, @@ -74,8 +74,8 @@ GenericSearchResultItemProps {imageUrl && entityType !== "City" ? ( ) : ( - - )} + + )} diff --git a/src/v2/Apps/Search/Components/SearchResultsSkeleton/FilterSidebar.tsx b/src/v2/Apps/Search/Components/SearchResultsSkeleton/FilterSidebar.tsx index c457dc737a4..b4b62d68727 100644 --- a/src/v2/Apps/Search/Components/SearchResultsSkeleton/FilterSidebar.tsx +++ b/src/v2/Apps/Search/Components/SearchResultsSkeleton/FilterSidebar.tsx @@ -1,4 +1,4 @@ -import { Box, color, Flex, Separator } from "@artsy/palette" +import { Box, Flex, Separator, color } from "@artsy/palette" import React from "react" const FilterSidebarSection: React.SFC = props => { diff --git a/src/v2/Apps/Search/Components/SearchResultsSkeleton/GridItem.tsx b/src/v2/Apps/Search/Components/SearchResultsSkeleton/GridItem.tsx index 23e25ddaeb4..97d3eecab70 100644 --- a/src/v2/Apps/Search/Components/SearchResultsSkeleton/GridItem.tsx +++ b/src/v2/Apps/Search/Components/SearchResultsSkeleton/GridItem.tsx @@ -1,4 +1,4 @@ -import { Box, BoxProps, color, Spacer } from "@artsy/palette" +import { Box, BoxProps, Spacer, color } from "@artsy/palette" import React from "react" import styled, { css, keyframes } from "styled-components" import { BorderRadiusProps } from "styled-system" diff --git a/src/v2/Apps/Search/Components/SearchResultsSkeleton/Header.tsx b/src/v2/Apps/Search/Components/SearchResultsSkeleton/Header.tsx index 3961baf42ba..b141deea802 100644 --- a/src/v2/Apps/Search/Components/SearchResultsSkeleton/Header.tsx +++ b/src/v2/Apps/Search/Components/SearchResultsSkeleton/Header.tsx @@ -1,4 +1,4 @@ -import { Box, color, Separator } from "@artsy/palette" +import { Box, Separator, color } from "@artsy/palette" import React from "react" export const Header: React.SFC = () => { diff --git a/src/v2/Apps/Search/Components/SendFeedback.tsx b/src/v2/Apps/Search/Components/SendFeedback.tsx index 691483813a7..fe1fc3c15b6 100644 --- a/src/v2/Apps/Search/Components/SendFeedback.tsx +++ b/src/v2/Apps/Search/Components/SendFeedback.tsx @@ -2,11 +2,11 @@ import { Box, Button, CheckCircleIcon, - color, Flex, Input, Serif, TextArea, + color, } from "@artsy/palette" import { SendFeedbackSearchResultsMutation } from "v2/__generated__/SendFeedbackSearchResultsMutation.graphql" import { SystemContextProps } from "v2/Artsy" diff --git a/src/v2/Apps/Search/Components/__tests__/SendFeedback.jest.tsx b/src/v2/Apps/Search/Components/__tests__/SendFeedback.jest.tsx index 9aab5953eb1..4838f89fe28 100644 --- a/src/v2/Apps/Search/Components/__tests__/SendFeedback.jest.tsx +++ b/src/v2/Apps/Search/Components/__tests__/SendFeedback.jest.tsx @@ -1,7 +1,7 @@ import { Button } from "@artsy/palette" import { SendFeedback } from "v2/Apps/Search/Components/SendFeedback" import { MockBoot } from "v2/DevTools" -import { mount, ReactWrapper } from "enzyme" +import { ReactWrapper, mount } from "enzyme" import React from "react" import { commitMutation as _commitMutation } from "react-relay" import { Environment } from "relay-runtime" diff --git a/src/v2/Apps/Search/Routes/Artists/SearchResultsArtists.tsx b/src/v2/Apps/Search/Routes/Artists/SearchResultsArtists.tsx index 033d82705d3..baeef4aa00a 100644 --- a/src/v2/Apps/Search/Routes/Artists/SearchResultsArtists.tsx +++ b/src/v2/Apps/Search/Routes/Artists/SearchResultsArtists.tsx @@ -7,7 +7,7 @@ import { PaginationFragmentContainer as Pagination } from "v2/Components/Paginat import { RouterState, withRouter } from "found" import qs from "qs" import React from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" export interface Props extends RouterState { @@ -153,8 +153,8 @@ export class SearchResultsArtistsRoute extends React.Component { ) : ( - this.renderArtists() - )} + this.renderArtists() + )} ) } diff --git a/src/v2/Apps/Search/Routes/Entity/SearchResultsEntity.tsx b/src/v2/Apps/Search/Routes/Entity/SearchResultsEntity.tsx index 0533f5387f0..a592820e5bf 100644 --- a/src/v2/Apps/Search/Routes/Entity/SearchResultsEntity.tsx +++ b/src/v2/Apps/Search/Routes/Entity/SearchResultsEntity.tsx @@ -7,7 +7,7 @@ import { PaginationFragmentContainer as Pagination } from "v2/Components/Paginat import { RouterState, withRouter } from "found" import qs from "qs" import React from "react" -import { createRefetchContainer, graphql, RelayRefetchProp } from "react-relay" +import { RelayRefetchProp, createRefetchContainer, graphql } from "react-relay" import { get } from "v2/Utils/get" export interface Props extends RouterState { @@ -156,8 +156,8 @@ export class SearchResultsEntityRoute extends React.Component { ) : ( - this.renderItems() - )} + this.renderItems() + )} ) } diff --git a/src/v2/Apps/Search/SearchApp.tsx b/src/v2/Apps/Search/SearchApp.tsx index e5903f22305..a3feefcd17f 100644 --- a/src/v2/Apps/Search/SearchApp.tsx +++ b/src/v2/Apps/Search/SearchApp.tsx @@ -12,7 +12,7 @@ import { Footer } from "v2/Components/Footer" import { RecentlyViewedQueryRenderer as RecentlyViewed } from "v2/Components/RecentlyViewed" import { RouterState, withRouter } from "found" -import React, { useEffect, useState } from "react" +import React, { useCallback, useEffect, useState } from "react" import { createFragmentContainer, graphql } from "react-relay" import { TrackingProp } from "react-tracking" import { get } from "v2/Utils/get" @@ -27,13 +27,17 @@ const TotalResults: React.SFC<{ count: number; term: string }> = ({ count, term, }) => { - const formatResults = () => - `${count.toLocaleString()} Result${count > 1 ? "s" : ""} for "${term}"` + const formatResults = useCallback( + () => + `${count.toLocaleString()} Result${count > 1 ? "s" : ""} for "${term}"`, + [count, term] + ) + const [results, setResults] = useState(formatResults()) useEffect(() => { setResults(formatResults()) - }, [count]) + }, [count, formatResults]) return {results} } @@ -129,11 +133,11 @@ export class SearchApp extends React.Component { artworkCount ) ) : ( - - - {this.renderFooter()} - - )} + + + {this.renderFooter()} + + )} diff --git a/src/v2/Apps/WorksForYou/WorksForYouArtistFeed.tsx b/src/v2/Apps/WorksForYou/WorksForYouArtistFeed.tsx index 1573c722559..a10f05f5f39 100644 --- a/src/v2/Apps/WorksForYou/WorksForYouArtistFeed.tsx +++ b/src/v2/Apps/WorksForYou/WorksForYouArtistFeed.tsx @@ -7,9 +7,9 @@ import styled from "styled-components" import { get } from "v2/Utils/get" import { + RelayPaginationProp, createPaginationContainer, graphql, - RelayPaginationProp, } from "react-relay" interface Props extends SystemContextProps { diff --git a/src/v2/Apps/WorksForYou/WorksForYouFeed.tsx b/src/v2/Apps/WorksForYou/WorksForYouFeed.tsx index a9485914c2f..54fe1f047b8 100644 --- a/src/v2/Apps/WorksForYou/WorksForYouFeed.tsx +++ b/src/v2/Apps/WorksForYou/WorksForYouFeed.tsx @@ -8,9 +8,9 @@ import styled from "styled-components" import { get } from "v2/Utils/get" import { + RelayPaginationProp, createPaginationContainer, graphql, - RelayPaginationProp, } from "react-relay" interface Props extends SystemContextProps { diff --git a/src/v2/Apps/__stories__/OrderApp.story.tsx b/src/v2/Apps/__stories__/OrderApp.story.tsx index 4887d87a735..135b5f6e3c3 100644 --- a/src/v2/Apps/__stories__/OrderApp.story.tsx +++ b/src/v2/Apps/__stories__/OrderApp.story.tsx @@ -1,12 +1,12 @@ import { - Buyer, BuyOrderPickup, BuyOrderWithShippingDetails, + Buyer, OfferOrderPickup, OfferOrderWithOffers, OfferOrderWithShippingDetails, - Offers, OfferWithTotals, + Offers, PaymentDetails, ShippingTotals, TaxTotals, diff --git a/src/v2/Artsy/Analytics/useRouteTracking.tsx b/src/v2/Artsy/Analytics/useRouteTracking.tsx index 34c41bcffec..6b29552be24 100644 --- a/src/v2/Artsy/Analytics/useRouteTracking.tsx +++ b/src/v2/Artsy/Analytics/useRouteTracking.tsx @@ -21,7 +21,7 @@ export function useRouteTracking() { setShouldTrack(false) }) } - }, [isFetching]) + }, [isFetching, prevFetching]) return shouldTrack } diff --git a/src/v2/Artsy/Relay/createRelaySSREnvironment.ts b/src/v2/Artsy/Relay/createRelaySSREnvironment.ts index 926cdaf360e..6d8d2e4d823 100644 --- a/src/v2/Artsy/Relay/createRelaySSREnvironment.ts +++ b/src/v2/Artsy/Relay/createRelaySSREnvironment.ts @@ -8,10 +8,10 @@ import { Environment, INetwork, RecordSource, Store } from "relay-runtime" import { data as sd } from "sharify" import { + RelayNetworkLayer, cacheMiddleware, errorMiddleware, loggerMiddleware, - RelayNetworkLayer, urlMiddleware, } from "react-relay-network-modern/node8" import { metaphysicsErrorHandlerMiddleware } from "./middleware/metaphysicsErrorHandlerMiddleware" diff --git a/src/v2/Artsy/Relay/renderWithLoadProgress.tsx b/src/v2/Artsy/Relay/renderWithLoadProgress.tsx index b42b1deb113..ac849d51643 100644 --- a/src/v2/Artsy/Relay/renderWithLoadProgress.tsx +++ b/src/v2/Artsy/Relay/renderWithLoadProgress.tsx @@ -1,8 +1,8 @@ import { Spinner, SpinnerProps } from "@artsy/palette" import React from "react" import { - Container as RelayContainer, QueryRendererReadyState, + Container as RelayContainer, } from "react-relay" import styled from "styled-components" import createLogger from "v2/Utils/logger" diff --git a/src/v2/Artsy/Router/Boot.tsx b/src/v2/Artsy/Router/Boot.tsx index ed7e972c6fc..5ca357d4ec8 100644 --- a/src/v2/Artsy/Router/Boot.tsx +++ b/src/v2/Artsy/Router/Boot.tsx @@ -1,4 +1,4 @@ -import { Grid, injectGlobalStyles, Theme, themeProps } from "@artsy/palette" +import { Grid, Theme, injectGlobalStyles, themeProps } from "@artsy/palette" import * as Sentry from "@sentry/browser" import { SystemContextProvider, track } from "v2/Artsy" import { RouteConfig } from "found" diff --git a/src/v2/Artsy/Router/NetworkOfflineMonitor.tsx b/src/v2/Artsy/Router/NetworkOfflineMonitor.tsx index 1cbd273708f..5d2b686baf1 100644 --- a/src/v2/Artsy/Router/NetworkOfflineMonitor.tsx +++ b/src/v2/Artsy/Router/NetworkOfflineMonitor.tsx @@ -15,7 +15,7 @@ export const NetworkOfflineMonitor: React.FC = () => { window.removeEventListener("offline", setOffline) window.removeEventListener("online", setOnline) } - }, []) + }, [setOffline, setOnline]) if (!showOfflineModal) { return null diff --git a/src/v2/Artsy/Router/NetworkTimeout.tsx b/src/v2/Artsy/Router/NetworkTimeout.tsx index c3dcf7ed91b..f11b948b22f 100644 --- a/src/v2/Artsy/Router/NetworkTimeout.tsx +++ b/src/v2/Artsy/Router/NetworkTimeout.tsx @@ -25,7 +25,7 @@ export const NetworkTimeout: React.FC = () => { return () => { clearTimeout(timeout) } - }, []) + }, [showErrorModal]) if (!showErrorModal) { return null diff --git a/src/v2/Artsy/Router/Utils/__tests__/findCurrentRoute.jest.ts b/src/v2/Artsy/Router/Utils/__tests__/findCurrentRoute.jest.ts index e3b7baaffa0..4de6b7df8b5 100644 --- a/src/v2/Artsy/Router/Utils/__tests__/findCurrentRoute.jest.ts +++ b/src/v2/Artsy/Router/Utils/__tests__/findCurrentRoute.jest.ts @@ -1,5 +1,5 @@ import { findCurrentRoute } from "../findCurrentRoute" -import { Match, Router, Location } from "found" +import { Location, Match, Router } from "found" describe("findCurrentRoute", () => { const getMatch = (config: Partial): Match => ({ diff --git a/src/v2/Artsy/Router/Utils/matchingMediaQueriesForUserAgent.ts b/src/v2/Artsy/Router/Utils/matchingMediaQueriesForUserAgent.ts index 1228f8729f8..77ef6b4111a 100644 --- a/src/v2/Artsy/Router/Utils/matchingMediaQueriesForUserAgent.ts +++ b/src/v2/Artsy/Router/Utils/matchingMediaQueriesForUserAgent.ts @@ -1,8 +1,8 @@ import { findDevice } from "@artsy/detect-responsive-traits" import { + MatchingMediaQueries, findBreakpointAtWidth, findBreakpointsForWidths, - MatchingMediaQueries, } from "v2/Utils/Responsive" /** @@ -24,14 +24,14 @@ export function matchingMediaQueriesForUserAgent( const supportsHover = device.touch ? "notHover" : "hover" const onlyMatch: MatchingMediaQueries = device.resizable ? [ - supportsHover, - ...findBreakpointsForWidths(device.minWidth, device.maxWidth), - ] + supportsHover, + ...findBreakpointsForWidths(device.minWidth, device.maxWidth), + ] : [ - supportsHover, - findBreakpointAtWidth(device.minWidth), - findBreakpointAtWidth(device.maxWidth), - ] + supportsHover, + findBreakpointAtWidth(device.minWidth), + findBreakpointAtWidth(device.maxWidth), + ] return onlyMatch } } diff --git a/src/v2/Artsy/Router/Utils/useMaybeReloadAfterInquirySignIn.tsx b/src/v2/Artsy/Router/Utils/useMaybeReloadAfterInquirySignIn.tsx index 567cb841917..8d6e6b70659 100644 --- a/src/v2/Artsy/Router/Utils/useMaybeReloadAfterInquirySignIn.tsx +++ b/src/v2/Artsy/Router/Utils/useMaybeReloadAfterInquirySignIn.tsx @@ -21,5 +21,5 @@ export function useMaybeReloadAfterInquirySignIn() { mediator.off("auth:login:inquiry_form") mediator.off("auth:login:inquiry_form:maybeReloadOnModalClose") } - }, []) + }, [mediator]) } diff --git a/src/v2/Artsy/Router/__tests__/buildServerApp.jest.tsx b/src/v2/Artsy/Router/__tests__/buildServerApp.jest.tsx index 183e0b1d386..aa303e0d61c 100644 --- a/src/v2/Artsy/Router/__tests__/buildServerApp.jest.tsx +++ b/src/v2/Artsy/Router/__tests__/buildServerApp.jest.tsx @@ -5,9 +5,9 @@ import { SystemContextConsumer } from "v2/Artsy" import { createRelaySSREnvironment } from "v2/Artsy/Relay/createRelaySSREnvironment" import { + ServerRouterConfig, __THOU_SHALT_NOT_FAFF_AROUND_WITH_THIS_HERE_OBJECT_WE_ARE_SERIOUS__, buildServerApp, - ServerRouterConfig, } from "v2/Artsy/Router/buildServerApp" import { createMockNetworkLayer } from "v2/DevTools" import { render } from "enzyme" diff --git a/src/v2/Artsy/Router/buildAppRoutes.tsx b/src/v2/Artsy/Router/buildAppRoutes.tsx index b4245673805..9b474f8ef72 100644 --- a/src/v2/Artsy/Router/buildAppRoutes.tsx +++ b/src/v2/Artsy/Router/buildAppRoutes.tsx @@ -35,7 +35,7 @@ export function buildAppRoutes(routeList: RouteList[]): RouteConfig[] { router: props.router, routes, }) - }, []) + }, [props.router, router, setRouter]) return } diff --git a/src/v2/Artsy/Router/useRouter.tsx b/src/v2/Artsy/Router/useRouter.tsx index 86bd017712e..029dc32c18e 100644 --- a/src/v2/Artsy/Router/useRouter.tsx +++ b/src/v2/Artsy/Router/useRouter.tsx @@ -2,7 +2,7 @@ import { useContext } from "react" // FIXME: Upgrade to Found 5.0: https://github.com/4Catalyzer/found/releases/tag/v0.5.0 // @ts-ignore -import { RouterContext, Router, Match } from "found" +import { Match, Router, RouterContext } from "found" export function useRouter(): { match: Match diff --git a/src/v2/Components/ArtistCard.tsx b/src/v2/Components/ArtistCard.tsx index 93326e4443f..de7db0c694b 100644 --- a/src/v2/Components/ArtistCard.tsx +++ b/src/v2/Components/ArtistCard.tsx @@ -18,8 +18,8 @@ import { Link, Sans, Serif, - space, Spacer, + space, } from "@artsy/palette" import styled from "styled-components" diff --git a/src/v2/Components/Artwork/Details.tsx b/src/v2/Components/Artwork/Details.tsx index 6a190df1e04..ac0f2bd4ebb 100644 --- a/src/v2/Components/Artwork/Details.tsx +++ b/src/v2/Components/Artwork/Details.tsx @@ -1,4 +1,4 @@ -import { color, Sans, Spacer } from "@artsy/palette" +import { Sans, Spacer, color } from "@artsy/palette" import { Details_artwork } from "v2/__generated__/Details_artwork.graphql" import { SystemContextConsumer } from "v2/Artsy" import React from "react" @@ -66,8 +66,8 @@ export class Details extends React.Component { const artworkTextWithLink = includeLinks ? ( {artworkText} ) : ( - artworkText - ) + artworkText + ) return {artworkTextWithLink} } diff --git a/src/v2/Components/Artwork/GridItem.tsx b/src/v2/Components/Artwork/GridItem.tsx index 10f3d2daae9..6d1d346a4bb 100644 --- a/src/v2/Components/Artwork/GridItem.tsx +++ b/src/v2/Components/Artwork/GridItem.tsx @@ -1,5 +1,5 @@ import { AuthContextModule, ContextModule } from "@artsy/cohesion" -import { color, Image as BaseImage } from "@artsy/palette" +import { Image as BaseImage, color } from "@artsy/palette" import { GridItem_artwork } from "v2/__generated__/GridItem_artwork.graphql" import { Mediator } from "v2/Artsy" import { withSystemContext } from "v2/Artsy" diff --git a/src/v2/Components/Artwork/Save.tsx b/src/v2/Components/Artwork/Save.tsx index 87f320ce3ba..cab2d3d6943 100644 --- a/src/v2/Components/Artwork/Save.tsx +++ b/src/v2/Components/Artwork/Save.tsx @@ -6,10 +6,10 @@ import { track } from "v2/Artsy/Analytics" import { extend, isNull } from "lodash" import React from "react" import { + RelayProp, commitMutation, createFragmentContainer, graphql, - RelayProp, } from "react-relay" import { TrackingProp } from "react-tracking" import * as RelayRuntimeTypes from "relay-runtime" @@ -26,7 +26,7 @@ export interface SaveTrackingProps { export interface SaveProps extends Artsy.SystemContextProps, - React.HTMLProps { + React.HTMLProps { artwork: Save_artwork contextModule: AuthContextModule style?: any diff --git a/src/v2/Components/Auction/AuctionRegistrationModal.tsx b/src/v2/Components/Auction/AuctionRegistrationModal.tsx index 458d11f10b0..761d644150e 100644 --- a/src/v2/Components/Auction/AuctionRegistrationModal.tsx +++ b/src/v2/Components/Auction/AuctionRegistrationModal.tsx @@ -51,7 +51,7 @@ export const AuctionRegistrationModal: React.FC = ({ if (!show) { onClose() } - }, [show]) + }, [show, onClose]) function validate() { if (acceptedConditions) { @@ -91,11 +91,11 @@ export const AuctionRegistrationModal: React.FC = ({ ) : ( - - Welcome back. To complete your registration, please confirm that you - agree to the Conditions of Sale. - - )} + + Welcome back. To complete your registration, please confirm that you + agree to the Conditions of Sale. + + )} diff --git a/src/v2/Components/Auction/PostRegistrationModal.tsx b/src/v2/Components/Auction/PostRegistrationModal.tsx index 895445aa4f0..34e532c51b3 100644 --- a/src/v2/Components/Auction/PostRegistrationModal.tsx +++ b/src/v2/Components/Auction/PostRegistrationModal.tsx @@ -97,7 +97,7 @@ export const PostRegistrationModal: React.FC = ({ if (!show) { onClose() } - }, [show]) + }, [show, onClose]) const Content = contentFor[contentKey] diff --git a/src/v2/Components/Authentication/FormSwitcher.tsx b/src/v2/Components/Authentication/FormSwitcher.tsx index d43e0f33b18..be2b2d83761 100644 --- a/src/v2/Components/Authentication/FormSwitcher.tsx +++ b/src/v2/Components/Authentication/FormSwitcher.tsx @@ -1,4 +1,4 @@ -import { authImpression, AuthModalType } from "@artsy/cohesion" +import { AuthModalType, authImpression } from "@artsy/cohesion" import { Theme } from "@artsy/palette" import qs from "querystring" import React from "react" @@ -87,8 +87,8 @@ export class FormSwitcher extends React.Component { }, type === "signup" ? { - onboarding: !redirectTo, - } + onboarding: !redirectTo, + } : null ) @@ -166,13 +166,13 @@ export class FormSwitcher extends React.Component { }, options.redirectTo || options["redirect-to"] ? { - "redirect-to": options.redirectTo || options["redirect-to"], - } + "redirect-to": options.redirectTo || options["redirect-to"], + } : null, options.intent ? { - "signup-intent": options.intent, - } + "signup-intent": options.intent, + } : null ) diff --git a/src/v2/Components/Authentication/Mobile/LoginForm.tsx b/src/v2/Components/Authentication/Mobile/LoginForm.tsx index afae5bfcbf8..54ee0d52298 100644 --- a/src/v2/Components/Authentication/Mobile/LoginForm.tsx +++ b/src/v2/Components/Authentication/Mobile/LoginForm.tsx @@ -73,7 +73,7 @@ const OtpInputTrigger: React.FC = props => { props.next(null, values) }) } - }, [status]) + }, [status, isOtpMissing, props, values]) return null } @@ -86,7 +86,7 @@ interface LoginFormState { class MobileLoginFormWithSystemContext extends Component< FormProps & { relayEnvironment: Environment }, LoginFormState - > { +> { constructor(props) { super(props) @@ -149,25 +149,25 @@ class MobileLoginFormWithSystemContext extends Component< wizard, form: { errors, touched, values, handleChange, handleBlur, setTouched }, }) => ( - - - - this.getForgotUrl()} /> - - - )} + + + + this.getForgotUrl()} /> + + + )} , ] @@ -208,7 +208,7 @@ class MobileLoginFormWithSystemContext extends Component< this.props.onBackButtonClicked && - wizard.currentStepIndex === 0 + wizard.currentStepIndex === 0 ? this.props.onBackButtonClicked(e as any) : wizard.previous(e, values) } diff --git a/src/v2/Components/Authentication/__tests__/Desktop/LoginForm.jest.tsx b/src/v2/Components/Authentication/__tests__/Desktop/LoginForm.jest.tsx index 5ebcf60552d..f7d7c29f2ed 100644 --- a/src/v2/Components/Authentication/__tests__/Desktop/LoginForm.jest.tsx +++ b/src/v2/Components/Authentication/__tests__/Desktop/LoginForm.jest.tsx @@ -1,7 +1,7 @@ import { LoginForm } from "v2/Components/Authentication/Desktop/LoginForm" import { mount } from "enzyme" import React from "react" -import { LoginValues, ChangeEvents } from "../fixtures" +import { ChangeEvents, LoginValues } from "../fixtures" import QuickInput from "v2/Components/QuickInput" import { flushPromiseQueue } from "v2/DevTools" diff --git a/src/v2/Components/Authentication/__tests__/Desktop/ModalManager.jest.tsx b/src/v2/Components/Authentication/__tests__/Desktop/ModalManager.jest.tsx index 9b31f984fd7..7d5f84dd1b2 100644 --- a/src/v2/Components/Authentication/__tests__/Desktop/ModalManager.jest.tsx +++ b/src/v2/Components/Authentication/__tests__/Desktop/ModalManager.jest.tsx @@ -1,9 +1,9 @@ import { LoginForm } from "v2/Components/Authentication/Desktop/LoginForm" import { ModalType } from "v2/Components/Authentication/Types" -import { mount, ReactWrapper } from "enzyme" +import { ReactWrapper, mount } from "enzyme" import React from "react" -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { ModalManager, ModalManagerProps, diff --git a/src/v2/Components/Authentication/__tests__/FormSwitcher.jest.tsx b/src/v2/Components/Authentication/__tests__/FormSwitcher.jest.tsx index a86dc4bc4a9..bebeb29eac0 100644 --- a/src/v2/Components/Authentication/__tests__/FormSwitcher.jest.tsx +++ b/src/v2/Components/Authentication/__tests__/FormSwitcher.jest.tsx @@ -1,4 +1,4 @@ -import { Intent, ContextModule } from "@artsy/cohesion" +import { ContextModule, Intent } from "@artsy/cohesion" import { Link } from "@artsy/palette" import QuickInput from "v2/Components/QuickInput" import { mount } from "enzyme" diff --git a/src/v2/Components/CCPARequest.tsx b/src/v2/Components/CCPARequest.tsx index f7c1d129970..a1fa01fd790 100644 --- a/src/v2/Components/CCPARequest.tsx +++ b/src/v2/Components/CCPARequest.tsx @@ -272,7 +272,15 @@ export const CCPARequest: React.SFC = props => { setSubmitted, }) } - }, [clickedSubmit]) + }, [ + clickedSubmit, + email, + name, + notes, + relayEnvironment, + triggeredValidation, + user, + ]) const modalButton = submitted ? (