Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new plugin: StatusPresets #2924

Open
wants to merge 33 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a9e9571
adding StatusPresets
programminglaboratorys Sep 18, 2024
5402c0a
fixed menu by set-status-submenu
programminglaboratorys Sep 18, 2024
5c35f1d
fixed status icon and renderRememberButton
programminglaboratorys Sep 18, 2024
cac9aff
delete StatusMenuItem
programminglaboratorys Sep 18, 2024
096ee05
attempt to make it removal
programminglaboratorys Sep 21, 2024
69b53f1
fixes and made use of UserSettingApi
programminglaboratorys Sep 27, 2024
e31d400
Merge branch 'Vendicated:main' into statusPresets
programminglaboratorys Sep 27, 2024
0d289a3
Merge branch 'statusPresets' of https://github.com/programminglaborat…
programminglaboratorys Sep 27, 2024
5be2fb5
no longer using ContextMenuAPI and refactoring
programminglaboratorys Sep 27, 2024
adc0d2f
minor tweaks
programminglaboratorys Sep 27, 2024
4ccf12f
using findbyCodeLazy for setStatus
programminglaboratorys Sep 29, 2024
9f25f34
better formatting for render component and patch improvment
programminglaboratorys Sep 30, 2024
1571cd1
minor changes
programminglaboratorys Sep 30, 2024
f7d790a
ui clean up
programminglaboratorys Sep 30, 2024
b38dc1a
code cleean up
programminglaboratorys Sep 30, 2024
bb64c9b
description and name change
programminglaboratorys Sep 30, 2024
bba595b
remove setStatusFunc wrapper
programminglaboratorys Sep 30, 2024
9e77aeb
add style
programminglaboratorys Sep 30, 2024
f5f7901
reorder veriables
programminglaboratorys Sep 30, 2024
8ed2038
remember button redesgin
programminglaboratorys Sep 30, 2024
aeff450
improving patchs
programminglaboratorys Sep 30, 2024
20ec156
Merge branch 'dev' into statusPresets
programminglaboratorys Sep 30, 2024
63298f7
use strings for finds
programminglaboratorys Oct 1, 2024
3906b56
change icon on hover
programminglaboratorys Oct 1, 2024
c651721
apply status style to StatusIcon
programminglaboratorys Oct 1, 2024
65bf6d4
add a README.md
programminglaboratorys Oct 1, 2024
f1aba76
force re-render on removing a custom status
programminglaboratorys Oct 1, 2024
4fc7f6e
fix click issues
programminglaboratorys Oct 1, 2024
4f5f157
disable menu items when user doesn't have nitro
programminglaboratorys Oct 1, 2024
5c0f160
re-implementing setStatus
programminglaboratorys Oct 1, 2024
c7077de
fix settings issue
programminglaboratorys Oct 1, 2024
545ee5d
using useForceUpdater to force re-render
programminglaboratorys Oct 2, 2024
047ff04
adding to constants
programminglaboratorys Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change icon on hover
  • Loading branch information
programminglaboratorys committed Oct 1, 2024
commit 3906b56140b835d0b1f56cf14d8d3d0b181fd454
13 changes: 9 additions & 4 deletions src/plugins/statusPresets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ const customStatusSettings = getUserSettingLazy("status", "customStatus");

const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings?.updateSetting(null)}><Icons.CircleXIcon size="sm" /></Clickable>;

const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
return isHovering ?
<Icons.CircleXIcon size="sm" style={{ marginTop: "4px" }} />
: (status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />);
}

const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
const [isHovering, setIsHovering] = useState(false);
const handleMouseOver = () => {
setIsHovering(true);
Expand All @@ -82,8 +87,8 @@ const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
type: Toasts.Type.SUCCESS,
id: Toasts.genId()
});
}}>{status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />}</Clickable>
<div className={StatusStyles.status} style={{ marginLeft: "5px" }}>{status.text}</div>
}}><StatusIcon isHovering={isHovering} status={status} /></Clickable>
<div className={StatusStyles.status} style={{ marginLeft: "2px" }}>{status.text}</div>
</div >;
};

Expand All @@ -102,7 +107,7 @@ const StatusSubMenuComponent = () => {

export default definePlugin({
name: "StatusPresets",
description: "Allows you to remember your status and set it later",
description: "Allows you to remember your statuses and set them later",
authors: [Devs.Dolfies],
settings: settings,
dependencies: ["UserSettingsAPI"],
Expand Down