change(ui): check for mobile project and hide live sessions and skip button
This commit is contained in:
parent
769d8851bb
commit
c1ef27fc9b
4 changed files with 18 additions and 17 deletions
|
|
@ -119,7 +119,6 @@ function Controls(props: any) {
|
|||
backTenSeconds={backTenSeconds}
|
||||
forthTenSeconds={forthTenSeconds}
|
||||
toggleSpeed={(speedIndex) => player.toggleSpeed(speedIndex)}
|
||||
toggleSkip={() => player.toggleSkip()}
|
||||
playButton={
|
||||
<PlayButton
|
||||
state={state}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ interface Props {
|
|||
backTenSeconds: () => void;
|
||||
forthTenSeconds: () => void;
|
||||
toggleSpeed: (speedIndex: number) => void;
|
||||
toggleSkip: () => void;
|
||||
toggleSkip?: () => void;
|
||||
sessionTz?: string;
|
||||
}
|
||||
|
||||
|
|
@ -80,15 +80,17 @@ function PlayerControls(props: Props) {
|
|||
disabled={disabled}
|
||||
speed={speed}
|
||||
/>
|
||||
<Button
|
||||
onClick={toggleSkip}
|
||||
disabled={disabled}
|
||||
size={'small'}
|
||||
className={'flex items-center font-semibold'}
|
||||
>
|
||||
{skip && <Icon name="check" size="24" />}
|
||||
<span>Skip Inactivity</span>
|
||||
</Button>
|
||||
{toggleSkip && (
|
||||
<Button
|
||||
onClick={toggleSkip}
|
||||
disabled={disabled}
|
||||
size={'small'}
|
||||
className={'flex items-center font-semibold'}
|
||||
>
|
||||
{skip && <Icon name="check" size="24" />}
|
||||
<span>Skip Inactivity</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ interface Props extends RouteComponentProps {
|
|||
|
||||
function SideMenu(props: Props) {
|
||||
const {
|
||||
location,
|
||||
location
|
||||
} = props;
|
||||
|
||||
const isPreferencesActive = location.pathname.includes('/client/');
|
||||
|
|
@ -58,7 +58,8 @@ function SideMenu(props: Props) {
|
|||
const modules = account.settings?.modules ?? [];
|
||||
const isAdmin = account.admin || account.superAdmin;
|
||||
const isEnterprise = account.edition === 'ee';
|
||||
const siteId = projectsStore.siteId
|
||||
const siteId = projectsStore.siteId;
|
||||
const isMobile = projectsStore.isMobile;
|
||||
|
||||
const [isModalVisible, setIsModalVisible] = React.useState(false);
|
||||
|
||||
|
|
@ -114,8 +115,7 @@ function SideMenu(props: Props) {
|
|||
item.key === MENU.FEATURE_FLAGS &&
|
||||
modules.includes(MODULES.FEATURE_FLAGS),
|
||||
item.key === MENU.NOTES && modules.includes(MODULES.NOTES),
|
||||
item.key === MENU.LIVE_SESSIONS &&
|
||||
modules.includes(MODULES.ASSIST),
|
||||
item.key === MENU.LIVE_SESSIONS && (modules.includes(MODULES.ASSIST) || isMobile),
|
||||
item.key === MENU.SESSIONS &&
|
||||
modules.includes(MODULES.OFFLINE_RECORDINGS),
|
||||
item.key === MENU.ALERTS && modules.includes(MODULES.ALERTS),
|
||||
|
|
@ -135,7 +135,7 @@ function SideMenu(props: Props) {
|
|||
hidden: allItemsHidden
|
||||
};
|
||||
});
|
||||
}, [isAdmin, isEnterprise, isPreferencesActive, modules, spotOnly]);
|
||||
}, [isAdmin, isEnterprise, isPreferencesActive, modules, spotOnly, siteId]);
|
||||
|
||||
React.useEffect(() => {
|
||||
const currentLocation = location.pathname;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export default class ProjectsStore {
|
|||
}
|
||||
|
||||
get isMobile() {
|
||||
return this.instance ? ['ios', 'android'].includes(this.instance.platform) : false;
|
||||
return this.active ? ['ios', 'android'].includes(this.active.platform) : false;
|
||||
}
|
||||
|
||||
getSiteId = () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue