Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions containers/app/StandardPrivateApp.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import React, { useState, useRef } from 'react';
import PropTypes from 'prop-types';
import { EventManagerProvider, ModalsChildren, ThemeInjector } from 'react-components';
import { EventManagerProvider, ModalsChildren, ThemeInjector, lazyLocales as locales } from 'react-components';

import EventModelListener from '../eventManager/EventModelListener';
import EventNotices from '../eventManager/EventNotices';
import LoaderPage from './LoaderPage';
import StandardPreload from './StandardPreload';
import ForceRefreshProvider from '../forceRefresh/Provider';

const StandardPrivateApp = ({
locales = {},
onLogout,
openpgpConfig,
preloadModels = [],
eventModels = [],
children
}) => {
const StandardPrivateApp = ({ onLogout, openpgpConfig, preloadModels = [], eventModels = [], children }) => {
const [loading, setLoading] = useState(true);
const eventManagerRef = useRef();

Expand Down Expand Up @@ -52,7 +45,6 @@ const StandardPrivateApp = ({
StandardPrivateApp.propTypes = {
onLogout: PropTypes.func.isRequired,
children: PropTypes.node.isRequired,
locales: PropTypes.object,
openpgpConfig: PropTypes.object,
preloadModels: PropTypes.array,
eventModels: PropTypes.array
Expand Down
5 changes: 2 additions & 3 deletions containers/app/StandardPublicApp.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useEffect, useState } from 'react';
import { LoaderPage, GenericError, ModalsChildren } from 'react-components';
import { LoaderPage, GenericError, ModalsChildren, lazyLocales as locales } from 'react-components';
import PropTypes from 'prop-types';
import { loadOpenPGP } from 'proton-shared/lib/openpgp';
import { getBrowserLocale, getClosestMatches } from 'proton-shared/lib/i18n/helper';
import loadLocale from 'proton-shared/lib/i18n/loadLocale';

const StandardPublicApp = ({ locales = {}, openpgpConfig, children }) => {
const StandardPublicApp = ({ openpgpConfig, children }) => {
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);

Expand Down Expand Up @@ -46,7 +46,6 @@ const StandardPublicApp = ({ locales = {}, openpgpConfig, children }) => {
};

StandardPublicApp.propTypes = {
locales: PropTypes.object,
openpgpConfig: PropTypes.object,
children: PropTypes.node
};
Expand Down
8 changes: 2 additions & 6 deletions containers/general/LanguageSection.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { c } from 'ttag';
import PropTypes from 'prop-types';
import {
SubTitle,
Row,
Field,
Label,
Select,
lazyLocales as locales,
useApi,
useConfig,
useLoading,
Expand All @@ -19,7 +19,7 @@ import { updateLocale } from 'proton-shared/lib/api/settings';
import loadLocale from 'proton-shared/lib/i18n/loadLocale';
import { getBrowserLocale, getClosestMatches } from 'proton-shared/lib/i18n/helper';

const LanguageSection = ({ locales = {} }) => {
const LanguageSection = () => {
const api = useApi();
const { call } = useEventManager();
const { LOCALES = {} } = useConfig();
Expand Down Expand Up @@ -70,8 +70,4 @@ const LanguageSection = ({ locales = {} }) => {
);
};

LanguageSection.propTypes = {
locales: PropTypes.object.isRequired
};

export default LanguageSection;
13 changes: 10 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,17 @@ export { default as AddFilterModal } from './containers/filters/AddFilterModal';
export { default as AddEmailToListModal } from './containers/filters/AddEmailToListModal';
export { default as StorageSpaceStatus } from './containers/sidebar/StorageSpaceStatus';

export { default as OpenVPNConfigurationSection } from './containers/vpn/OpenVPNConfigurationSection/OpenVPNConfigurationSection';
export {
default as OpenVPNConfigurationSection
} from './containers/vpn/OpenVPNConfigurationSection/OpenVPNConfigurationSection';
export { default as ProtonVPNClientsSection } from './containers/vpn/ProtonVPNClientsSection/ProtonVPNClientsSection';
export { default as OpenVPNAccountSection } from './containers/vpn/OpenVPNAccountSection/OpenVPNAccountSection';
export { default as ProtonVPNResourcesSection } from './containers/vpn/ProtonVPNResourcesSection/ProtonVPNResourcesSection';
export { default as ProtonVPNCredentialsSection } from './containers/vpn/ProtonVPNCredentialsSection/ProtonVPNCredentialsSection';
export {
default as ProtonVPNResourcesSection
} from './containers/vpn/ProtonVPNResourcesSection/ProtonVPNResourcesSection';
export {
default as ProtonVPNCredentialsSection
} from './containers/vpn/ProtonVPNCredentialsSection/ProtonVPNCredentialsSection';

export { useUser, useGetUser } from './hooks/useUser';
export { default as useUserVPN } from './hooks/useUserVPN';
Expand Down Expand Up @@ -383,3 +389,4 @@ export { default as TopNavbar } from './containers/app/TopNavbar';
export { default as LoaderPage } from './containers/app/LoaderPage';

export * from './helpers/component';
export { default as lazyLocales } from './helpers/lazyLocales';