/* Copyright 2020 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import * as React from "react"; import { _t } from "matrix-react-sdk/src/languageHandler"; import SdkConfig from 'matrix-react-sdk/src/SdkConfig'; // directly import the style here as this layer does not support rethemedex at this time so no matrix-react-sdk // scss variables will be accessible. import "../../../res/css/structures/ErrorView.scss"; interface IProps { onAccept(): void; } const CompatibilityView: React.FC = ({ onAccept }) => { const {brand, mobileBuilds} = SdkConfig.get(); let ios = null; const iosCustomUrl = mobileBuilds?.ios; if (iosCustomUrl !== null) { // could be undefined or a string ios = <>

iOS (iPhone or iPad)

Apple App Store ; } let android = [

Android

]; const andCustomUrl = mobileBuilds?.android; const fdroidCustomUrl = mobileBuilds?.fdroid; if (andCustomUrl !== null) { // undefined or string android.push( Google Play Store ); } if (fdroidCustomUrl !== null) { // undefined or string android.push( F-Droid ); } if (android.length === 1) { // just a header, meaning no links android = []; } let mobileHeader =

{_t("Use %(brand)s on mobile", {brand})}

; if (!android.length && !ios) { mobileHeader = null; } return
Element

{ _t("Unsupported browser") }

{ _t("Your browser can't run %(brand)s", { brand }) }

{ _t( "%(brand)s uses advanced browser features which aren't " + "supported by your current browser.", { brand }, ) }

{ _t( 'Please install Chrome, Firefox, ' + 'or Safari for the best experience.', {}, { 'chromeLink': (sub) => {sub}, 'firefoxLink': (sub) => {sub}, 'safariLink': (sub) => {sub}, }, )}

{ _t( "You can continue using your current browser, but some or all features may not work " + "and the look and feel of the application may be incorrect.", ) }

{mobileHeader} {ios} {android}

{ _t("Go to element.io") }

; }; export default CompatibilityView;