Skip to content

Commit

Permalink
PlatformIndicators v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Strencher committed Dec 22, 2023
1 parent 36d5ab2 commit 5045c65
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
22 changes: 21 additions & 1 deletion PlatformIndicators/components/indicators.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ import usePlatformStores from "../modules/usePlatformStores";
import * as Icons from "./icons/Icons";
import {getStatusText} from "../modules/utils";

function getStatusColor(status) {
const {StatusTypes} = ModulesLibrary;

switch (status) {
case StatusTypes.ONLINE:
return Colors.Color.GREEN_360;
case StatusTypes.IDLE:
return Colors.Color.YELLOW_300;
case StatusTypes.DND:
return Colors.Color.RED_400;
case StatusTypes.STREAMING:
return Colors.Color.TWITCH;
case StatusTypes.INVISIBLE:
case StatusTypes.UNKNOWN:
case StatusTypes.OFFLINE:
default:
return Colors.Color.PRIMARY_400
}
}

export default function StatusIndicators({type, userId, size = 18, separator = false}) {
const state = usePlatformStores(userId, type);

Expand All @@ -24,7 +44,7 @@ export default function StatusIndicators({type, userId, size = 18, separator = f
{props => (
<Icon
text={getStatusText(key, status)}
style={{color: Colors.ColorDetails[ModulesLibrary.getStatusColor(status)]?.hex}}
style={{color: Colors.ColorDetails[getStatusColor(status)]?.hex}}
width={size}
height={size}
data-status={status}
Expand Down
7 changes: 4 additions & 3 deletions PlatformIndicators/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "APlatformIndicators",
"version": "1.5.1",
"version": "1.5.2",
"authors": [
{
"name": "Strencher",
Expand All @@ -14,13 +14,14 @@
"github_raw": "https://raw.githubusercontent.com/Strencher/BetterDiscordStuff/master/PlatformIndicators/APlatformIndicators.plugin.js",
"invite": "gvA2ree",
"changelogImage": "https://cdn.discordapp.com/attachments/672786846018961418/1053059354552696932/20th-century-fox-intro.png",
"changelogDate": "2022-12-15T23:00:00.000Z",
"changelogDate": "2023-12-22T09:25:34.788Z",
"changelog": [
{
"title": "Fixes",
"type": "fixed",
"items": [
"This was was rewritten and should work fully, again. If you notice any bugs, please file an issue on my github or create a forum post in my server about it!"
"Crashing discord",
"I'm sorry for the delay of the fix, will work on improving this in the future."
]
}
]
Expand Down

0 comments on commit 5045c65

Please sign in to comment.