diff --git a/.babelrc b/.babelrc index b02645ca1..eb6d32d93 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["@babel/preset-env", "@babel/preset-react"], + "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], "plugins": [ ["babel-plugin-wildcard", { "exts": ["json"], "nostrip": true, "noModifyCase": true }], [ diff --git a/.dockerignore b/.dockerignore index 0634d58ed..990a864bc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ .vscode .eslintrc.yml .gitignore -.sass-lint.yml .travis.yml node_modules diff --git a/.eslintrc.yml b/.eslintrc.yml index d3e1924e2..6082a5555 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -11,116 +11,81 @@ ignorePatterns: extends: - 'eslint:recommended' - 'plugin:react/recommended' -parser: '@babel/eslint-parser' + - 'plugin:@typescript-eslint/recommended' # Add TypeScript rules + - 'plugin:import/errors' + - 'plugin:import/warnings' + - 'plugin:import/typescript' # Import plugin with TypeScript support + - 'plugin:jsx-a11y/recommended' + - 'prettier' # If you use Prettier +parser: '@typescript-eslint/parser' # Use the TypeScript parser parserOptions: ecmaFeatures: - experimentalObjectRestSpread: true jsx: true - legacyDecorators: true sourceType: module + project: './tsconfig.json' # Required for full TypeScript support plugins: - react - jsx-a11y - import + - '@typescript-eslint' - simple-import-sort - cypress - - chai-friendly # See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions + - chai-friendly settings: react: version: detect + import/resolver: + typescript: {} + node: + extensions: + - .js + - .jsx + - .ts + - .tsx + paths: + - src rules: + # Base rules linebreak-style: ['error', 'unix'] quotes: ['warn', 'single', { avoidEscape: true }] semi: ['error', 'never'] - import/first: ['warn'] - simple-import-sort/imports: ['error'] - no-else-return: off - no-trailing-spaces: ['warn'] - no-continue: off - no-plusplus: off - radix: off - eol-last: ['warn'] + no-console: ['error'] prefer-const: ['warn'] - no-restricted-globals: ['error', 'event', 'fdescribe'] - no-mixed-operators: ['warn'] - # See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions - no-unused-expressions: 0 - chai-friendly/no-unused-expressions: 2 - # React + curly: ['error'] + import/no-named-as-default-member: ['off'] + + # Import sorting + simple-import-sort/imports: ['error'] + import/first: ['warn'] + + # TypeScript-specific rules + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }] + '@typescript-eslint/no-explicit-any': ['warn'] + '@typescript-eslint/explicit-function-return-type': ['off'] + '@typescript-eslint/no-empty-function': ['warn'] + + # React rules react/display-name: ['warn'] - react/destructuring-assignment: off - react/jsx-indent-props: ['warn', 2] - react/jsx-first-prop-new-line: ['warn'] - react/jsx-closing-bracket-location: ['warn'] - react/jsx-curly-spacing: ['warn'] - react/jsx-tag-spacing: ['warn', { beforeSelfClosing: 'allow' }] - react/jsx-wrap-multilines: ['warn'] - react/no-unused-state: ['warn'] - react/jsx-max-props-per-line: ['warn', { when: 'multiline' }] - react/jsx-closing-tag-location: ['warn'] - react/no-unescaped-entities: ['warn'] - react/no-unused-prop-types: ['warn'] - react/self-closing-comp: ['warn'] react/jsx-indent: ['warn', 2] + react/jsx-max-props-per-line: ['warn', { when: 'multiline' }] react/no-array-index-key: ['warn'] - react/prefer-stateless-function: off - react/forbid-prop-types: off - # JSX + react/prop-types: ['off'] + + # Accessibility rules jsx-a11y/anchor-is-valid: - warn - components: ['Link'] - specialLink: ['To'] - jsx-a11y/alt-text: ['warn'] - jsx-a11y/label-has-for: ['warn'] - jsx-a11y/label-has-associated-control: - - warn - - controlComponents: - - 'Field' - jsx-a11y/click-events-have-key-events: ['warn'] - jsx-a11y/no-static-element-interactions: ['warn'] + specialLink: ['to'] + jsx-a11y/label-has-associated-control: ['warn'] jsx-a11y/media-has-caption: ['warn'] - jsx-a11y/accessible-emoji: ['warn'] - jsx-a11y/anchor-has-content: off - no-console: ['error'] - curly: ['error'] - - # Following rule haves been disabled for compatibility with - # existing code. Some of them should be re-activated in the future. - no-shadow: off - nonblock-statement-body-position: off - object-curly-spacing: off - object-curly-newline: off - object-property-newline: off - comma-dangle: off - function-paren-newline: off - arrow-parens: off - arrow-body-style: off - no-use-before-define: off - no-param-reassign: off - camelcase: off - no-underscore-dangle: off - no-restricted-syntax: off - prefer-destructuring: off - consistent-return: off - class-methods-use-this: off - prefer-promise-reject-errors: off - import/prefer-default-export: off - import/export: off - block-spacing: off - brace-style: off - no-multi-spaces: off - max-len: off # Handled by prettier - # React-specific temporarily disabled rules - react/prop-types: off - react/no-string-refs: off - react/react-in-jsx-scope: off # Generates erros in tests - react/sort-comp: off - react/require-default-props: off - react/jsx-one-expression-per-line: off - react/jsx-no-bind: off + react/no-unescaped-entities: ['warn'] +overrides: + - files: ['**/__tests__/**/*.[jt]s?(x)', '**/*.test.[jt]s?(x)', '**/*.spec.[jt]s?(x)'] + rules: + react/react-in-jsx-scope: 'off' + '@typescript-eslint/no-unused-expressions': 'off' globals: - # For tests snapshot: false snapshotReducer: false snapshotComponent: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 372faa9e5..bbafa046e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,30 @@ jobs: run: CYPRESS_INSTALL_BINARY=0 npm ci - run: npm run prettier:check + typescript: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v3 + with: + node-version-file: '.tool-versions' + cache: 'npm' + - name: Install dependencies + run: CYPRESS_INSTALL_BINARY=0 npm ci + - run: npm run typescript + + unused-exports: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v3 + with: + node-version-file: '.tool-versions' + cache: 'npm' + - name: Install dependencies + run: CYPRESS_INSTALL_BINARY=0 npm ci + - run: npm run ts-unused-exports + test: name: Unit tests runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 8a30e37c5..c329861ac 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ *.swp *.vi *~ -*.sass-cache # OS or Editor folders .DS_Store diff --git a/.sass-lint.yml b/.sass-lint.yml deleted file mode 100644 index 110a25ab8..000000000 --- a/.sass-lint.yml +++ /dev/null @@ -1,95 +0,0 @@ -options: - formatter: stylish -files: - include: '**/*.s+(a|c)ss' -rules: - # Extends - extends-before-mixins: 1 - extends-before-declarations: 1 - placeholder-in-extend: 1 - - # Mixins - mixins-before-declarations: 1 - - # Line Spacing - one-declaration-per-line: 1 - empty-line-between-blocks: 1 - single-line-per-selector: 1 - - # Disallows - no-attribute-selectors: 0 - no-color-hex: 0 - no-color-keywords: 1 - no-color-literals: 1 - no-combinators: 0 - no-css-comments: 1 - no-debug: 1 - no-disallowed-properties: 0 - no-duplicate-properties: 1 - no-empty-rulesets: 1 - no-extends: 0 - no-ids: 1 - no-important: 1 - no-invalid-hex: 1 - no-mergeable-selectors: 1 - no-misspelled-properties: 1 - no-qualifying-elements: 1 - no-trailing-whitespace: 1 - no-trailing-zero: 1 - no-transition-all: 1 - no-universal-selectors: 0 - no-url-domains: 1 - no-url-protocols: 1 - no-vendor-prefixes: 1 - no-warn: 1 - property-units: 0 - - # Nesting - declarations-before-nesting: 1 - force-attribute-nesting: 1 - force-element-nesting: 1 - force-pseudo-nesting: 1 - - # Name Formats - class-name-format: 1 - function-name-format: 1 - id-name-format: 0 - mixin-name-format: 1 - placeholder-name-format: 1 - variable-name-format: 1 - - # Style Guide - attribute-quotes: 1 - bem-depth: 0 - border-zero: 1 - brace-style: 1 - clean-import-paths: 1 - empty-args: 1 - hex-length: 1 - hex-notation: 1 - indentation: 1 - leading-zero: 0 - max-line-length: 0 - max-file-line-count: 0 - nesting-depth: 1 - property-sort-order: 0 - pseudo-element: 1 - quotes: 1 - shorthand-values: 1 - url-quotes: 1 - variable-for-property: 1 - zero-unit: 1 - - # Inner Spacing - space-after-comma: 1 - space-before-colon: 1 - space-after-colon: 1 - space-before-brace: 1 - space-before-bang: 1 - space-after-bang: 1 - space-between-parens: 1 - space-around-operator: 1 - - # Final Items - trailing-semicolon: 1 - final-newline: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b1baa0ccd..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,587 +0,0 @@ -# Change Log - -## [Unreleased](https://github.com/CaptainFact/captain-fact-frontend/tree/HEAD) - -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/1.0.0-staging...HEAD) - -**Implemented enhancements:** - -- Upgrade to react-select v2 [\#198](https://github.com/CaptainFact/captain-fact-frontend/issues/198) - -**Fixed bugs:** - -- Can't write '\<' on speaker name field [\#142](https://github.com/CaptainFact/captain-fact-frontend/issues/142) - -**Merged pull requests:** - -- Show unread notifications count [\#431](https://github.com/CaptainFact/captain-fact-frontend/pull/431) ([Betree](https://github.com/Betree)) -- Fix comment form replies [\#430](https://github.com/CaptainFact/captain-fact-frontend/pull/430) ([Betree](https://github.com/Betree)) -- Edit speaker minor improvements [\#428](https://github.com/CaptainFact/captain-fact-frontend/pull/428) ([Betree](https://github.com/Betree)) -- Fix integration tests and improve CI configuration [\#427](https://github.com/CaptainFact/captain-fact-frontend/pull/427) ([Betree](https://github.com/Betree)) -- chore\(eslint\): Move out from airbnb's config [\#426](https://github.com/CaptainFact/captain-fact-frontend/pull/426) ([Betree](https://github.com/Betree)) -- Autofetch speaker info from Wikidata [\#424](https://github.com/CaptainFact/captain-fact-frontend/pull/424) ([Betree](https://github.com/Betree)) -- chore\(nginx\): Allow for inline css from data: [\#422](https://github.com/CaptainFact/captain-fact-frontend/pull/422) ([Betree](https://github.com/Betree)) -- Improve statements scroll behaviour [\#421](https://github.com/CaptainFact/captain-fact-frontend/pull/421) ([Betree](https://github.com/Betree)) -- Add a fallback page for unexpected errors [\#418](https://github.com/CaptainFact/captain-fact-frontend/pull/418) ([Betree](https://github.com/Betree)) -- Add different background sounds if the statement is refuted or confirmed [\#417](https://github.com/CaptainFact/captain-fact-frontend/pull/417) ([Vayel](https://github.com/Vayel)) -- Add code formatting to pre-commit [\#411](https://github.com/CaptainFact/captain-fact-frontend/pull/411) ([Vayel](https://github.com/Vayel)) -- chore\(deps-dev\): bump babel-eslint from 9.0.0 to 10.0.1 [\#409](https://github.com/CaptainFact/captain-fact-frontend/pull/409) ([dependabot[bot]](https://github.com/apps/dependabot)) - -## [1.0.0-staging](https://github.com/CaptainFact/captain-fact-frontend/tree/1.0.0-staging) (2019-03-29) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/1.0.0...1.0.0-staging) - -## [1.0.0](https://github.com/CaptainFact/captain-fact-frontend/tree/1.0.0) (2019-03-29) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v1.0.0...1.0.0) - -**Merged pull requests:** - -- refactor\(CommentForm\): Use Formik [\#420](https://github.com/CaptainFact/captain-fact-frontend/pull/420) ([Betree](https://github.com/Betree)) -- chore\(deps\): bump dotenv-webpack from 1.5.7 to 1.7.0 [\#408](https://github.com/CaptainFact/captain-fact-frontend/pull/408) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps-dev\): \[security\] bump webpack-dev-server from 3.1.9 to 3.2.1 [\#406](https://github.com/CaptainFact/captain-fact-frontend/pull/406) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump tough-cookie from 2.3.2 to 2.3.4 [\#405](https://github.com/CaptainFact/captain-fact-frontend/pull/405) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump stringstream from 0.0.5 to 0.0.6 [\#403](https://github.com/CaptainFact/captain-fact-frontend/pull/403) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump sshpk from 1.13.1 to 1.16.1 [\#402](https://github.com/CaptainFact/captain-fact-frontend/pull/402) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps-dev\): bump copy-webpack-plugin from 5.0.0 to 5.0.1 [\#401](https://github.com/CaptainFact/captain-fact-frontend/pull/401) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): bump react-redux from 5.0.7 to 5.1.1 [\#400](https://github.com/CaptainFact/captain-fact-frontend/pull/400) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump https-proxy-agent from 2.0.0 to 2.2.1 [\#399](https://github.com/CaptainFact/captain-fact-frontend/pull/399) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump http-proxy-agent from 2.0.0 to 2.1.0 [\#398](https://github.com/CaptainFact/captain-fact-frontend/pull/398) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore: Remove Greenkeeper \(replaced by dependabot\) [\#397](https://github.com/CaptainFact/captain-fact-frontend/pull/397) ([Betree](https://github.com/Betree)) -- chore\(deps\): \[security\] bump merge from 1.2.0 to 1.2.1 [\#396](https://github.com/CaptainFact/captain-fact-frontend/pull/396) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump extend from 3.0.1 to 3.0.2 [\#394](https://github.com/CaptainFact/captain-fact-frontend/pull/394) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): bump phoenix from 1.4.1 to 1.4.2 [\#393](https://github.com/CaptainFact/captain-fact-frontend/pull/393) ([dependabot[bot]](https://github.com/apps/dependabot)) -- chore\(deps\): \[security\] bump debug from 2.6.8 to 2.6.9 [\#392](https://github.com/CaptainFact/captain-fact-frontend/pull/392) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Fix NavBar and notifications popup responsiveness [\#391](https://github.com/CaptainFact/captain-fact-frontend/pull/391) ([Betree](https://github.com/Betree)) -- Clearly display speaker title max length [\#390](https://github.com/CaptainFact/captain-fact-frontend/pull/390) ([Vayel](https://github.com/Vayel)) -- Greenkeeper/monorepo.babel7 20190319223643 [\#389](https://github.com/CaptainFact/captain-fact-frontend/pull/389) ([Betree](https://github.com/Betree)) -- Limit speakers list length in video card [\#378](https://github.com/CaptainFact/captain-fact-frontend/pull/378) ([Vayel](https://github.com/Vayel)) -- Greenkeeper/polished 3.0.3 [\#371](https://github.com/CaptainFact/captain-fact-frontend/pull/371) ([Betree](https://github.com/Betree)) -- Try another message for the home page [\#353](https://github.com/CaptainFact/captain-fact-frontend/pull/353) ([Betree](https://github.com/Betree)) - -## [v1.0.0](https://github.com/CaptainFact/captain-fact-frontend/tree/v1.0.0) (2019-03-19) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.9.4...v1.0.0) - -**Merged pull requests:** - -- Release 1.0.0 [\#381](https://github.com/CaptainFact/captain-fact-frontend/pull/381) ([Betree](https://github.com/Betree)) -- fix\(SubscriptionsPage\): Use network-only fetch policy [\#380](https://github.com/CaptainFact/captain-fact-frontend/pull/380) ([Betree](https://github.com/Betree)) -- Automatically fill new statement speaker if there is only one [\#377](https://github.com/CaptainFact/captain-fact-frontend/pull/377) ([Vayel](https://github.com/Vayel)) -- Greenkeeper/prop types 15.7.2 [\#372](https://github.com/CaptainFact/captain-fact-frontend/pull/372) ([Betree](https://github.com/Betree)) -- Update copy-webpack-plugin to the latest version 🚀 [\#363](https://github.com/CaptainFact/captain-fact-frontend/pull/363) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update phoenix to the latest version 🚀 [\#358](https://github.com/CaptainFact/captain-fact-frontend/pull/358) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Fix authentication issue when local token has expired [\#350](https://github.com/CaptainFact/captain-fact-frontend/pull/350) ([Betree](https://github.com/Betree)) -- Redirect to previous page once logged in [\#348](https://github.com/CaptainFact/captain-fact-frontend/pull/348) ([Ge0](https://github.com/Ge0)) -- Notifications [\#331](https://github.com/CaptainFact/captain-fact-frontend/pull/331) ([Betree](https://github.com/Betree)) - -## [v0.9.4](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.9.4) (2019-01-05) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.9.3...v0.9.4) - -**Merged pull requests:** - -- Release 0.9.4 [\#347](https://github.com/CaptainFact/captain-fact-frontend/pull/347) ([Betree](https://github.com/Betree)) -- Ability for users to add unlisted videos [\#345](https://github.com/CaptainFact/captain-fact-frontend/pull/345) ([Betree](https://github.com/Betree)) -- fix\(Moderation\): No more crashing when there's something to moderate [\#344](https://github.com/CaptainFact/captain-fact-frontend/pull/344) ([Betree](https://github.com/Betree)) -- chore\(ActivityLog\): Add translations for banned comments [\#343](https://github.com/CaptainFact/captain-fact-frontend/pull/343) ([Betree](https://github.com/Betree)) -- Greenkeeper/react i18next 9.0.1 [\#342](https://github.com/CaptainFact/captain-fact-frontend/pull/342) ([Betree](https://github.com/Betree)) -- Greenkeeper/file loader 3.0.1 [\#341](https://github.com/CaptainFact/captain-fact-frontend/pull/341) ([Betree](https://github.com/Betree)) -- chore\(Help\): Fix typo on privileges page [\#340](https://github.com/CaptainFact/captain-fact-frontend/pull/340) ([Betree](https://github.com/Betree)) -- chore\(Limitations\): Change message when limitation is reached [\#339](https://github.com/CaptainFact/captain-fact-frontend/pull/339) ([Betree](https://github.com/Betree)) -- Update styled-system to the latest version 🚀 [\#338](https://github.com/CaptainFact/captain-fact-frontend/pull/338) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update i18next to the latest version 🚀 [\#337](https://github.com/CaptainFact/captain-fact-frontend/pull/337) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Move logged in user to react context [\#330](https://github.com/CaptainFact/captain-fact-frontend/pull/330) ([Betree](https://github.com/Betree)) -- Change speaker icon from buddy to microphone [\#327](https://github.com/CaptainFact/captain-fact-frontend/pull/327) ([Betree](https://github.com/Betree)) -- Update react to the latest version 🚀 [\#323](https://github.com/CaptainFact/captain-fact-frontend/pull/323) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.9.3](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.9.3) (2018-12-20) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.9.2...v0.9.3) - -**Merged pull requests:** - -- Release 0.9.3 [\#326](https://github.com/CaptainFact/captain-fact-frontend/pull/326) ([Betree](https://github.com/Betree)) -- Timecodes shifting is now specific to video provider [\#322](https://github.com/CaptainFact/captain-fact-frontend/pull/322) ([Betree](https://github.com/Betree)) -- Don't try to translate speakers title [\#321](https://github.com/CaptainFact/captain-fact-frontend/pull/321) ([Betree](https://github.com/Betree)) -- Update react-player to the latest version 🚀 [\#320](https://github.com/CaptainFact/captain-fact-frontend/pull/320) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Fix missing close icon on modals [\#319](https://github.com/CaptainFact/captain-fact-frontend/pull/319) ([Betree](https://github.com/Betree)) -- Improve error message when video creation fails [\#318](https://github.com/CaptainFact/captain-fact-frontend/pull/318) ([Betree](https://github.com/Betree)) -- Update core-js to the latest version 🚀 [\#317](https://github.com/CaptainFact/captain-fact-frontend/pull/317) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update i18next to the latest version 🚀 [\#316](https://github.com/CaptainFact/captain-fact-frontend/pull/316) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update react-apollo to the latest version 🚀 [\#315](https://github.com/CaptainFact/captain-fact-frontend/pull/315) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update react-i18next to the latest version 🚀 [\#314](https://github.com/CaptainFact/captain-fact-frontend/pull/314) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update styled-icons to the latest version 🚀 [\#312](https://github.com/CaptainFact/captain-fact-frontend/pull/312) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.9.2](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.9.2) (2018-12-09) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.9.1...v0.9.2) - -**Fixed bugs:** - -- Next page nav button is disabled on https://captainfact.io/videos [\#306](https://github.com/CaptainFact/captain-fact-frontend/issues/306) -- ReferenceError: Can't find variable: Audio [\#303](https://github.com/CaptainFact/captain-fact-frontend/issues/303) -- \[iOS / Firefox\] Closing fullscreen makes video disappear [\#210](https://github.com/CaptainFact/captain-fact-frontend/issues/210) -- Application crash on loading with Safari Mobile for iOS 10.3.2 [\#152](https://github.com/CaptainFact/captain-fact-frontend/issues/152) -- Content Security Policy [\#112](https://github.com/CaptainFact/captain-fact-frontend/issues/112) - -**Closed issues:** - -- An in-range update of webpack is breaking the build 🚨 [\#300](https://github.com/CaptainFact/captain-fact-frontend/issues/300) -- New gif demo for "Browser extension" page [\#297](https://github.com/CaptainFact/captain-fact-frontend/issues/297) -- An in-range update of react is breaking the build 🚨 [\#267](https://github.com/CaptainFact/captain-fact-frontend/issues/267) -- Firefox inline extension install [\#250](https://github.com/CaptainFact/captain-fact-frontend/issues/250) - -**Merged pull requests:** - -- Release 0.9.2 [\#310](https://github.com/CaptainFact/captain-fact-frontend/pull/310) ([Betree](https://github.com/Betree)) -- Update Babel to v7 [\#309](https://github.com/CaptainFact/captain-fact-frontend/pull/309) ([Betree](https://github.com/Betree)) -- Fix dependencies minor versions [\#308](https://github.com/CaptainFact/captain-fact-frontend/pull/308) ([Betree](https://github.com/Betree)) -- Ignore Matomo errors [\#307](https://github.com/CaptainFact/captain-fact-frontend/pull/307) ([Betree](https://github.com/Betree)) -- Update css-loader to the latest version 🚀 [\#305](https://github.com/CaptainFact/captain-fact-frontend/pull/305) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update mini-css-extract-plugin to the latest version 🚀 [\#304](https://github.com/CaptainFact/captain-fact-frontend/pull/304) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- \[Travis\] No need to run test when pushing on master [\#299](https://github.com/CaptainFact/captain-fact-frontend/pull/299) ([Betree](https://github.com/Betree)) -- Browser extension page [\#298](https://github.com/CaptainFact/captain-fact-frontend/pull/298) ([Betree](https://github.com/Betree)) -- Update ambassadors help page [\#295](https://github.com/CaptainFact/captain-fact-frontend/pull/295) ([Betree](https://github.com/Betree)) - -## [v0.9.1](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.9.1) (2018-12-01) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.9.0...v0.9.1) - -**Fixed bugs:** - -- Error doesn't flash when reaching limitation on user info edition [\#126](https://github.com/CaptainFact/captain-fact-frontend/issues/126) -- \[Safari\] Intempestive appearing/disappearing scroll-bar on mouse-over event on video module [\#80](https://github.com/CaptainFact/captain-fact-frontend/issues/80) - -**Merged pull requests:** - -- Release 0.9.1 [\#296](https://github.com/CaptainFact/captain-fact-frontend/pull/296) ([Betree](https://github.com/Betree)) -- \[Homepage redesign\] Add social profiles icons with styled-components / styled-icons [\#294](https://github.com/CaptainFact/captain-fact-frontend/pull/294) ([Betree](https://github.com/Betree)) -- Redesign homepage [\#292](https://github.com/CaptainFact/captain-fact-frontend/pull/292) ([Betree](https://github.com/Betree)) -- Remove feathub from README, remove CONTRIBUTING.md [\#290](https://github.com/CaptainFact/captain-fact-frontend/pull/290) ([Betree](https://github.com/Betree)) -- Prettier: Set max to 90 columns [\#289](https://github.com/CaptainFact/captain-fact-frontend/pull/289) ([Betree](https://github.com/Betree)) -- Add information to privacy policy [\#288](https://github.com/CaptainFact/captain-fact-frontend/pull/288) ([Betree](https://github.com/Betree)) -- Run prettier on the code [\#287](https://github.com/CaptainFact/captain-fact-frontend/pull/287) ([Betree](https://github.com/Betree)) -- Add Matomo script with opt-out checkbox in user settings [\#286](https://github.com/CaptainFact/captain-fact-frontend/pull/286) ([Betree](https://github.com/Betree)) -- Release 0.9 [\#276](https://github.com/CaptainFact/captain-fact-frontend/pull/276) ([Betree](https://github.com/Betree)) - -## [v0.9.0](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.9.0) (2018-11-23) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.17...v0.9.0) - -**Fixed bugs:** - -- Video pauses when clicking on time-change links [\#230](https://github.com/CaptainFact/captain-fact-frontend/issues/230) - -**Closed issues:** - -- Notify user when a new statement is focused in background [\#269](https://github.com/CaptainFact/captain-fact-frontend/issues/269) -- An in-range update of validator is breaking the build 🚨 [\#258](https://github.com/CaptainFact/captain-fact-frontend/issues/258) -- An in-range update of reactjs-popup is breaking the build 🚨 [\#251](https://github.com/CaptainFact/captain-fact-frontend/issues/251) -- An in-range update of redux-actions is breaking the build 🚨 [\#235](https://github.com/CaptainFact/captain-fact-frontend/issues/235) - -**Merged pull requests:** - -- Minor improvements before release [\#278](https://github.com/CaptainFact/captain-fact-frontend/pull/278) ([Betree](https://github.com/Betree)) -- Fix browser locale when locale is not supported [\#277](https://github.com/CaptainFact/captain-fact-frontend/pull/277) ([Betree](https://github.com/Betree)) -- Reduce sidebar width by 30px [\#275](https://github.com/CaptainFact/captain-fact-frontend/pull/275) ([Betree](https://github.com/Betree)) -- Minor improvements [\#274](https://github.com/CaptainFact/captain-fact-frontend/pull/274) ([Betree](https://github.com/Betree)) -- Notify user when a new statement is focused in background [\#273](https://github.com/CaptainFact/captain-fact-frontend/pull/273) ([Betree](https://github.com/Betree)) -- Fix a crash when trying to reply to a comment made by a deleted user [\#272](https://github.com/CaptainFact/captain-fact-frontend/pull/272) ([Betree](https://github.com/Betree)) -- Update lint-staged to the latest version 🚀 [\#271](https://github.com/CaptainFact/captain-fact-frontend/pull/271) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update contribution guidelines [\#270](https://github.com/CaptainFact/captain-fact-frontend/pull/270) ([Miragide](https://github.com/Miragide)) -- Update clean-webpack-plugin to the latest version 🚀 [\#265](https://github.com/CaptainFact/captain-fact-frontend/pull/265) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Greenkeeper/redux actions 2.6.4 [\#264](https://github.com/CaptainFact/captain-fact-frontend/pull/264) ([Betree](https://github.com/Betree)) -- Greenkeeper/reactjs popup 1.3.1 [\#263](https://github.com/CaptainFact/captain-fact-frontend/pull/263) ([Betree](https://github.com/Betree)) -- chore: pin validator to 10.8.0 [\#261](https://github.com/CaptainFact/captain-fact-frontend/pull/261) ([Betree](https://github.com/Betree)) -- Fix video pauses when clicking on time-change links [\#260](https://github.com/CaptainFact/captain-fact-frontend/pull/260) ([Betree](https://github.com/Betree)) -- Add jobs service to docker-compose [\#257](https://github.com/CaptainFact/captain-fact-frontend/pull/257) ([Betree](https://github.com/Betree)) -- User action: action type and entity as string values. [\#255](https://github.com/CaptainFact/captain-fact-frontend/pull/255) ([Betree](https://github.com/Betree)) - -## [v0.8.17](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.17) (2018-11-01) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.16...v0.8.17) - -**Fixed bugs:** - -- Pagination menu is broken when the number of pages is between 4 and 5 [\#215](https://github.com/CaptainFact/captain-fact-frontend/issues/215) - -**Closed issues:** - -- Ability to login using email or username alike [\#234](https://github.com/CaptainFact/captain-fact-frontend/issues/234) - -**Merged pull requests:** - -- Release 0.8.17 [\#254](https://github.com/CaptainFact/captain-fact-frontend/pull/254) ([Betree](https://github.com/Betree)) -- Integrate rollabar [\#253](https://github.com/CaptainFact/captain-fact-frontend/pull/253) ([Betree](https://github.com/Betree)) -- Fix pagination broken behaviour [\#252](https://github.com/CaptainFact/captain-fact-frontend/pull/252) ([Betree](https://github.com/Betree)) -- Add YesWeHack to partners [\#243](https://github.com/CaptainFact/captain-fact-frontend/pull/243) ([Betree](https://github.com/Betree)) -- Add end-to-end testing with Cypress [\#242](https://github.com/CaptainFact/captain-fact-frontend/pull/242) ([Betree](https://github.com/Betree)) -- Use Merryweather font for logo [\#241](https://github.com/CaptainFact/captain-fact-frontend/pull/241) ([Betree](https://github.com/Betree)) -- Move static assets out of `app/assets` to `app/static` [\#240](https://github.com/CaptainFact/captain-fact-frontend/pull/240) ([Betree](https://github.com/Betree)) -- Remove non-implemented third parties from login / signup [\#239](https://github.com/CaptainFact/captain-fact-frontend/pull/239) ([Betree](https://github.com/Betree)) -- Add ability to login using email or username alike [\#238](https://github.com/CaptainFact/captain-fact-frontend/pull/238) ([Betree](https://github.com/Betree)) -- Add API source code repo URL to help pages [\#237](https://github.com/CaptainFact/captain-fact-frontend/pull/237) ([Betree](https://github.com/Betree)) -- Update i18next to the latest version 🚀 [\#236](https://github.com/CaptainFact/captain-fact-frontend/pull/236) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.8.16](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.16) (2018-10-17) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.14...v0.8.16) - -**Implemented enhancements:** - -- Improve build scripts [\#218](https://github.com/CaptainFact/captain-fact-frontend/pull/218) ([naomiHauret](https://github.com/naomiHauret)) -- More reputation tooltips [\#199](https://github.com/CaptainFact/captain-fact-frontend/pull/199) ([Betree](https://github.com/Betree)) -- Store Q letter in wikidata\_item\_id + Disable speakers validation feature [\#192](https://github.com/CaptainFact/captain-fact-frontend/pull/192) ([Betree](https://github.com/Betree)) - -**Fixed bugs:** - -- \[IE11\] Doesn't work \(missing Object.includes polyfill\) [\#196](https://github.com/CaptainFact/captain-fact-frontend/issues/196) -- Fix flagged comment display [\#206](https://github.com/CaptainFact/captain-fact-frontend/pull/206) ([Betree](https://github.com/Betree)) - -**Merged pull requests:** - -- Release 0.8.16 [\#229](https://github.com/CaptainFact/captain-fact-frontend/pull/229) ([Betree](https://github.com/Betree)) -- Add Greenkeeper badge 🌴 [\#228](https://github.com/CaptainFact/captain-fact-frontend/pull/228) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies and fix linting issues [\#226](https://github.com/CaptainFact/captain-fact-frontend/pull/226) ([Betree](https://github.com/Betree)) -- Improve build and npm scripts [\#224](https://github.com/CaptainFact/captain-fact-frontend/pull/224) ([Betree](https://github.com/Betree)) -- Update dev API start instructions [\#222](https://github.com/CaptainFact/captain-fact-frontend/pull/222) ([Betree](https://github.com/Betree)) -- Add UT for video-debate/video/reducer [\#221](https://github.com/CaptainFact/captain-fact-frontend/pull/221) ([FacuRossi](https://github.com/FacuRossi)) -- Bugfix/ie11 missing object includes polyfill [\#220](https://github.com/CaptainFact/captain-fact-frontend/pull/220) ([MaitreManuel](https://github.com/MaitreManuel)) -- Fix a bug with speaker page infinite loop when changing the speaker [\#214](https://github.com/CaptainFact/captain-fact-frontend/pull/214) ([Betree](https://github.com/Betree)) -- Fix crash when API was not reachable on videos page [\#213](https://github.com/CaptainFact/captain-fact-frontend/pull/213) ([Betree](https://github.com/Betree)) -- Videos list pagination [\#212](https://github.com/CaptainFact/captain-fact-frontend/pull/212) ([Betree](https://github.com/Betree)) -- Import logos in JS to have them bundled [\#211](https://github.com/CaptainFact/captain-fact-frontend/pull/211) ([Betree](https://github.com/Betree)) -- Release 0.8.15 [\#209](https://github.com/CaptainFact/captain-fact-frontend/pull/209) ([Betree](https://github.com/Betree)) -- Add "La Tronche en biais" and new contributors to homepage [\#208](https://github.com/CaptainFact/captain-fact-frontend/pull/208) ([Betree](https://github.com/Betree)) -- Refactor FormUtils and CommentForm [\#204](https://github.com/CaptainFact/captain-fact-frontend/pull/204) ([Betree](https://github.com/Betree)) -- Use new action model and add links to comments and statements in history [\#203](https://github.com/CaptainFact/captain-fact-frontend/pull/203) ([Betree](https://github.com/Betree)) -- Fix a crash that was occuring when deleting speaker with self-comments [\#202](https://github.com/CaptainFact/captain-fact-frontend/pull/202) ([Betree](https://github.com/Betree)) -- Use replace to change URL in history when redirecting on speaker page [\#201](https://github.com/CaptainFact/captain-fact-frontend/pull/201) ([Betree](https://github.com/Betree)) -- Use new video hash\_id field [\#200](https://github.com/CaptainFact/captain-fact-frontend/pull/200) ([Betree](https://github.com/Betree)) - -## [v0.8.14](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.14) (2018-08-18) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.13...v0.8.14) - -**Implemented enhancements:** - -- Make homepage statistics dynamic [\#193](https://github.com/CaptainFact/captain-fact-frontend/pull/193) ([Betree](https://github.com/Betree)) -- Mobile menu that looks like a real mobile menu [\#191](https://github.com/CaptainFact/captain-fact-frontend/pull/191) ([Betree](https://github.com/Betree)) -- Update dependencies [\#189](https://github.com/CaptainFact/captain-fact-frontend/pull/189) ([Betree](https://github.com/Betree)) -- Move LanguageSelector up in sidebar and add it to settings page [\#187](https://github.com/CaptainFact/captain-fact-frontend/pull/187) ([Betree](https://github.com/Betree)) -- Reduce username margin-bottom and fix icon width when collapsed [\#186](https://github.com/CaptainFact/captain-fact-frontend/pull/186) ([Betree](https://github.com/Betree)) -- Fix help page colors and add missing translation [\#185](https://github.com/CaptainFact/captain-fact-frontend/pull/185) ([Betree](https://github.com/Betree)) -- Add type="email" on email fields [\#184](https://github.com/CaptainFact/captain-fact-frontend/pull/184) ([Betree](https://github.com/Betree)) -- Use external link icon on speaker's page wiki links [\#182](https://github.com/CaptainFact/captain-fact-frontend/pull/182) ([Betree](https://github.com/Betree)) -- Add discord bot to OpenGraph user agents [\#178](https://github.com/CaptainFact/captain-fact-frontend/pull/178) ([Betree](https://github.com/Betree)) - -**Fixed bugs:** - -- Publishers : show `unlimited` \(or nothing\) instead of `-1` for number of available flags [\#144](https://github.com/CaptainFact/captain-fact-frontend/issues/144) -- Fix display bug with self-sourcing on small devices [\#188](https://github.com/CaptainFact/captain-fact-frontend/pull/188) ([Betree](https://github.com/Betree)) - -**Merged pull requests:** - -- Release 0.8.14 [\#195](https://github.com/CaptainFact/captain-fact-frontend/pull/195) ([Betree](https://github.com/Betree)) -- Add `Artist` and `GoodVibes` achievements [\#194](https://github.com/CaptainFact/captain-fact-frontend/pull/194) ([Betree](https://github.com/Betree)) -- Tooltip on AddVideo when not enough reputation [\#190](https://github.com/CaptainFact/captain-fact-frontend/pull/190) ([Betree](https://github.com/Betree)) -- Refactor CommentDisplay and CommentsContainer \(now CommentsList\) [\#183](https://github.com/CaptainFact/captain-fact-frontend/pull/183) ([Betree](https://github.com/Betree)) -- Fix typo [\#181](https://github.com/CaptainFact/captain-fact-frontend/pull/181) ([Betree](https://github.com/Betree)) -- Don's show flags limit if no limit [\#180](https://github.com/CaptainFact/captain-fact-frontend/pull/180) ([Betree](https://github.com/Betree)) -- Feature/activity log [\#179](https://github.com/CaptainFact/captain-fact-frontend/pull/179) ([Betree](https://github.com/Betree)) -- Bold text + colorful icon on partner's video cards [\#177](https://github.com/CaptainFact/captain-fact-frontend/pull/177) ([Betree](https://github.com/Betree)) - -## [v0.8.13](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.13) (2018-08-05) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.12...v0.8.13) - -**Implemented enhancements:** - -- Homepage re-design + update colors [\#174](https://github.com/CaptainFact/captain-fact-frontend/pull/174) ([Betree](https://github.com/Betree)) -- Make comment's actions more visible [\#165](https://github.com/CaptainFact/captain-fact-frontend/pull/165) ([Betree](https://github.com/Betree)) - -**Merged pull requests:** - -- Release 0.8.13 [\#175](https://github.com/CaptainFact/captain-fact-frontend/pull/175) ([Betree](https://github.com/Betree)) -- Increase max comment length to 512 [\#173](https://github.com/CaptainFact/captain-fact-frontend/pull/173) ([Betree](https://github.com/Betree)) -- Speaker Route now insensitive [\#172](https://github.com/CaptainFact/captain-fact-frontend/pull/172) ([julien-leclercq](https://github.com/julien-leclercq)) -- Fix tests config for invitation system [\#171](https://github.com/CaptainFact/captain-fact-frontend/pull/171) ([Betree](https://github.com/Betree)) -- Clarify documentation [\#169](https://github.com/CaptainFact/captain-fact-frontend/pull/169) ([Manu1400](https://github.com/Manu1400)) -- add missing translate [\#168](https://github.com/CaptainFact/captain-fact-frontend/pull/168) ([Manu1400](https://github.com/Manu1400)) -- Change minimum reputation to add video at 75 [\#167](https://github.com/CaptainFact/captain-fact-frontend/pull/167) ([Betree](https://github.com/Betree)) -- Update logo and homepage [\#166](https://github.com/CaptainFact/captain-fact-frontend/pull/166) ([Betree](https://github.com/Betree)) -- Allow null comment user \(anonymous\) [\#164](https://github.com/CaptainFact/captain-fact-frontend/pull/164) ([Betree](https://github.com/Betree)) -- Remove chrome scrollbar customization [\#162](https://github.com/CaptainFact/captain-fact-frontend/pull/162) ([Betree](https://github.com/Betree)) -- Change demo video on extension page [\#161](https://github.com/CaptainFact/captain-fact-frontend/pull/161) ([Betree](https://github.com/Betree)) -- Make invitation system optionnal by using build variables [\#160](https://github.com/CaptainFact/captain-fact-frontend/pull/160) ([Betree](https://github.com/Betree)) -- Improve UX on homepage and help [\#158](https://github.com/CaptainFact/captain-fact-frontend/pull/158) ([Betree](https://github.com/Betree)) -- Update NGinx conf with internal OpenGraph service URL [\#157](https://github.com/CaptainFact/captain-fact-frontend/pull/157) ([Betree](https://github.com/Betree)) - -## [v0.8.12](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.12) (2018-07-19) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.11...v0.8.12) - -**Fixed bugs:** - -- Chat button double right border [\#148](https://github.com/CaptainFact/captain-fact-frontend/issues/148) - -**Merged pull requests:** - -- Add video form: Accept url as URL param \(/videos/add?url=xxx\) [\#155](https://github.com/CaptainFact/captain-fact-frontend/pull/155) ([Betree](https://github.com/Betree)) -- Release 0.8.12 [\#154](https://github.com/CaptainFact/captain-fact-frontend/pull/154) ([Betree](https://github.com/Betree)) -- Show if video was added by a partner / user on video card [\#153](https://github.com/CaptainFact/captain-fact-frontend/pull/153) ([Betree](https://github.com/Betree)) -- Fix chat button right border [\#151](https://github.com/CaptainFact/captain-fact-frontend/pull/151) ([Betree](https://github.com/Betree)) -- Update dependencies [\#150](https://github.com/CaptainFact/captain-fact-frontend/pull/150) ([Betree](https://github.com/Betree)) -- French/English translation fixes [\#149](https://github.com/CaptainFact/captain-fact-frontend/pull/149) ([Spidersouris](https://github.com/Spidersouris)) -- refine videos filters [\#147](https://github.com/CaptainFact/captain-fact-frontend/pull/147) ([julien-leclercq](https://github.com/julien-leclercq)) -- Add store snapshot testing for modals and help [\#146](https://github.com/CaptainFact/captain-fact-frontend/pull/146) ([Betree](https://github.com/Betree)) -- Update limitations + help pages [\#145](https://github.com/CaptainFact/captain-fact-frontend/pull/145) ([Betree](https://github.com/Betree)) -- Minor improvements to release + script to check nginx config [\#141](https://github.com/CaptainFact/captain-fact-frontend/pull/141) ([Betree](https://github.com/Betree)) -- NGinx config for opengraph application [\#140](https://github.com/CaptainFact/captain-fact-frontend/pull/140) ([julien-leclercq](https://github.com/julien-leclercq)) -- Basic minify of HTML in production \(doesn't strip comments\) [\#138](https://github.com/CaptainFact/captain-fact-frontend/pull/138) ([Betree](https://github.com/Betree)) - -## [v0.8.11](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.11) (2018-06-22) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.10...v0.8.11) - -**Fixed bugs:** - -- Show SpeakerForm if user is publisher \(even without needed reputation\) [\#134](https://github.com/CaptainFact/captain-fact-frontend/pull/134) ([Betree](https://github.com/Betree)) -- Fix unwanted scrollbar on speaker's name for Windows [\#133](https://github.com/CaptainFact/captain-fact-frontend/pull/133) ([Betree](https://github.com/Betree)) - -**Merged pull requests:** - -- Release 0.8.11 [\#137](https://github.com/CaptainFact/captain-fact-frontend/pull/137) ([Betree](https://github.com/Betree)) -- Allways allow publishers in ReputationGuard [\#136](https://github.com/CaptainFact/captain-fact-frontend/pull/136) ([Betree](https://github.com/Betree)) -- Add icons for "Community" and "Speaker" headers [\#135](https://github.com/CaptainFact/captain-fact-frontend/pull/135) ([Betree](https://github.com/Betree)) -- Self-sourcing [\#132](https://github.com/CaptainFact/captain-fact-frontend/pull/132) ([Betree](https://github.com/Betree)) -- Release 0.8.11 [\#130](https://github.com/CaptainFact/captain-fact-frontend/pull/130) ([Betree](https://github.com/Betree)) -- Use a lighter font-weight on first part of logo [\#129](https://github.com/CaptainFact/captain-fact-frontend/pull/129) ([Betree](https://github.com/Betree)) -- Replace "Contact Us" by "Support Us" in sidebar [\#128](https://github.com/CaptainFact/captain-fact-frontend/pull/128) ([Betree](https://github.com/Betree)) - -## [v0.8.10](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.10) (2018-05-18) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.7...v0.8.10) - -**Fixed bugs:** - -- Fonts and other assets are not included in build with new webpack build [\#117](https://github.com/CaptainFact/captain-fact-frontend/issues/117) - -**Closed issues:** - -- Sass styles hot reload [\#119](https://github.com/CaptainFact/captain-fact-frontend/issues/119) - -**Merged pull requests:** - -- Release 0.8.10 [\#125](https://github.com/CaptainFact/captain-fact-frontend/pull/125) ([Betree](https://github.com/Betree)) -- Add filter for partners videos [\#124](https://github.com/CaptainFact/captain-fact-frontend/pull/124) ([Betree](https://github.com/Betree)) -- Eslint enforcement [\#123](https://github.com/CaptainFact/captain-fact-frontend/pull/123) ([Betree](https://github.com/Betree)) -- Allow 255 characters length for comments and statements [\#122](https://github.com/CaptainFact/captain-fact-frontend/pull/122) ([Betree](https://github.com/Betree)) -- Add Ambassadors Discord link to help pages [\#121](https://github.com/CaptainFact/captain-fact-frontend/pull/121) ([Betree](https://github.com/Betree)) -- \[Webpack\] SASS hot reload + CSS minify [\#120](https://github.com/CaptainFact/captain-fact-frontend/pull/120) ([Betree](https://github.com/Betree)) -- Fixed \#117 : Fonts and other assets are not included in build with new webpack build [\#118](https://github.com/CaptainFact/captain-fact-frontend/pull/118) ([NGambini](https://github.com/NGambini)) -- Update dependencies [\#116](https://github.com/CaptainFact/captain-fact-frontend/pull/116) ([Betree](https://github.com/Betree)) -- Add security.txt - see http://securitytxt.org for more info [\#115](https://github.com/CaptainFact/captain-fact-frontend/pull/115) ([Betree](https://github.com/Betree)) -- Add discord link to verification Inteface [\#114](https://github.com/CaptainFact/captain-fact-frontend/pull/114) ([Betree](https://github.com/Betree)) -- Improvement/webpack [\#113](https://github.com/CaptainFact/captain-fact-frontend/pull/113) ([NGambini](https://github.com/NGambini)) - -## [v0.8.7](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.7) (2018-04-13) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.6...v0.8.7) - -**Merged pull requests:** - -- Release 0.8.7 [\#111](https://github.com/CaptainFact/captain-fact-frontend/pull/111) ([Betree](https://github.com/Betree)) -- Improve responsiveness on multiple pages and slightly re-style user page [\#110](https://github.com/CaptainFact/captain-fact-frontend/pull/110) ([Betree](https://github.com/Betree)) -- New flags types, display reported comments, moderation re-design, update help pages [\#109](https://github.com/CaptainFact/captain-fact-frontend/pull/109) ([Betree](https://github.com/Betree)) -- add username/name in User page title [\#107](https://github.com/CaptainFact/captain-fact-frontend/pull/107) ([najeal](https://github.com/najeal)) - -## [v0.8.6](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.6) (2018-03-26) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.3...v0.8.6) - -**Fixed bugs:** - -- Last react-player version breaks live videos timecodes [\#91](https://github.com/CaptainFact/captain-fact-frontend/issues/91) -- Forcing video position changes sound volume [\#88](https://github.com/CaptainFact/captain-fact-frontend/issues/88) -- \[Chrome\] Videos embed in comments fullscreen bug [\#81](https://github.com/CaptainFact/captain-fact-frontend/issues/81) - -**Closed issues:** - -- Speakers list [\#57](https://github.com/CaptainFact/captain-fact-frontend/issues/57) -- Ability to offer and receive reputation bounties to verify statements [\#29](https://github.com/CaptainFact/captain-fact-frontend/issues/29) - -**Merged pull requests:** - -- Release 0.8.6 [\#106](https://github.com/CaptainFact/captain-fact-frontend/pull/106) ([Betree](https://github.com/Betree)) -- Misc styles update [\#105](https://github.com/CaptainFact/captain-fact-frontend/pull/105) ([Betree](https://github.com/Betree)) -- Staging [\#104](https://github.com/CaptainFact/captain-fact-frontend/pull/104) ([Betree](https://github.com/Betree)) -- Update bulma to 0.6.2 [\#103](https://github.com/CaptainFact/captain-fact-frontend/pull/103) ([Betree](https://github.com/Betree)) -- correct some french words [\#102](https://github.com/CaptainFact/captain-fact-frontend/pull/102) ([najeal](https://github.com/najeal)) -- Update react player [\#101](https://github.com/CaptainFact/captain-fact-frontend/pull/101) ([Betree](https://github.com/Betree)) -- Small optimizations and code clean [\#100](https://github.com/CaptainFact/captain-fact-frontend/pull/100) ([Betree](https://github.com/Betree)) -- Fix typos and translations [\#99](https://github.com/CaptainFact/captain-fact-frontend/pull/99) ([Betree](https://github.com/Betree)) -- Add react-helmet to put video titlte in title tag when watching it [\#98](https://github.com/CaptainFact/captain-fact-frontend/pull/98) ([Betree](https://github.com/Betree)) -- Update ambassadors.md [\#97](https://github.com/CaptainFact/captain-fact-frontend/pull/97) ([Betree](https://github.com/Betree)) -- Update ambassadors.md [\#96](https://github.com/CaptainFact/captain-fact-frontend/pull/96) ([Betree](https://github.com/Betree)) -- Correct bug\_report.md [\#95](https://github.com/CaptainFact/captain-fact-frontend/pull/95) ([Betree](https://github.com/Betree)) -- Update tasks.md [\#94](https://github.com/CaptainFact/captain-fact-frontend/pull/94) ([Betree](https://github.com/Betree)) -- Update User.js [\#93](https://github.com/CaptainFact/captain-fact-frontend/pull/93) ([Betree](https://github.com/Betree)) -- Update tasks.md [\#92](https://github.com/CaptainFact/captain-fact-frontend/pull/92) ([Betree](https://github.com/Betree)) -- Release 0.8.4 [\#90](https://github.com/CaptainFact/captain-fact-frontend/pull/90) ([Betree](https://github.com/Betree)) -- Help pages rethinking [\#89](https://github.com/CaptainFact/captain-fact-frontend/pull/89) ([Betree](https://github.com/Betree)) - -## [v0.8.3](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.3) (2018-03-06) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.2...v0.8.3) - -**Fixed bugs:** - -- Statement add "Cancel" button requires two clics to be closed when empty [\#83](https://github.com/CaptainFact/captain-fact-frontend/issues/83) - -**Closed issues:** - -- Collective moderation [\#24](https://github.com/CaptainFact/captain-fact-frontend/issues/24) - -**Merged pull requests:** - -- Release 0.8.3 [\#87](https://github.com/CaptainFact/captain-fact-frontend/pull/87) ([Betree](https://github.com/Betree)) -- Misc improvements [\#86](https://github.com/CaptainFact/captain-fact-frontend/pull/86) ([Betree](https://github.com/Betree)) -- Update dependencies [\#85](https://github.com/CaptainFact/captain-fact-frontend/pull/85) ([Betree](https://github.com/Betree)) -- Misc fixes and improvements [\#84](https://github.com/CaptainFact/captain-fact-frontend/pull/84) ([Betree](https://github.com/Betree)) -- Feature/moderation [\#79](https://github.com/CaptainFact/captain-fact-frontend/pull/79) ([NGambini](https://github.com/NGambini)) - -## [v0.8.2](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.2) (2018-02-20) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.1...v0.8.2) - -**Fixed bugs:** - -- \[Chrome\] UI components appearing over fullscreen videos [\#1](https://github.com/CaptainFact/captain-fact-frontend/issues/1) - -**Merged pull requests:** - -- Release 0.8.2 [\#82](https://github.com/CaptainFact/captain-fact-frontend/pull/82) ([Betree](https://github.com/Betree)) - -## [v0.8.1](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.1) (2018-02-07) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.8.0...v0.8.1) - -**Closed issues:** - -- "Bulletproof" achievement \(install web browser extension\) [\#23](https://github.com/CaptainFact/captain-fact-frontend/issues/23) - -**Merged pull requests:** - -- Release 0.8.1 [\#78](https://github.com/CaptainFact/captain-fact-frontend/pull/78) ([Betree](https://github.com/Betree)) -- Videodebate users / viewers live presence count [\#76](https://github.com/CaptainFact/captain-fact-frontend/pull/76) ([Betree](https://github.com/Betree)) -- New achievements and graphics + translate and fix Help content [\#75](https://github.com/CaptainFact/captain-fact-frontend/pull/75) ([Betree](https://github.com/Betree)) - -## [v0.8.0](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.8.0) (2018-01-25) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.9...v0.8.0) - -**Merged pull requests:** - -- Release 0.8.0 - Minor bug fixes, host image on DockerHub and add dev configs for 0.8 API [\#74](https://github.com/CaptainFact/captain-fact-frontend/pull/74) ([Betree](https://github.com/Betree)) -- Dev compatibility with API v0.8 + release on Dockerhub [\#73](https://github.com/CaptainFact/captain-fact-frontend/pull/73) ([Betree](https://github.com/Betree)) - -## [v0.7.9](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.9) (2018-01-18) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.8...v0.7.9) - -**Merged pull requests:** - -- Release 0.7.9 [\#71](https://github.com/CaptainFact/captain-fact-frontend/pull/71) ([Betree](https://github.com/Betree)) -- \[Travis\] Add a condition to build from tags [\#70](https://github.com/CaptainFact/captain-fact-frontend/pull/70) ([Betree](https://github.com/Betree)) -- Comment texts in bubbles + sources and other various styling [\#69](https://github.com/CaptainFact/captain-fact-frontend/pull/69) ([Betree](https://github.com/Betree)) -- Bundle translations in JS + improve server config [\#68](https://github.com/CaptainFact/captain-fact-frontend/pull/68) ([Betree](https://github.com/Betree)) -- Compact statements on mobile + small users pictures + fixes [\#67](https://github.com/CaptainFact/captain-fact-frontend/pull/67) ([Betree](https://github.com/Betree)) - -## [v0.7.8](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.8) (2018-01-15) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.7...v0.7.8) - -**Merged pull requests:** - -- Last fixes \(sidebar + IE\) [\#66](https://github.com/CaptainFact/captain-fact-frontend/pull/66) ([Betree](https://github.com/Betree)) -- Fix inline script CSP [\#65](https://github.com/CaptainFact/captain-fact-frontend/pull/65) ([Betree](https://github.com/Betree)) -- Pre-0.7.8 release fixes [\#64](https://github.com/CaptainFact/captain-fact-frontend/pull/64) ([Betree](https://github.com/Betree)) -- Release 0.7.8 [\#63](https://github.com/CaptainFact/captain-fact-frontend/pull/63) ([Betree](https://github.com/Betree)) -- Spinner while loading initial JS and optimize bundle size [\#62](https://github.com/CaptainFact/captain-fact-frontend/pull/62) ([Betree](https://github.com/Betree)) -- Update dependencies [\#61](https://github.com/CaptainFact/captain-fact-frontend/pull/61) ([Betree](https://github.com/Betree)) -- Use ReactMarkdown instead of marked [\#60](https://github.com/CaptainFact/captain-fact-frontend/pull/60) ([Betree](https://github.com/Betree)) -- Add unit tests, update dependencies and travis config [\#59](https://github.com/CaptainFact/captain-fact-frontend/pull/59) ([Betree](https://github.com/Betree)) - -## [v0.7.7](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.7) (2018-01-09) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.4...v0.7.7) - -**Fixed bugs:** - -- UTF8 characters \(especially font awesome\) random bug on prod [\#28](https://github.com/CaptainFact/captain-fact-frontend/issues/28) - -**Closed issues:** - -- Bubble menu: Disable and show cross if statement form is active [\#25](https://github.com/CaptainFact/captain-fact-frontend/issues/25) - -**Merged pull requests:** - -- Staging [\#58](https://github.com/CaptainFact/captain-fact-frontend/pull/58) ([Betree](https://github.com/Betree)) -- Add security headers to NGinx + remove Dailymotion / SoundCloud embed [\#56](https://github.com/CaptainFact/captain-fact-frontend/pull/56) ([Betree](https://github.com/Betree)) -- Display history as a table and add video actions to history [\#55](https://github.com/CaptainFact/captain-fact-frontend/pull/55) ([Betree](https://github.com/Betree)) -- Statement text counter, new API config and various fixes [\#54](https://github.com/CaptainFact/captain-fact-frontend/pull/54) ([Betree](https://github.com/Betree)) -- Improvement/misc [\#53](https://github.com/CaptainFact/captain-fact-frontend/pull/53) ([Betree](https://github.com/Betree)) -- Add a script to easily extract icomoon bundle and add missing unlock icon [\#52](https://github.com/CaptainFact/captain-fact-frontend/pull/52) ([Betree](https://github.com/Betree)) -- Add missing social networks icons \(facebook ,twitter, g+...etc\) [\#51](https://github.com/CaptainFact/captain-fact-frontend/pull/51) ([Betree](https://github.com/Betree)) - -## [v0.7.4](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.4) (2017-12-13) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.3...v0.7.4) - -**Merged pull requests:** - -- Icons, bubble menu and various improvements [\#50](https://github.com/CaptainFact/captain-fact-frontend/pull/50) ([Betree](https://github.com/Betree)) -- Icons, bubble menu and various improvements [\#49](https://github.com/CaptainFact/captain-fact-frontend/pull/49) ([Betree](https://github.com/Betree)) -- Style improvement and various fixes [\#47](https://github.com/CaptainFact/captain-fact-frontend/pull/47) ([Betree](https://github.com/Betree)) -- Style improvement and various fixes [\#46](https://github.com/CaptainFact/captain-fact-frontend/pull/46) ([Betree](https://github.com/Betree)) - -## [v0.7.3](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.3) (2017-12-08) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.2...v0.7.3) - -**Merged pull requests:** - -- Release 0.7.3 [\#45](https://github.com/CaptainFact/captain-fact-frontend/pull/45) ([Betree](https://github.com/Betree)) -- Feature unsubscribe page, resizable video column and bubble menu improvements [\#44](https://github.com/CaptainFact/captain-fact-frontend/pull/44) ([Betree](https://github.com/Betree)) -- Videos open from extension doesn't automatically add if inexistant [\#43](https://github.com/CaptainFact/captain-fact-frontend/pull/43) ([Betree](https://github.com/Betree)) -- Videos open from extension doesn't automatically add if inexistant [\#42](https://github.com/CaptainFact/captain-fact-frontend/pull/42) ([Betree](https://github.com/Betree)) - -## [v0.7.2](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.2) (2017-11-21) -[Full Changelog](https://github.com/CaptainFact/captain-fact-frontend/compare/v0.7.0...v0.7.2) - -**Closed issues:** - -- Embed video sources [\#4](https://github.com/CaptainFact/captain-fact-frontend/issues/4) -- Migrate to React 16 [\#3](https://github.com/CaptainFact/captain-fact-frontend/issues/3) - -**Merged pull requests:** - -- Release 0.7.2 🚆 [\#41](https://github.com/CaptainFact/captain-fact-frontend/pull/41) ([Betree](https://github.com/Betree)) -- Add link to Firefox extension 🎆 [\#40](https://github.com/CaptainFact/captain-fact-frontend/pull/40) ([Betree](https://github.com/Betree)) -- UI / UX improvements [\#39](https://github.com/CaptainFact/captain-fact-frontend/pull/39) ([Betree](https://github.com/Betree)) -- Speaker preview / video card styles [\#38](https://github.com/CaptainFact/captain-fact-frontend/pull/38) ([Betree](https://github.com/Betree)) -- Speaker page + various style fixes [\#37](https://github.com/CaptainFact/captain-fact-frontend/pull/37) ([Betree](https://github.com/Betree)) -- Replace "Approve" by "Confirm" and improve mobile styles [\#36](https://github.com/CaptainFact/captain-fact-frontend/pull/36) ([Betree](https://github.com/Betree)) -- Comments, statements and video debate history UI improvements [\#35](https://github.com/CaptainFact/captain-fact-frontend/pull/35) ([Betree](https://github.com/Betree)) -- Youtube sources: show title on video and increase version to 0.7.1 [\#34](https://github.com/CaptainFact/captain-fact-frontend/pull/34) ([Betree](https://github.com/Betree)) -- Set maintenance mode by env variable [\#33](https://github.com/CaptainFact/captain-fact-frontend/pull/33) ([Betree](https://github.com/Betree)) -- Release 0.7.1 - Rich medias, help tooltips and various improvements [\#32](https://github.com/CaptainFact/captain-fact-frontend/pull/32) ([Betree](https://github.com/Betree)) -- Update help pages [\#31](https://github.com/CaptainFact/captain-fact-frontend/pull/31) ([Betree](https://github.com/Betree)) -- UserActions history refactor [\#30](https://github.com/CaptainFact/captain-fact-frontend/pull/30) ([Betree](https://github.com/Betree)) -- Improve socket disconnection, update docs and help pages [\#27](https://github.com/CaptainFact/captain-fact-frontend/pull/27) ([Betree](https://github.com/Betree)) -- Sources rich medias improvements [\#26](https://github.com/CaptainFact/captain-fact-frontend/pull/26) ([Betree](https://github.com/Betree)) -- Update to React 16 [\#22](https://github.com/CaptainFact/captain-fact-frontend/pull/22) ([Betree](https://github.com/Betree)) -- Restore VideoDebate tips, improve autoscroll + refactors [\#21](https://github.com/CaptainFact/captain-fact-frontend/pull/21) ([Betree](https://github.com/Betree)) -- Create script to easilly launch dev API [\#12](https://github.com/CaptainFact/captain-fact-frontend/pull/12) ([Betree](https://github.com/Betree)) - -## [v0.7.0](https://github.com/CaptainFact/captain-fact-frontend/tree/v0.7.0) (2017-11-03) -**Fixed bugs:** - -- Comment / Statement text normalizer is breaking caret position [\#2](https://github.com/CaptainFact/captain-fact-frontend/issues/2) - -**Merged pull requests:** - -- Release 0.7 [\#20](https://github.com/CaptainFact/captain-fact-frontend/pull/20) ([Betree](https://github.com/Betree)) -- Fix bug with comment form [\#19](https://github.com/CaptainFact/captain-fact-frontend/pull/19) ([Betree](https://github.com/Betree)) -- Fix achievements list \(stupid omission\) [\#18](https://github.com/CaptainFact/captain-fact-frontend/pull/18) ([Betree](https://github.com/Betree)) -- Show replied to comment above textbox [\#17](https://github.com/CaptainFact/captain-fact-frontend/pull/17) ([Betree](https://github.com/Betree)) -- Upgrades for API 0.7 + OAuth, translations, styling & minor improvements [\#16](https://github.com/CaptainFact/captain-fact-frontend/pull/16) ([Betree](https://github.com/Betree)) -- Improve comment and statement forms [\#15](https://github.com/CaptainFact/captain-fact-frontend/pull/15) ([Betree](https://github.com/Betree)) -- Update LICENSE to AGPL 3 [\#14](https://github.com/CaptainFact/captain-fact-frontend/pull/14) ([Betree](https://github.com/Betree)) -- Remove useless SASS rules that generate warnings with ruby SASS binary [\#13](https://github.com/CaptainFact/captain-fact-frontend/pull/13) ([Betree](https://github.com/Betree)) -- Improve HTML markup and minify HTML [\#11](https://github.com/CaptainFact/captain-fact-frontend/pull/11) ([Betree](https://github.com/Betree)) -- Update favicons / opengraph images [\#10](https://github.com/CaptainFact/captain-fact-frontend/pull/10) ([Betree](https://github.com/Betree)) -- Update build and help pages [\#9](https://github.com/CaptainFact/captain-fact-frontend/pull/9) ([Betree](https://github.com/Betree)) -- Update .travis.yml to only build for master/staging/maintenance [\#8](https://github.com/CaptainFact/captain-fact-frontend/pull/8) ([Betree](https://github.com/Betree)) -- Update privileges / achievements help pages and remove deprecated .gitlab-ci.yml [\#7](https://github.com/CaptainFact/captain-fact-frontend/pull/7) ([Betree](https://github.com/Betree)) -- Statements shifting and various improvements [\#5](https://github.com/CaptainFact/captain-fact-frontend/pull/5) ([Betree](https://github.com/Betree)) - - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/README.md b/README.md index 860dc26d4..1d73b1f65 100644 --- a/README.md +++ b/README.md @@ -59,30 +59,21 @@ app │   │   └── selectors.js => Re-select selectors to select data in state │   └── ... ├── static => Static assets, directly copied to the public directory -├── styles => Stylesheets in .sass format, all included from application.sass └── router.jsx => Application router and main entry point ``` #### Styling -Styling is based on [Bulma](https://bulma.io/documentation/) and was initially -customized with SASS. However we now include [styled-components](https://github.com/emotion-js/emotion), [styled-system](https://github.com/jxnblk/styled-system) and [@rebass/grid](https://github.com/rebassjs/grid). -This has become the prefered way to build new components. - -#### Icons - -We bundle a custom font icon built with [IcoMoon](https://icomoon.io/). You can find scripts and config -for this in `dev/` but the preferred (and easiest) way to add new icons today -is to use `https://styled-icons.js.org/`. +Styling is based on [Tailwind](https://tailwindcss.com). Some legacy code still uses [styled-components](https://styled-components.com/), but its usage is discouraged. ## Main Libraries / Frameworks - [ES6](http://es6-features.org) with [Babel](https://babeljs.io/) - [React](https://reactjs.org/): View layer -- [Redux](https://redux.js.org/): State management - [React Router](https://github.com/ReactTraining/react-router): Routing - [Phoenix](https://phoenixframework.org/): Interaction with [https://hexdocs.pm/phoenix/Phoenix.Socket.html](Phoenix.Socket) -- [Bulma](https://bulma.io/): Base styles +- [TailwindCSS](https://tailwindcss.com/): Utility-first CSS framework +- [Redux](https://redux.js.org/): State management (deprecated) ## Linked projects diff --git a/app/API/http_api/index.js b/app/API/http_api/index.js index 9d6f50371..8222788bd 100644 --- a/app/API/http_api/index.js +++ b/app/API/http_api/index.js @@ -5,7 +5,6 @@ import { trimEnd } from 'lodash' import { HTTP_API_URL } from '../../config' import { getFromLocalStorage, LOCAL_STORAGE_KEYS } from '../../lib/local_storage' import { optionsToQueryString } from '../../lib/url_utils' -import flashNoInternetError from '../no_internet_error' import parseServerError from '../server_error' class CaptainFactHttpApi { @@ -48,7 +47,6 @@ class CaptainFactHttpApi { console.error(e) // Special case when no internet connection reject('noInternet') - flashNoInternetError() }) }) } diff --git a/app/API/matomo.js b/app/API/matomo.js deleted file mode 100644 index 95faeeacf..000000000 --- a/app/API/matomo.js +++ /dev/null @@ -1,47 +0,0 @@ -import { IS_DEV } from '../config' - -/** - * Low-level function to push an event to matomo **only** if instanciated. If - * Matomo is not instanciated (which is, if `window._paq` is undefined) the event - * is simply ignored. - * - * @param {string} context The context where this happens (eg. Home, UserProfile...) - * @param {string} action The type of action (Click, Close...) - * @param {string} (optional) name - * @param {number} (optional) numeric value - */ -export const pushEvent = (context, action, name, value) => { - try { - // Generate the event - let event = null - if (name && value) { - event = ['trackEvent', context, action, name, value] - } else if (name) { - event = ['trackEvent', context, action, name] - } else { - event = ['trackEvent', context, action] - } - - // Push the event - if ((window._paq === undefined || !window._paq) && IS_DEV) { - // eslint-disable-next-line no-console - console.debug('[Matomo] Push event', event) - } else { - window._paq.push(event) - } - } catch (e) { - // Ignore errors - } - return true -} - -/** - * Register a click on Matomo. - * - * @param {string} context The context where this happens (eg. Home, UserProfile...) - * @param {string} type of the element (eg. Link, Button) - * @param {string} name The name of the link / button (eg. signin, register...) - */ -export const registerClick = (context, type, name) => { - return pushEvent(context, 'Click', `${type}-${name}`) -} diff --git a/app/API/no_internet_error.js b/app/API/no_internet_error.js deleted file mode 100644 index 9aaf4ae20..000000000 --- a/app/API/no_internet_error.js +++ /dev/null @@ -1,14 +0,0 @@ -// Used only to show a message when request fail / timeout due to connection problems -import { NO_INTERNET_ERROR } from '../constants' -import { flashError } from '../state/flashes/reducer' -import store from '../state/index' - -export default function noInternetError() { - store.dispatch( - flashError({ - message: NO_INTERNET_ERROR, - timeLeft: 999999999999, - infoText: 'actions.reload', - }), - ) -} diff --git a/app/API/socket_api.js b/app/API/socket_api.js index 35227300c..627fba5b4 100644 --- a/app/API/socket_api.js +++ b/app/API/socket_api.js @@ -2,7 +2,6 @@ import { Socket } from 'phoenix' import { WS_API_URL } from '../config' import { getFromLocalStorage, LOCAL_STORAGE_KEYS } from '../lib/local_storage' -import noInternetError from './no_internet_error' import parseServerError from './server_error' class CaptainFactSocketApi { @@ -26,11 +25,11 @@ class CaptainFactSocketApi { this.socket.onError((e) => { // eslint-disable-next-line no-console console.warn('Socket error:', e) - noInternetError() }) this.socket.onClose((e) => { if (!e.wasClean) { - noInternetError() + // eslint-disable-next-line no-console + console.warn('Socket closed with errors:', e) } }) } diff --git a/app/App.jsx b/app/App.jsx index 4c51e95f7..ce99a580a 100644 --- a/app/App.jsx +++ b/app/App.jsx @@ -1,6 +1,6 @@ // Import polyfills // Import styles -import './styles/application.sass' +import '@/styles/main.css' import { ApolloProvider } from '@apollo/client' // Import libs @@ -8,12 +8,14 @@ import React from 'react' import { I18nextProvider } from 'react-i18next' import { Configure, Index, InstantSearch } from 'react-instantsearch-dom' import { Provider as ReduxProvider } from 'react-redux' -import { polyfill as smoothSrollPolyfill } from 'smoothscroll-polyfill' +import { polyfill as smoothScrollPolyfill } from 'smoothscroll-polyfill' import { ThemeProvider } from 'styled-components' // Import APIs so they can load their configurations import GraphQLClient from './API/graphql_api' import UserProvider from './components/LoggedInUser/UserProvider' +import { ToastProvider } from './components/ui/toast' +import { TooltipProvider } from './components/ui/tooltip' import { ENTITY_SPEAKER, ENTITY_STATEMENT, ENTITY_VIDEO } from './constants' import i18n from './i18n/i18n' import { ALGOLIA_INDEXES_NAMES, searchClient } from './lib/algolia' @@ -24,34 +26,38 @@ import store from './state' import theme from './styles/theme' // Activate polyfills -smoothSrollPolyfill() +smoothScrollPolyfill() const App = () => ( - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + ) export default App diff --git a/app/components/App/CrashReportPage.jsx b/app/components/App/CrashReportPage.jsx index 72aa18907..08d65f204 100644 --- a/app/components/App/CrashReportPage.jsx +++ b/app/components/App/CrashReportPage.jsx @@ -1,14 +1,13 @@ -import { Flex } from '@rebass/grid' import { truncate } from 'lodash' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { Support } from 'styled-icons/boxicons-regular' import { Github } from 'styled-icons/fa-brands' import { Redo } from 'styled-icons/fa-solid' import { optionsToQueryString } from '../../lib/url_utils' import Container from '../StyledUtils/Container' -import Button from '../Utils/Button' +import { Button } from '../ui/button' import ExternalLinkNewTab from '../Utils/ExternalLinkNewTab' import Message from '../Utils/Message' @@ -46,28 +45,28 @@ const CrashReportPage = ({ t, error }) => { // eslint-disable-next-line no-console console.error(error) return ( - - {t('crash')} -
- - - - + + + + + - + {stackTrace && (
@@ -78,8 +77,8 @@ const CrashReportPage = ({ t, error }) => {
)} -
+ ) } -export default withNamespaces('errors')(CrashReportPage) +export default withTranslation('errors')(CrashReportPage) diff --git a/app/components/App/LanguageSelector.jsx b/app/components/App/LanguageSelector.jsx index 16c63d493..3b92c124c 100644 --- a/app/components/App/LanguageSelector.jsx +++ b/app/components/App/LanguageSelector.jsx @@ -1,10 +1,17 @@ -import { Box, Flex } from '@rebass/grid' -import classNames from 'classnames' import { Map } from 'immutable' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { Globe } from 'styled-icons/fa-solid' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { cn } from '@/lib/css-utils' + const defaultLocales = new Map({ en: 'English', fr: 'Français', @@ -15,32 +22,33 @@ const defaultLocales = new Map({ pt_BR: 'Português (Brasil)', }) -@withNamespaces() // Force waiting for translations to be loaded +@withTranslation() // Force waiting for translations to be loaded export default class LanguageSelector extends React.PureComponent { renderSelect() { const options = defaultLocales.merge(this.props.additionalOptions || {}).sortBy((v, k) => k) return ( - + ) } renderLocalesMap(localesMap) { return localesMap.entrySeq().map(([key, value]) => ( - + )) } renderIcon() { - const { value, size } = this.props + const { value } = this.props if (value === 'fr') { return '🇫🇷' } else if (value === 'en') { @@ -56,16 +64,18 @@ export default class LanguageSelector extends React.PureComponent { } else if (value === 'ru') { return '🇷🇺' } - return + return } render() { - const sizeClass = this.props.size ? `is-${this.props.size}` : null return ( - - {this.props.withIcon && {this.renderIcon()}} - {this.renderSelect()} - +
+ {this.props.withIcon &&
{this.renderIcon()}
} + {this.renderSelect()} +
) } } diff --git a/app/components/App/Layout.jsx b/app/components/App/Layout.jsx index f631c3965..2ab5ad873 100644 --- a/app/components/App/Layout.jsx +++ b/app/components/App/Layout.jsx @@ -2,9 +2,12 @@ import React from 'react' import { Helmet } from 'react-helmet' import { connect } from 'react-redux' +import { checkExtensionInstall } from '@/lib/browser-extension' +import { cn } from '@/lib/css-utils' + import { MainModalContainer } from '../Modal/MainModalContainer' +import { Toaster } from '../ui/toaster' import PublicAchievementUnlocker from '../Users/PublicAchievementUnlocker' -import { FlashMessages } from '../Utils' import BackgroundNotifier from './BackgroundNotifier' import CrashReportPage from './CrashReportPage' import Navbar from './Navbar' @@ -48,36 +51,27 @@ export default class Layout extends React.PureComponent { render() { const { locale, sidebarExpended, children } = this.props - const mainContainerClass = sidebarExpended ? undefined : 'expended' return ( -
- {this.renderMetadata()} - - - - -
- {!this.state.error ? children : } + +
+ {this.renderMetadata()} + + + +
+ {!this.state.error ? children : } +
+ +
- - -
+ + ) } - - /** - * Extension content scripts load after CaptainFact. We could have created a message - * interface to communicate between the two but as our need is very basic for now - * (detecting if extension is installed) we wait 5 seconds and check. - * @returns {Promise} - */ - checkExtensionInstall() { - return new Promise((fulfill) => { - setTimeout(() => fulfill(!!document.getElementById('captainfact-extension-installed')), 5000) - }) - } } diff --git a/app/components/App/Logo.jsx b/app/components/App/Logo.jsx index e891055fb..c4f057666 100644 --- a/app/components/App/Logo.jsx +++ b/app/components/App/Logo.jsx @@ -1,53 +1,21 @@ -import { Flex } from '@rebass/grid' -import PropTypes from 'prop-types' import React from 'react' -import styled, { css } from 'styled-components' -import { themeGet } from 'styled-system' import logo from '../../assets/logo.svg' import borderlessLogo from '../../assets/logo-borderless.svg' -import { Span } from '../StyledUtils/Text' - -const LogoContainer = styled(Flex)` - max-height: 100%; - align-items: center; - font-family: ${themeGet('fontFamily.serif')}; - color: ${themeGet('colors.black.500')}; - - ${(props) => css` - font-size: ${props.size / 2}px; - height: ${props.size}px; - `} -` - -const Image = styled.img` - height: 100%; - width: ${(props) => props.size}px; -` /** * The main website logo. */ -const Logo = ({ borderless, height }) => ( - - C - aptain - - Fact - - +const Logo = ({ borderless = false }) => ( +
+ C + aptain + Fact +
) -Logo.propTypes = { - /** If true, a version of the logo without border will be used */ - borderless: PropTypes.bool, - /** Base height of the component in pixels */ - height: PropTypes.number, -} - -Logo.defaultProps = { - borderless: false, - height: 30, -} - export default Logo diff --git a/app/components/App/MenuToggleSwitch.jsx b/app/components/App/MenuToggleSwitch.jsx index 4ff6c8021..a905c9034 100644 --- a/app/components/App/MenuToggleSwitch.jsx +++ b/app/components/App/MenuToggleSwitch.jsx @@ -2,8 +2,7 @@ import PropTypes from 'prop-types' import React from 'react' import { connect } from 'react-redux' import styled, { withTheme } from 'styled-components' -import { Menu as MenuIcon } from 'styled-icons/boxicons-regular' -import { X as XIcon } from 'styled-icons/boxicons-regular' +import { Menu as MenuIcon, X as XIcon } from 'styled-icons/boxicons-regular' import { themeGet } from 'styled-system' import { toggleSidebar } from '../../state/user_preferences/reducer' diff --git a/app/components/App/Navbar.jsx b/app/components/App/Navbar.jsx index 3063d91ab..0a480a985 100644 --- a/app/components/App/Navbar.jsx +++ b/app/components/App/Navbar.jsx @@ -1,12 +1,11 @@ -import { Box, Flex } from '@rebass/grid' import { omit } from 'lodash' +import { LogIn } from 'lucide-react' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { withResizeDetector } from 'react-resize-detector' import { Link, withRouter } from 'react-router-dom' import Popup from 'reactjs-popup' import styled, { css, withTheme } from 'styled-components' -import { HelpCircle } from 'styled-icons/boxicons-regular' import { UserCircle } from 'styled-icons/fa-regular' import { CaretDown } from 'styled-icons/fa-solid' import { themeGet } from 'styled-system' @@ -22,6 +21,7 @@ import Container from '../StyledUtils/Container' import { fadeIn } from '../StyledUtils/Keyframes' import StyledLink from '../StyledUtils/StyledLink' import { Span } from '../StyledUtils/Text' +import { Button } from '../ui/button' import ScoreTag from '../Users/ScoreTag' import UserAppellation from '../Users/UserAppellation' import UserMenu from '../Users/UserMenu' @@ -31,11 +31,12 @@ import { LoadingFrame } from '../Utils/LoadingFrame' import Logo from './Logo' import MenuToggleSwitch from './MenuToggleSwitch' -const NavbarContainer = styled(Flex)` +const NavbarContainer = styled.div` position: fixed; - z-index: 9999; + z-index: 40; top: 0; width: 100%; + display: flex; justify-content: space-between; align-items: center; background: white; @@ -46,7 +47,8 @@ const NavbarContainer = styled(Flex)` animation: ${fadeIn} 0.3s; ` -const UserMenuTrigger = styled(Flex)` +const UserMenuTrigger = styled.div` + display: flex; align-items: center; height: 38px; cursor: pointer; @@ -65,7 +67,7 @@ const UserMenuEntry = styled((props) => +
- + {/* Left */} - +
{/* Show X icon only on small device */} - {width >= 425 && ( - - - + {(isAuthenticated ? width >= 425 : width >= 275) && ( + + + )} - +
{/* Center - holds the search bar (hidden on mobile) */} {(ENABLE_PUBLIC_SEARCH || location.pathname.startsWith('/search')) && ( ) : ( - +
{isAuthenticated ? ( - - - - - +
+
- +
- + } @@ -232,12 +227,12 @@ const Navbar = ({
- +
{loggedInUser.email} - +
{({ Icon, key, route, title, index, isActive, onClick }) => ( @@ -248,49 +243,37 @@ const Navbar = ({ isActive={isActive} onClick={onClick} > - +
  {title} - +
)}
- +
) : ( - - - {t('menu.login')} - - - {t('menu.extension')} - - - {t('menu.signup')} +
+ + + + + - +
)} -
+
)}
- +
) } export default withTheme( - withLoggedInUser(withNamespaces('main')(withRouter(withResizeDetector(Navbar)))), + withLoggedInUser(withTranslation('main')(withRouter(withResizeDetector(Navbar)))), ) diff --git a/app/components/App/Sidebar.jsx b/app/components/App/Sidebar.jsx index 87aaf6d54..a8f5e7afe 100644 --- a/app/components/App/Sidebar.jsx +++ b/app/components/App/Sidebar.jsx @@ -1,35 +1,33 @@ import { Query } from '@apollo/client/react/components' -import { Flex } from '@rebass/grid' -import classNames from 'classnames' import { capitalize, get } from 'lodash' +import { CircleHelp, Flag, Heart, ListVideo, Mail, Puzzle, Users } from 'lucide-react' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { NavLink } from 'react-router-dom' import styled from 'styled-components' -import { EnvelopeFill } from 'styled-icons/bootstrap' -import { Github } from 'styled-icons/fa-brands' -import { Discord } from 'styled-icons/fa-brands' -import { Twitter } from 'styled-icons/fa-brands' -import { Facebook } from 'styled-icons/fa-brands' -import { Mastodon } from 'styled-icons/fa-brands' +import { Discord, Facebook, Github, Mastodon, Twitter } from 'styled-icons/fa-brands' import { Star } from 'styled-icons/fa-solid' import { LinkExternal } from 'styled-icons/octicons' +import { cn } from '@/lib/css-utils' + import { loggedInUserPendingModerationCount, loggedInUserTodayReputationGain, } from '../../API/graphql_queries' -import { MIN_REPUTATION_MODERATION, MOBILE_WIDTH_THRESHOLD } from '../../constants' -import { MAX_DAILY_REPUTATION_GAIN } from '../../constants' +import { + MAX_DAILY_REPUTATION_GAIN, + MIN_REPUTATION_MODERATION, + TABLET_WIDTH_THRESHOLD, +} from '../../constants' import { closeSidebar, toggleSidebar } from '../../state/user_preferences/reducer' import UserLanguageSelector from '../LoggedInUser/UserLanguageSelector' import { withLoggedInUser } from '../LoggedInUser/UserProvider' +import { Badge } from '../ui/badge' import ExternalLinkNewTab from '../Utils/ExternalLinkNewTab' import ProgressBar from '../Utils/ProgressBar' -import RawIcon from '../Utils/RawIcon' import ReputationGuard from '../Utils/ReputationGuard' -import Tag from '../Utils/Tag' const WhiteStar = styled(Star)` color: white; @@ -41,12 +39,14 @@ const WhiteStar = styled(Star)` ` const DailyGainText = styled.p` color: #858585; + font-size: 0.9em; ` + @connect((state) => ({ sidebarExpended: state.UserPreferences.sidebarExpended }), { toggleSidebar, closeSidebar, }) -@withNamespaces('main') +@withTranslation('main') @withLoggedInUser export default class Sidebar extends React.PureComponent { constructor(props) { @@ -57,20 +57,24 @@ export default class Sidebar extends React.PureComponent { } closeSideBarIfMobile() { - if (window.innerWidth <= MOBILE_WIDTH_THRESHOLD) { + if (window.innerWidth <= TABLET_WIDTH_THRESHOLD) { this.props.closeSidebar() } } - MenuLink({ title, iconName, customLink, className, children, ...props }) { - const classes = classNames(className, { 'link-with-icon': !!iconName }) + MenuLink({ title, className, children, ...props }) { + const classes = cn( + 'flex items-center px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md hover:text-gray-900', + { 'bg-gray-100': props.isActive }, + className, + ) return ( - {iconName && } - {customLink ? children : {children}} + {children} ) } @@ -92,82 +95,90 @@ export default class Sidebar extends React.PureComponent { render() { const { sidebarExpended, className, t, isAuthenticated } = this.props return ( - -
-

{t('menu.language')}

- +
+

+ {t('menu.language')} +

+ {isAuthenticated ? ( -

{t('menu.yourProfile')}

+

+ {t('menu.yourProfile')} +

{this.renderMenuProfile()}
) : null} -

{t('menu.factChecking')}

+

+ {t('menu.factChecking')} +

{this.renderMenuContent()} -

{t('menu.other')}

-
    -
  • - +

    + {t('menu.other')} +

    +
      + + + {t('menu.help')} + + + + {t('menu.contact')} + + + {t('menu.extension')} - - {t('menu.forum')}  - + + {t('menu.forum')} + - + {t('menu.donation')}  - + - - {t('menu.help')} - - - - - - {t('menu.contact')} -
    -

    {t('menu.followus')}

    -
    - {' '} -     +

    + {t('menu.followus')} +

    +
    -     + -     + -     + -     + -     +
    - + ) } @@ -184,8 +195,8 @@ export default class Sidebar extends React.PureComponent { const dailyGain = get(data, 'loggedInUser.todayReputationGain', 0) return ( - - +
    +
    - +
    {`${t('menu.dailyGain')} ${dailyGain}/${MAX_DAILY_REPUTATION_GAIN}`} - +
    ) }} @@ -207,7 +218,7 @@ export default class Sidebar extends React.PureComponent { renderMenuProfile() { return ( -
      +
      • {this.renderDailyGainGauge()}
      ) @@ -216,8 +227,9 @@ export default class Sidebar extends React.PureComponent { renderMenuContent() { const t = this.props.t return ( -
        - +
          + + {capitalize(t('entities.videoFactChecking'))} @@ -229,9 +241,14 @@ export default class Sidebar extends React.PureComponent { {({ data }) => { const pendingCount = get(data, 'loggedInUser.actions_pending_moderation', 0) return ( - + + {t('menu.moderation')} - {Boolean(pendingCount) && {pendingCount}} + {Boolean(pendingCount) && ( + + {pendingCount} + + )} ) }} diff --git a/app/components/Comments/CommentAction.jsx b/app/components/Comments/CommentAction.jsx index 9ab4f6c3a..86383723c 100644 --- a/app/components/Comments/CommentAction.jsx +++ b/app/components/Comments/CommentAction.jsx @@ -1,16 +1,10 @@ -import classNames from 'classnames' import React from 'react' -import Button from '../Utils/Button' -import { Icon } from '../Utils/Icon' +import { Button } from '../ui/button' -const CommentAction = ({ className, onClick, title, iconName, disabled }) => ( - ) diff --git a/app/components/Comments/CommentActions.jsx b/app/components/Comments/CommentActions.jsx index 89eb2b466..2c833f73d 100644 --- a/app/components/Comments/CommentActions.jsx +++ b/app/components/Comments/CommentActions.jsx @@ -1,5 +1,6 @@ +import { Eye, EyeOff } from 'lucide-react' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import CommentAction from './CommentAction' import OtherCommentActions from './OtherCommentActions' @@ -16,27 +17,32 @@ const CommentActions = ({ handleFlag, handleToggleShowReplies, }) => ( - +
) -export default withNamespaces('videoDebate')(CommentActions) +export default withTranslation('videoDebate')(CommentActions) diff --git a/app/components/Comments/CommentContent.jsx b/app/components/Comments/CommentContent.jsx index 82c34f502..f98e63c75 100644 --- a/app/components/Comments/CommentContent.jsx +++ b/app/components/Comments/CommentContent.jsx @@ -1,6 +1,7 @@ +import { ChevronUp } from 'lucide-react' import React from 'react' -import Tag from '../Utils/Tag' +import { Badge } from '../ui/badge' import { Source } from './Source' const COLLAPSE_CONTENT_ABOVE_NESTING = 6 @@ -12,12 +13,24 @@ const CommentContent = ({ comment: { source, text }, nesting, replyingTo, richMe return (
{shouldRenderTextBlock && ( -
- {isCollapsed && @{replyingTo.username}} +
+ + {isCollapsed && ( + + @{replyingTo.username} + + )} {text}
)} - {source && } + {source && ( +
+ +
+ )}
) } diff --git a/app/components/Comments/CommentDisplay.jsx b/app/components/Comments/CommentDisplay.jsx index eb1bae0ec..f5cafec98 100644 --- a/app/components/Comments/CommentDisplay.jsx +++ b/app/components/Comments/CommentDisplay.jsx @@ -1,15 +1,15 @@ -import classNames from 'classnames' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { change } from 'redux-form' +import { cn } from '@/lib/css-utils' +import { toastErrorUnauthenticated } from '@/lib/toasts' + import { COLLAPSE_REPLIES_AT_NESTING } from '../../constants' -import { flashErrorUnauthenticated } from '../../state/flashes/reducer' import { addModal } from '../../state/modals/reducer' import { commentVote, deleteComment, flagComment } from '../../state/video_debate/comments/effects' import { withLoggedInUser } from '../LoggedInUser/UserProvider' -import MediaLayout from '../Utils/MediaLayout' import CommentActions from './CommentActions' import CommentContent from './CommentContent' import CommentHeader from './CommentHeader' @@ -31,10 +31,9 @@ import Vote from './Vote' flagComment, commentVote, change, - flashErrorUnauthenticated, }, ) -@withNamespaces('main') +@withTranslation('main') @withLoggedInUser export class CommentDisplay extends React.PureComponent { constructor(props) { @@ -46,29 +45,32 @@ export class CommentDisplay extends React.PureComponent { } render() { - const { comment, withoutActions, className, replies, hideThread } = this.props + const { comment, withoutActions, replies, hideThread, isQuoted } = this.props const { isBlurred, repliesCollapsed } = this.state const approveClass = this.getApproveClass(comment.approve) - const allClassNames = classNames('comment', className, approveClass, { - isBlurred, - hasSource: !!comment.source, + const allClassNames = cn({ + 'opacity-50 blur-sm': isBlurred, + 'border-l': this.props.nesting > 1, + 'border-green-500': approveClass === 'approve', + 'border-red-500': approveClass === 'refute', + 'bg-neutral-100 border-gray-500': isQuoted, }) return ( -
- +
+
+ {!withoutActions &&
{this.renderCommentLeft()}
} +
{this.renderCommentContent()}
+
{!hideThread && !repliesCollapsed && replies && ( - +
+ +
)}
) @@ -141,7 +143,7 @@ export class CommentDisplay extends React.PureComponent { return true } - this.props.flashErrorUnauthenticated() + toastErrorUnauthenticated() return false } @@ -172,7 +174,7 @@ export class CommentDisplay extends React.PureComponent { return this.props.setReplyToComment(this.props.comment) } - handleFlag = (initialReason) => { + handleFlag = () => { if (!this.ensureAuthenticated()) { return } @@ -189,7 +191,6 @@ export class CommentDisplay extends React.PureComponent { }) }, comment: this.props.comment, - initialReason, }, }) } diff --git a/app/components/Comments/CommentForm.jsx b/app/components/Comments/CommentForm.jsx index 71a8393cf..bd2ed823e 100644 --- a/app/components/Comments/CommentForm.jsx +++ b/app/components/Comments/CommentForm.jsx @@ -1,46 +1,33 @@ -import { Box, Flex } from '@rebass/grid' -import classNames from 'classnames' import { Formik } from 'formik' import { get } from 'lodash' +import { Check, CircleX, HelpCircle, MessagesSquare, Plus, ShieldBan } from 'lucide-react' import PropTypes from 'prop-types' import React from 'react' -import { withNamespaces } from 'react-i18next' +import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' -import styled from 'styled-components' -import { Plus } from 'styled-icons/boxicons-regular' -import { HelpCircle } from 'styled-icons/boxicons-solid' -import { space } from 'styled-system' import isURL from 'validator/lib/isURL' +import { cn } from '@/lib/css-utils' +import { toastError, toastErrorUnauthenticated } from '@/lib/toasts' + import { COMMENT_LENGTH, USER_PICTURE_LARGE } from '../../constants' import { cleanStrMultiline } from '../../lib/clean_str' import { validateLengthI18n } from '../../lib/form_validators' import { logError } from '../../logger' -import { errorToFlash, flashErrorUnauthenticated } from '../../state/flashes/reducer' import { postComment } from '../../state/video_debate/comments/effects' -import TextareaAutosize from '../FormUtils/TextareaAutosize' import TextareaLengthCounter from '../FormUtils/TextareaLengthCounter' -import Container from '../StyledUtils/Container' -import StyledInput from '../StyledUtils/StyledInput' -import { Span } from '../StyledUtils/Text' +import { Button } from '../ui/button' +import { Card, CardContent, CardHeader, CardTitle } from '../ui/card' +import { Input } from '../ui/input' +import { Textarea } from '../ui/textarea' import UserAppellation from '../Users/UserAppellation' import UserPicture from '../Users/UserPicture' -import Button from '../Utils/Button' -import CloseButton from '../Utils/CloseButton' import ExternalLinkNewTab from '../Utils/ExternalLinkNewTab' import { CommentDisplay } from './CommentDisplay' -const SubmitButton = styled((props) => ( - ) : ( - - - {t('comment.post', i18nParams)} - - - +
+ +
+ +
) } renderIncitate(values, setFieldValue, isDisabled) { - const { replyTo, inciteToParticipate } = this.props + const { replyTo, inciteToParticipate, t } = this.props const i18nParams = replyTo ? { context: 'reply' } : null - const name_class = inciteToParticipate == 'approve' ? 'is-success' : 'is-danger' - const comment = inciteToParticipate == 'approve' ? 'comment.approve' : 'comment.refute' - const approveField = inciteToParticipate == 'approve' ? true : false + const variant = inciteToParticipate === 'approve' ? 'success' : 'destructive' + const comment = inciteToParticipate === 'approve' ? 'comment.approve' : 'comment.refute' + const approveField = inciteToParticipate === 'approve' return ( - - - +
+ +
+
) } @@ -211,32 +217,27 @@ class CommentForm extends React.Component { return ( {({ handleBlur, handleSubmit, values, setFieldValue, isValid, dirty, errors }) => ( - - - - +
+
+