mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +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 { Devs } from "@utils/constants";
|
||||
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 SpeedIcon from "./components/SpeedIcon";
|
||||
|
@ -33,7 +33,13 @@ export default definePlugin({
|
|||
};
|
||||
|
||||
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, () =>
|
||||
<Menu.Menu
|
||||
navId="playback-speed"
|
||||
|
@ -52,12 +58,13 @@ export default definePlugin({
|
|||
/>
|
||||
))}
|
||||
</Menu.MenuGroup>
|
||||
|
||||
</Menu.Menu>
|
||||
);
|
||||
}}>
|
||||
<SpeedIcon />
|
||||
<SpeedIcon/>
|
||||
</button>
|
||||
)}
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue