change(ui): added noGrid param for live sessions (#1729)

This commit is contained in:
Shekar Siri 2023-11-29 18:15:55 +01:00 committed by GitHub
parent 7c9d07cca3
commit db6b00f9f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@ function Controls(props: any) {
// @ts-ignore ?? TODO
const { player, store } = React.useContext<ILivePlayerContext>(PlayerContext);
const [noControls, setNoControls] = React.useState(false);
const [noGrid, setNoGrid] = React.useState(false);
const { search } = useLocation();
const { jumpToLive } = player;
@ -66,6 +67,12 @@ function Controls(props: any) {
) {
setNoControls(true);
}
if (
(queryParams.has('noGrid') && queryParams.get('noGrid') === 'true')
) {
setNoGrid(true);
}
return () => {
document.removeEventListener('keydown', onKeyDown.bind(this));
};
@ -89,7 +96,7 @@ function Controls(props: any) {
<div className={styles.controls}>
<Timeline />
{!noControls ?
<div className={cn(styles.buttons, '!px-5 !pt-0')} data-is-live>
<div className={cn(styles.buttons, '!px-5 !pt-0')} data-is-live style={{ height: noGrid ? '40px' : ''}}>
<div className="flex items-center">
{!closedLive && (
<div className={styles.buttonsLeft}>
@ -101,7 +108,7 @@ function Controls(props: any) {
)}
</div>
{totalAssistSessions > 1 ? (
{totalAssistSessions > 1 && !noGrid ? (
<div>
<AssistSessionsTabs session={session} />
</div>