-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tarek
committed
Oct 11, 2023
1 parent
017bb9c
commit ac81ccc
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import SettingsIcon from '../../../icons/Settings'; | ||
import Dropdown from '../../../components/ui/Dropdown'; | ||
import Menu from '../../../components/ui/Menu'; | ||
import { FunctionComponent } from 'react'; | ||
import tw, { styled } from 'twin.macro'; | ||
|
||
const Styles = styled.div` | ||
${tw`z-10 px-2 py-1 absolute top-0 right-0 items-start flex flex-row-reverse`} | ||
button { | ||
${tw`text-gray-100 | ||
hover:text-gray-400 | ||
active:hover:text-gray-200 | ||
focus:text-gray-600 | ||
`} | ||
} | ||
`; | ||
|
||
interface Props { | ||
className?: string; | ||
isLooping: boolean; | ||
shouldAutostart: boolean; | ||
onChangeLoop: (enabled: boolean) => void; | ||
onChangeAutostart: (enabled: boolean) => void; | ||
} | ||
|
||
const MenuBar: FunctionComponent<Props> = ({ | ||
className, | ||
isLooping, | ||
shouldAutostart, | ||
onChangeLoop, | ||
onChangeAutostart, | ||
}) => { | ||
const content = ( | ||
<Menu> | ||
<Menu.Title>Player settings</Menu.Title> | ||
<Menu.Switch value={isLooping} onChange={onChangeLoop}> | ||
Loop | ||
</Menu.Switch> | ||
<Menu.Switch value={shouldAutostart} onChange={onChangeAutostart}> | ||
Autoplay | ||
</Menu.Switch> | ||
</Menu> | ||
); | ||
|
||
return ( | ||
<Styles className={className}> | ||
<Dropdown content={content}> | ||
<SettingsIcon /> | ||
</Dropdown> | ||
</Styles> | ||
); | ||
}; | ||
|
||
export default MenuBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters