mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 08:46:25 +00:00
feat(mediaPlaybackSpeed): add tooltip
This commit is contained in:
parent
7708172b12
commit
b4e71fe412
1 changed files with 33 additions and 26 deletions
|
@ -10,7 +10,7 @@ import { classNameFactory } from "@api/Styles";
|
||||||
import { makeRange } from "@components/PluginSettings/components";
|
import { makeRange } from "@components/PluginSettings/components";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { ContextMenuApi, FluxDispatcher, Menu, React } from "@webpack/common";
|
import { ContextMenuApi, FluxDispatcher, Menu, React, Tooltip } from "@webpack/common";
|
||||||
import { RefObject } from "react";
|
import { RefObject } from "react";
|
||||||
|
|
||||||
import SpeedIcon from "./components/SpeedIcon";
|
import SpeedIcon from "./components/SpeedIcon";
|
||||||
|
@ -33,7 +33,13 @@ export default definePlugin({
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button className={cl("icon")} onClick={e => {
|
<Tooltip text="Playback speed">
|
||||||
|
{({ onMouseEnter, onMouseLeave }) => (
|
||||||
|
<button
|
||||||
|
className={cl("icon")}
|
||||||
|
onMouseEnter={onMouseEnter}
|
||||||
|
onMouseLeave={onMouseLeave}
|
||||||
|
onClick={e => {
|
||||||
ContextMenuApi.openContextMenu(e, () =>
|
ContextMenuApi.openContextMenu(e, () =>
|
||||||
<Menu.Menu
|
<Menu.Menu
|
||||||
navId="playback-speed"
|
navId="playback-speed"
|
||||||
|
@ -52,12 +58,13 @@ export default definePlugin({
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Menu.MenuGroup>
|
</Menu.MenuGroup>
|
||||||
|
|
||||||
</Menu.Menu>
|
</Menu.Menu>
|
||||||
);
|
);
|
||||||
}}>
|
}}>
|
||||||
<SpeedIcon />
|
<SpeedIcon/>
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue