Add multiple platforms to Element client

This commit is contained in:
J. Ryan Stinnett 2020-09-29 16:57:08 +01:00
parent 2eed84fc23
commit 03816c1224
7 changed files with 20 additions and 19 deletions

View file

@ -24,7 +24,7 @@ import {
import { LinkKind } from '../parser/types';
import logo from '../imgs/element.svg';
const Element: LinkedClient = {
export const Element: LinkedClient = {
kind: ClientKind.LINKED_CLIENT,
name: 'Element',
author: 'Element',
@ -32,7 +32,7 @@ const Element: LinkedClient = {
homepage: 'https://element.io',
maturity: Maturity.STABLE,
description: 'Fully-featured Matrix client for the Web',
platform: Platform.Desktop,
platforms: [Platform.Desktop, Platform.Android, Platform.iOS],
experimental: false,
clientId: ClientId.Element,
toUrl: (link) => {
@ -69,7 +69,7 @@ export const ElementDevelop: LinkedClient = {
homepage: 'https://element.io',
maturity: Maturity.STABLE,
description: 'Fully-featured Matrix client for the Web',
platform: Platform.Desktop,
platforms: [Platform.Desktop],
experimental: true,
clientId: ClientId.ElementDevelop,
toUrl: (link) => {
@ -95,4 +95,3 @@ export const ElementDevelop: LinkedClient = {
},
linkSupport: () => true,
};
export default Element;

View file

@ -30,7 +30,7 @@ const Fractal: TextClient = {
homepage: 'https://github.com/poljar/weechat-matrix',
maturity: Maturity.BETA,
experimental: false,
platform: Platform.Desktop,
platforms: [Platform.Desktop],
clientId: ClientId.Fractal,
toInviteString: (link) => {
switch (link.kind) {

View file

@ -30,7 +30,7 @@ const Nheko: TextClient = {
homepage: 'https://github.com/Nheko-Reborn/nheko',
maturity: Maturity.BETA,
experimental: false,
platform: Platform.Desktop,
platforms: [Platform.Desktop],
clientId: ClientId.Nheko,
toInviteString: (link) => {
switch (link.kind) {

View file

@ -30,7 +30,7 @@ const Weechat: TextClient = {
homepage: 'https://github.com/poljar/weechat-matrix',
maturity: Maturity.LATE_BETA,
experimental: false,
platform: Platform.Desktop,
platforms: [Platform.Desktop],
clientId: ClientId.WeeChat,
toInviteString: (link) => {
switch (link.kind) {

View file

@ -16,7 +16,7 @@ limitations under the License.
import { Client } from './types';
import Element, { ElementDevelop } from './Element';
import { Element, ElementDevelop } from './Element';
import Weechat from './Weechat';
import Nheko from './Nheko';
import Fractal from './Fractal';

View file

@ -62,7 +62,7 @@ export interface ClientDescription {
homepage: string;
logo: string;
description: string;
platform: Platform;
platforms: Platform[];
maturity: Maturity;
clientId: ClientId;
experimental: boolean;

View file

@ -47,7 +47,8 @@ const ClientList: React.FC<IProps> = ({ link, rememberSelection }: IProps) => {
showClient = true;
}
switch (client.platform) {
for (const platform of client.platforms) {
switch (platform) {
case Platform.Desktop:
showClient = showClient || !(uaResults as any).mobile;
break;
@ -58,6 +59,7 @@ const ClientList: React.FC<IProps> = ({ link, rememberSelection }: IProps) => {
showClient = showClient || (uaResults as any).android;
break;
}
}
if (!showExperimentalClients && client.experimental) {
showClient = false;