-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: yet another plugin sheet redesign
- Loading branch information
Showing
27 changed files
with
426 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/core/ui/settings/pages/Plugins/models/UnifiedPluginModel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Author } from "@lib/addons/types"; | ||
|
||
|
||
export interface UnifiedPluginModel { | ||
id: string; | ||
name: string; | ||
description?: string; | ||
authors?: Array<Author>; | ||
icon?: string; | ||
|
||
isEnabled(): boolean; | ||
usePluginState(): void; | ||
isInstalled(): boolean; | ||
toggle(start: boolean): void | Promise<void>; | ||
resolveSheetComponent(): Promise<{ default: React.ComponentType<any>; }>; | ||
getPluginSettingsComponent(): React.ComponentType<any> | null | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import PluginReporter from "@core/reporter/PluginReporter"; | ||
import usePluginStatusColor from "@core/ui/settings/pages/Plugins/usePluginStatusColor"; | ||
import { PluginManager } from "@lib/addons/plugins"; | ||
import { Text } from "@metro/common/components"; | ||
import { View } from "react-native"; | ||
|
||
import { useStyles } from "./useStyles"; | ||
|
||
export function Badges(props: { id: string; }) { | ||
PluginReporter.useReporter(); | ||
|
||
const styles = useStyles(); | ||
const stageColor = usePluginStatusColor(props.id); | ||
|
||
const stage = PluginReporter.stages[props.id]; | ||
const isProxied = PluginManager.isProxied(props.id); | ||
|
||
return <View style={{ gap: 8, flexDirection: "row" }}> | ||
{[ | ||
{ text: stage, bg: stageColor }, | ||
isProxied && { text: "proxied" } | ||
].filter(x => x && typeof x === "object").map(badge => ( | ||
<Text | ||
variant="eyebrow" | ||
color={badge.bg ? "white" : "text-normal"} | ||
style={[styles.badge, badge.bg ? { backgroundColor: badge.bg } : null]} | ||
> | ||
{badge.text} | ||
</Text> | ||
))} | ||
</View>; | ||
} |
Oops, something went wrong.