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 { 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;
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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';
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -47,16 +47,18 @@ const ClientList: React.FC<IProps> = ({ link, rememberSelection }: IProps) => {
|
||||||
showClient = true;
|
showClient = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (client.platform) {
|
for (const platform of client.platforms) {
|
||||||
case Platform.Desktop:
|
switch (platform) {
|
||||||
showClient = showClient || !(uaResults as any).mobile;
|
case Platform.Desktop:
|
||||||
break;
|
showClient = showClient || !(uaResults as any).mobile;
|
||||||
case Platform.iOS:
|
break;
|
||||||
showClient = showClient || (uaResults as any).ios;
|
case Platform.iOS:
|
||||||
break;
|
showClient = showClient || (uaResults as any).ios;
|
||||||
case Platform.Android:
|
break;
|
||||||
showClient = showClient || (uaResults as any).android;
|
case Platform.Android:
|
||||||
break;
|
showClient = showClient || (uaResults as any).android;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showExperimentalClients && client.experimental) {
|
if (!showExperimentalClients && client.experimental) {
|
||||||
|
|
Loading…
Reference in a new issue