* ui: start highlight ui * ui: tag items * ui: connecting highlights to notes api... * Highlight feature refinements (#2948) * ui: move clips player to foss, connect notes api to hl * ui: tune note/hl editing, prevent zoom slider body from jumping around * ui: safe check for tag * ui: fix thumbnail gen * ui: fix thumbnail gen * ui: make player modal wider, add shadow * ui: custom warn barge for clips * ui: swap icon for note event wrapper * ui: rm other, fix cancel * ui: moving around creation modal * ui: bg tint * ui: rm disabled for text btn * ui: fix ownership sorting * ui: close player on bg click * ui: fix query, fix min distance for default range * ui: move hl list header out of list comp * ui: spot list header segmented size * Various improvements in highlights (#2955) * ui: update hl in hlPanel comp * ui: rm debug * ui: fix icons file --------- Co-authored-by: Sudheer Salavadi <connect.uxmaster@gmail.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import React, {useContext} from 'react';
|
|
import {Switch, Tooltip} from ".store/antd-virtual-7db13b4af6/package";
|
|
import {CaretRightOutlined, PauseOutlined} from ".store/@ant-design-icons-virtual-de151eefe5/package";
|
|
import {useStore} from "@/mstore";
|
|
import {observer} from "mobx-react-lite";
|
|
import {IPlayerContext, PlayerContext} from "Components/Session/playerContext";
|
|
|
|
function AutoplayToggle() {
|
|
const {clipStore} = useStore();
|
|
const playerContext = React.useContext<IPlayerContext>(PlayerContext);
|
|
// const { player, store } = playerContext;
|
|
const { autoplay } = playerContext.store.get();
|
|
|
|
const handleToggle = () => {
|
|
console.log('Toggle Autoplay');
|
|
clipStore.toggleAutoplay();
|
|
}
|
|
|
|
return (
|
|
<Tooltip title="Toggle Autoplay" placement="bottom">
|
|
<Switch
|
|
className="custom-switch"
|
|
onChange={handleToggle}
|
|
checked={clipStore.autoplay}
|
|
checkedChildren={<CaretRightOutlined className="switch-icon"/>}
|
|
unCheckedChildren={<PauseOutlined className="switch-icon"/>}
|
|
/>
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
export default observer(AutoplayToggle);
|