Add multiple platforms to Element client
This commit is contained in:
parent
2eed84fc23
commit
03816c1224
7 changed files with 20 additions and 19 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -62,7 +62,7 @@ export interface ClientDescription {
|
|||
homepage: string;
|
||||
logo: string;
|
||||
description: string;
|
||||
platform: Platform;
|
||||
platforms: Platform[];
|
||||
maturity: Maturity;
|
||||
clientId: ClientId;
|
||||
experimental: boolean;
|
||||
|
|
|
@ -47,16 +47,18 @@ const ClientList: React.FC<IProps> = ({ link, rememberSelection }: IProps) => {
|
|||
showClient = true;
|
||||
}
|
||||
|
||||
switch (client.platform) {
|
||||
case Platform.Desktop:
|
||||
showClient = showClient || !(uaResults as any).mobile;
|
||||
break;
|
||||
case Platform.iOS:
|
||||
showClient = showClient || (uaResults as any).ios;
|
||||
break;
|
||||
case Platform.Android:
|
||||
showClient = showClient || (uaResults as any).android;
|
||||
break;
|
||||
for (const platform of client.platforms) {
|
||||
switch (platform) {
|
||||
case Platform.Desktop:
|
||||
showClient = showClient || !(uaResults as any).mobile;
|
||||
break;
|
||||
case Platform.iOS:
|
||||
showClient = showClient || (uaResults as any).ios;
|
||||
break;
|
||||
case Platform.Android:
|
||||
showClient = showClient || (uaResults as any).android;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!showExperimentalClients && client.experimental) {
|
||||
|
|
Loading…
Reference in a new issue