null}
- caption={CaptionToolbarButtons["fullscreenOn"]}
+ type="fullscreen"
+ onClick={() => {
+ if(!document.fullscreenElement) {
+ document.documentElement.requestFullscreen();
+ } else {
+ document.exitFullscreen();
+ }
+ }}
+ caption={CaptionToolbarButtons['fullscreen on']}
+ active={true}
+ isCaption={true}
/>
console.log('click'),
+ isCaption: true
},
{
type: "user self",
- onClick: () => console.log('click')
- },
- {
- type: "user guest",
- onClick: () => console.log('click')
+ onClick: () => console.log('click'),
+ isCaption: true
},
{
type: "user guest",
onClick: () => console.log('click'),
- isNotification: true
+ isCaption: true
+ },
+ {
+ type: "user guest",
+ onClick: () => console.log('click'),
+ isNotification: true,
+ isCaption: true
}
]}
/>
@@ -45,12 +119,16 @@ export const Toolbar:React.FC = React.memo((props) => {
console.log('click')
+ type: "control",
+ onClick: () => console.log('click'),
+ active: true,
+ isCaption: true
},
{
type: "micro",
- onClick: () => console.log('click')
+ onClick: () => console.log('click'),
+ active: false,
+ isCaption: true
}
]}
/>
@@ -58,12 +136,14 @@ export const Toolbar:React.FC = React.memo((props) => {
type="share"
onClick={() => console.log('click')}
caption={CaptionToolbarButtons["share"]}
+ isCaption={true}
/>
- null}
caption={CaptionToolbarButtons["exit"]}
+ isCaption={true}
/>
diff --git a/src/components/mainScreen/toolbar/toolbarButton.tsx b/src/components/mainScreen/toolbar/toolbarButton.tsx
index 1d836b4..2ca5256 100644
--- a/src/components/mainScreen/toolbar/toolbarButton.tsx
+++ b/src/components/mainScreen/toolbar/toolbarButton.tsx
@@ -1,17 +1,21 @@
import React, { useState } from "react";
import { TypeToolbarButtons } from "./typeButtons";
+import { CaptionToolbarButtons } from "./typeCaptionButtons";
type TProps = {
onClick: () => void
type: TypeToolbarButtons
- isNotification?: boolean
+ isCaption: boolean
caption: string
+ active?: boolean
+ isNotification?: boolean
}
export const ToolbarButton:React.FC