mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-06 23:09:08 +00:00
refactor: improvements to navigation
This commit is contained in:
committed by
Carlos Valente
parent
31d47ed1e5
commit
48fe6a980c
@@ -1,5 +1,6 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { useDisclosure } from '@chakra-ui/react';
|
import { useDisclosure } from '@chakra-ui/react';
|
||||||
|
import { useHotkeys } from '@mantine/hooks';
|
||||||
|
|
||||||
import FloatingNavigation from './FloatingNavigation';
|
import FloatingNavigation from './FloatingNavigation';
|
||||||
import NavigationMenu from './NavigationMenu';
|
import NavigationMenu from './NavigationMenu';
|
||||||
@@ -18,6 +19,8 @@ function ViewNavigationMenu(props: ViewNavigationMenuProps) {
|
|||||||
|
|
||||||
const toggleMenu = () => (isMenuOpen ? onMenuClose() : onMenuOpen());
|
const toggleMenu = () => (isMenuOpen ? onMenuClose() : onMenuOpen());
|
||||||
|
|
||||||
|
useHotkeys([['mod + ,', () => toggleMenu()]]);
|
||||||
|
|
||||||
if (isViewLocked) {
|
if (isViewLocked) {
|
||||||
return <ViewLockedIcon />;
|
return <ViewLockedIcon />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,6 @@
|
|||||||
|
|
||||||
&.collapsible {
|
&.collapsible {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-bottom: 1px solid $white-10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect, test } from '@playwright/test';
|
import { expect, type Page, test } from '@playwright/test';
|
||||||
|
|
||||||
test.describe.fixme('test view navigation feature', () => {
|
test.describe('test view navigation feature', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('http://localhost:4001/');
|
await page.goto('http://localhost:4001/');
|
||||||
page.locator('data-test-id=timer-view');
|
page.locator('data-test-id=timer-view');
|
||||||
@@ -71,9 +71,6 @@ test.describe.fixme('test view navigation feature', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
async function openNavigationMenu(page) {
|
async function openNavigationMenu(page: Page) {
|
||||||
// await page.mouse.move(Math.random() * 100, Math.random() * 100); FIXME: mouse.move dose not work in github actions
|
await page.keyboard.press('ControlOrMeta + ,');
|
||||||
await page.keyboard.press('T');
|
|
||||||
await page.getByRole('button', { name: 'toggle menu' }).click();
|
|
||||||
page.locator('data-test-id=navigation__menu');
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user