2020-04-23 16:10:40 +02:00
|
|
|
/*
|
|
|
|
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";
|
2020-04-23 17:06:27 +02:00
|
|
|
import { _t } from "matrix-react-sdk/src/languageHandler";
|
2020-07-13 15:12:44 +02:00
|
|
|
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
|
2020-04-23 16:10:40 +02:00
|
|
|
|
|
|
|
// 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 {
|
2020-04-28 01:53:29 +02:00
|
|
|
onAccept(): void;
|
2020-04-23 16:10:40 +02:00
|
|
|
}
|
|
|
|
|
2020-04-23 17:45:24 +02:00
|
|
|
const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
|
2021-06-30 14:28:31 +02:00
|
|
|
const { brand, mobileBuilds } = SdkConfig.get();
|
2021-04-09 02:39:09 +02:00
|
|
|
|
|
|
|
let ios = null;
|
|
|
|
const iosCustomUrl = mobileBuilds?.ios;
|
|
|
|
if (iosCustomUrl !== null) { // could be undefined or a string
|
|
|
|
ios = <>
|
|
|
|
<p><strong>iOS</strong> (iPhone or iPad)</p>
|
|
|
|
<a
|
|
|
|
href={iosCustomUrl || "https://apps.apple.com/app/vector/id1083446067"}
|
|
|
|
target="_blank"
|
|
|
|
className="mx_ClearDecoration"
|
|
|
|
>
|
|
|
|
<img height="48" src="themes/element/img/download/apple.svg" alt="Apple App Store" />
|
|
|
|
</a>
|
|
|
|
</>;
|
|
|
|
}
|
|
|
|
|
|
|
|
let android = [<p className="mx_Spacer" key="header"><strong>Android</strong></p>];
|
|
|
|
const andCustomUrl = mobileBuilds?.android;
|
|
|
|
const fdroidCustomUrl = mobileBuilds?.fdroid;
|
|
|
|
if (andCustomUrl !== null) { // undefined or string
|
|
|
|
android.push(<a
|
|
|
|
href={andCustomUrl || "https://play.google.com/store/apps/details?id=im.vector.app"}
|
|
|
|
target="_blank"
|
|
|
|
className="mx_ClearDecoration"
|
|
|
|
key="android"
|
|
|
|
>
|
|
|
|
<img height="48" src="themes/element/img/download/google.svg" alt="Google Play Store" />
|
|
|
|
</a>);
|
|
|
|
}
|
|
|
|
if (fdroidCustomUrl !== null) { // undefined or string
|
|
|
|
android.push(<a
|
|
|
|
href={fdroidCustomUrl || "https://f-droid.org/repository/browse/?fdid=im.vector.app"}
|
|
|
|
target="_blank"
|
|
|
|
className="mx_ClearDecoration"
|
|
|
|
key="fdroid"
|
|
|
|
>
|
2021-04-09 02:43:50 +02:00
|
|
|
<img height="48" src="themes/element/img/download/fdroid.svg" alt="F-Droid" />
|
2021-04-09 02:39:09 +02:00
|
|
|
</a>);
|
|
|
|
}
|
|
|
|
if (android.length === 1) { // just a header, meaning no links
|
|
|
|
android = [];
|
|
|
|
}
|
|
|
|
|
2021-07-20 10:27:12 +02:00
|
|
|
let mobileHeader = <h2 id="step2_heading">{ _t("Use %(brand)s on mobile", { brand }) }</h2>;
|
2021-04-09 02:39:09 +02:00
|
|
|
if (!android.length && !ios) {
|
|
|
|
mobileHeader = null;
|
|
|
|
}
|
|
|
|
|
2020-04-23 16:10:40 +02:00
|
|
|
return <div className="mx_ErrorView">
|
|
|
|
<div className="mx_ErrorView_container">
|
|
|
|
<div className="mx_HomePage_header">
|
|
|
|
<span className="mx_HomePage_logo">
|
2020-07-10 20:09:52 +02:00
|
|
|
<img height="42" src="themes/element/img/logos/element-logo.svg" alt="Element" />
|
2020-04-23 16:10:40 +02:00
|
|
|
</span>
|
|
|
|
<h1>{ _t("Unsupported browser") }</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="mx_HomePage_col">
|
|
|
|
<div className="mx_HomePage_row">
|
|
|
|
<div>
|
2020-07-13 15:12:44 +02:00
|
|
|
<h2 id="step1_heading">{ _t("Your browser can't run %(brand)s", { brand }) }</h2>
|
2020-04-23 16:10:40 +02:00
|
|
|
<p>
|
|
|
|
{ _t(
|
2020-07-13 15:12:44 +02:00
|
|
|
"%(brand)s uses advanced browser features which aren't " +
|
|
|
|
"supported by your current browser.",
|
|
|
|
{ brand },
|
2020-04-23 16:10:40 +02:00
|
|
|
) }
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{ _t(
|
|
|
|
'Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, ' +
|
|
|
|
'or <safariLink>Safari</safariLink> for the best experience.',
|
|
|
|
{},
|
|
|
|
{
|
2021-07-20 10:27:12 +02:00
|
|
|
'chromeLink': (sub) => <a href="https://www.google.com/chrome">{ sub }</a>,
|
|
|
|
'firefoxLink': (sub) => <a href="https://firefox.com">{ sub }</a>,
|
|
|
|
'safariLink': (sub) => <a href="https://apple.com/safari">{ sub }</a>,
|
2020-04-23 16:10:40 +02:00
|
|
|
},
|
2021-07-20 10:27:12 +02:00
|
|
|
) }
|
2020-04-23 16:10:40 +02:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{ _t(
|
2020-04-23 16:38:26 +02:00
|
|
|
"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.",
|
2020-04-23 16:10:40 +02:00
|
|
|
) }
|
|
|
|
</p>
|
|
|
|
<button onClick={onAccept}>
|
|
|
|
{ _t("I understand the risks and wish to continue") }
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="mx_HomePage_col">
|
|
|
|
<div className="mx_HomePage_row">
|
|
|
|
<div>
|
2021-07-20 10:27:12 +02:00
|
|
|
{ mobileHeader }
|
|
|
|
{ ios }
|
|
|
|
{ android }
|
2020-04-23 16:10:40 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="mx_HomePage_row mx_Center mx_Spacer">
|
|
|
|
<p className="mx_Spacer">
|
2020-07-13 18:02:20 +02:00
|
|
|
<a href="https://element.io" target="_blank" className="mx_FooterLink">
|
|
|
|
{ _t("Go to element.io") }
|
2020-04-23 16:10:40 +02:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>;
|
|
|
|
};
|
|
|
|
|
2020-04-23 17:45:24 +02:00
|
|
|
export default CompatibilityView;
|