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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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