Add a warning alert for closed source apps.

This commit is contained in:
Dessalines 2023-10-18 09:16:43 -04:00
parent baa2f9c960
commit 2fafb18134
5 changed files with 32 additions and 3 deletions

@ -1 +1 @@
Subproject commit 229a9319ba1130723928e58fcbdbfccad45a4e81 Subproject commit 0738d1326a788c648c29f1808e7274873f7985ac

@ -1 +1 @@
Subproject commit bc063f46eb15fa09391639a4777b0cabb0cdcef5 Subproject commit fe95bd00c3e9b08c8fb86e0f930452a1f4a2119b

@ -1 +1 @@
Subproject commit d0f3548379e446d2c333e582734bc68f8d684f4d Subproject commit 848fc0d3b4128f262b605d6a6f81cd3f49dbbdbc

View file

@ -4,6 +4,11 @@ export interface ApiLibrary {
description: string; description: string;
} }
export enum SourceType {
Closed,
Open,
}
export interface AppDetails { export interface AppDetails {
name: string; name: string;
description: string; description: string;
@ -11,6 +16,7 @@ export interface AppDetails {
icon?: string; icon?: string;
banner?: string; banner?: string;
links: AppLink[]; links: AppLink[];
sourceType: SourceType;
} }
export interface AppLink { export interface AppLink {
@ -57,6 +63,7 @@ const voyagerApp: AppDetails = {
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}; };
const thunderApp: AppDetails = { const thunderApp: AppDetails = {
@ -84,6 +91,7 @@ const thunderApp: AppDetails = {
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}; };
export const ANDROID_APPS: AppDetails[] = [ export const ANDROID_APPS: AppDetails[] = [
@ -107,6 +115,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "Eternity", name: "Eternity",
@ -128,6 +137,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "Combustible", name: "Combustible",
@ -145,6 +155,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "LiftOff!", name: "LiftOff!",
@ -166,6 +177,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
voyagerApp, voyagerApp,
thunderApp, thunderApp,
@ -181,6 +193,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "googleplay", icon: "googleplay",
}, },
], ],
sourceType: SourceType.Closed,
}, },
{ {
name: "Sync for Lemmy", name: "Sync for Lemmy",
@ -194,6 +207,7 @@ export const ANDROID_APPS: AppDetails[] = [
icon: "googleplay", icon: "googleplay",
}, },
], ],
sourceType: SourceType.Closed,
}, },
]; ];
@ -214,6 +228,7 @@ export const IOS_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "Lunar", name: "Lunar",
@ -231,6 +246,7 @@ export const IOS_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
voyagerApp, voyagerApp,
thunderApp, thunderApp,
@ -251,6 +267,7 @@ export const IOS_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
]; ];
@ -266,6 +283,7 @@ export const WEB_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "Photon", name: "Photon",
@ -279,6 +297,7 @@ export const WEB_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "Alexandrite", name: "Alexandrite",
@ -293,6 +312,7 @@ export const WEB_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
{ {
name: "lemmyBB", name: "lemmyBB",
@ -305,6 +325,7 @@ export const WEB_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
]; ];
@ -320,5 +341,6 @@ export const CLI_APPS: AppDetails[] = [
icon: "github", icon: "github",
}, },
], ],
sourceType: SourceType.Open,
}, },
]; ];

View file

@ -10,6 +10,7 @@ import {
AppLink, AppLink,
CLI_APPS, CLI_APPS,
IOS_APPS, IOS_APPS,
SourceType,
WEB_APPS, WEB_APPS,
} from "./app-definitions"; } from "./app-definitions";
import { Icon } from "./icon"; import { Icon } from "./icon";
@ -67,6 +68,12 @@ const AppDetailsCard = ({ app }: AppDetailsCardProps) => (
className="rounded-xl max-h-96 mb-2" className="rounded-xl max-h-96 mb-2"
/> />
<p className="text-sm text-gray-300 mb-2">{app.description}</p> <p className="text-sm text-gray-300 mb-2">{app.description}</p>
{app.sourceType == SourceType.Closed && (
<div className="alert alert-warning">
<Icon icon="alert-octagon" />
<span>{i18n.t("closed_source_warning")}</span>
</div>
)}
<AppDetailsButtons links={app.links} /> <AppDetailsButtons links={app.links} />
</div> </div>
</div> </div>