Skip to content

Commit

Permalink
I'm dyslexic, it's personalize now
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitslayn committed Jun 7, 2024
1 parent c351547 commit 9af55e1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
18 changes: 16 additions & 2 deletions plugins/btw.bitslayn.channelIcons/src/TabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import Divider from "replugged/components";
import { Divider, Text } from "replugged/components";

export const TabBar = ({ tabs }) => {
const [activeTab, setActiveTab] = useState(tabs[0].id);
Expand Down Expand Up @@ -61,7 +61,21 @@ export const TabBar = ({ tabs }) => {
</div>
)
)}
<Divider.Divider></Divider.Divider>
{/* <Text.Normal
style={{
position: "absolute",
top: "52px",
right: "254px",
color: "var(--control-brand-foreground)",
}}>
{
tabs.map(tab => activeTab === tab.id && tab.element().props.children.length)[
activeTab - 1
]
}{" "}
icons
</Text.Normal> */}
<Divider></Divider>
</div>
{tabs.map(tab => activeTab === tab.id && tab.element())}
</div>
Expand Down
9 changes: 5 additions & 4 deletions plugins/btw.bitslayn.channelIcons/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function openEditor(data: any): void {
delete config.get("coloredChannels")[channel.id]; // this was that fix
}
}}
header={`Customize #${channel.name}`}
header={`Personalize #${channel.name}`}
className="channelEditor"
{...props}>
<div // Content
Expand Down Expand Up @@ -271,9 +271,9 @@ export function start(): void {
injectNamedChannelStyles(channel.name, channel.icon);
});*/

// eslint-disable-next-line consistent-return
inject.utils.addMenuItem(ContextMenuTypes.ChannelContext, (data: any) => {
const { channel } = data;
console.log(channel);
// the code below gives a random modern icon uwu ;3 rawr x3 *waggles tail*
const Object = group1Array[randomNumber(Icons.length)];
let RandomIcon: ComponentType<any>;
Expand All @@ -287,7 +287,7 @@ export function start(): void {
return (
<MenuItem
id={`customize-channel-${channel.id}`}
label="Customize Channel"
label="Personalize Channel"
/* the code below gives discord an icon to display */
icon={RandomIcon}
/* the code above gives discord an icon to display */
Expand All @@ -296,6 +296,7 @@ export function start(): void {
);
}
});

inject.after(Header.default, "Title", (a: any) => {
const headerObj = a?.[0]?.children?.props?.children;
if (headerObj && getCurrentChannelObject()?.color) {
Expand Down Expand Up @@ -386,7 +387,7 @@ export function Settings(): JSX.Element {
note={"Apply icons to channels automatically based on a predefined list of names."}>
Preset Icons WIP
</FormSwitch>
<components.Category title="Customized Channels" note="View or remove customized channels.">
<components.Category title="Personalized Channels" note="View or remove channel styles.">
<div>
{Object.entries(coloredChannels).map(([channelId]: [string, ColoredChannel]) => (
<div style={{ marginBottom: "20px" }}>
Expand Down
6 changes: 1 addition & 5 deletions plugins/btw.bitslayn.channelIcons/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,8 @@
height: 20px;
border: none;
}
.channelTabBar > div:last-child > .channelTabBarItem {
/* OCD, problem? */
margin-right: unset;
}
.channelTabBarItem {
margin-right: 10px;
margin: 0px 5px 0px 5px;
padding: 5px 10px;
cursor: pointer;
color: white;
Expand Down

0 comments on commit 9af55e1

Please sign in to comment.