diff --git a/babel.config.js b/babel.config.js index 1fa10050a..566df21ec 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,8 +1,4 @@ -module.exports = { - presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'], - plugins: [ - '@babel/plugin-proposal-object-rest-spread', - '@babel/plugin-transform-runtime', - 'transform-require-context' - ] -}; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const baseConfig = require('proton-shared/configs/babel.config.base'); + +module.exports = baseConfig; diff --git a/containers/themes/ThemesSection.js b/containers/themes/ThemesSection.js index 33266e481..766d8c8f3 100644 --- a/containers/themes/ThemesSection.js +++ b/containers/themes/ThemesSection.js @@ -14,11 +14,13 @@ import { } from 'react-components'; import { updateTheme } from 'proton-shared/lib/api/mailSettings'; import { getThemeIdentifier, stripThemeIdentifier } from 'proton-shared/lib/themes/helpers'; -import { DEFAULT_THEME, CUSTOM_THEME } from 'proton-shared/lib/themes/themes.js'; +import { DEFAULT_THEME, PROTON_THEMES, CUSTOM_THEME } from 'proton-shared/lib/themes/themes.js'; import CustomThemeModal from './CustomThemeModal.js'; -const availableThemes = [DEFAULT_THEME, CUSTOM_THEME]; +const availableThemes = [DEFAULT_THEME, FEATURE_FLAGS.includes('darkmode') && PROTON_THEMES.DARK, CUSTOM_THEME].filter( + Boolean +); const ThemesSection = () => { const api = useApi(); diff --git a/jest.config.js b/jest.config.js index 4bae7bcee..48b1cf850 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,15 +1,12 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const baseConfig = require('proton-shared/configs/jest.config.base'); + module.exports = { - setupFilesAfterEnv: ['./rtl.setup.js'], - verbose: true, - moduleDirectories: ['node_modules'], - transform: { - '^.+\\.(js|tsx?)$': 'babel-jest' - }, + ...baseConfig, moduleNameMapper: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)$': '/__mocks__/fileMock.js', '\\.(css|scss|less)$': '/__mocks__/styleMock.js', pmcrypto: '/__mocks__/pmcrypto.js', 'sieve.js': '/__mocks__/sieve.js' - }, - transformIgnorePatterns: ['node_modules/(?!(proton-shared)/)'] + } }; diff --git a/tsconfig.json b/tsconfig.json index a4c0501b8..6d4178fa0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "proton-shared/tsconfig.base.json" + "extends": "proton-shared/configs/tsconfig.base.json" }