diff --git a/apps/client/src/common/components/buttons/Button.module.scss b/apps/client/src/common/components/buttons/Button.module.scss index 1d829ef7f..a43aaddd0 100644 --- a/apps/client/src/common/components/buttons/Button.module.scss +++ b/apps/client/src/common/components/buttons/Button.module.scss @@ -20,6 +20,11 @@ opacity: 0.4; cursor: not-allowed; } + + &:focus-visible { + outline: 2px solid $blue-500; + outline-offset: 2px; + } } .small { diff --git a/apps/client/src/common/components/checkbox/Checkbox.module.scss b/apps/client/src/common/components/checkbox/Checkbox.module.scss new file mode 100644 index 000000000..6fce73d69 --- /dev/null +++ b/apps/client/src/common/components/checkbox/Checkbox.module.scss @@ -0,0 +1,50 @@ +.checkbox { + box-sizing: border-box; + display: flex; + width: 1rem; + height: 1rem; + align-items: center; + justify-content: center; + border-radius: $component-border-radius-sm; + + &[data-unchecked] { + background-color: $gray-1100; + + &:hover:not(:disabled) { + background: $gray-1000; + } + &:active:not(:disabled) { + background: $gray-1200; + } + } + + &[data-checked] { + background-color: $blue-500; + + &:hover:not(:disabled) { + background: $blue-400; + } + &:active:not(:disabled) { + background: $blue-600; + } + } + + &:disabled { + opacity: 0.4; + cursor: not-allowed; + } + + &:focus-visible { + outline: 2px solid $blue-500; + outline-offset: 2px; + } +} + +.indicator { + display: flex; + color: $ui-white; + + &[data-unchecked] { + display: none; + } +} diff --git a/apps/client/src/common/components/checkbox/Checkbox.tsx b/apps/client/src/common/components/checkbox/Checkbox.tsx new file mode 100644 index 000000000..8345563c0 --- /dev/null +++ b/apps/client/src/common/components/checkbox/Checkbox.tsx @@ -0,0 +1,14 @@ +import { IoCheckmark } from 'react-icons/io5'; +import { Checkbox as BaseCheckbox } from '@base-ui-components/react/checkbox'; + +import style from './Checkbox.module.scss'; + +export default function Checkbox(checkboxProps: BaseCheckbox.Root.Props) { + return ( + + + + + + ); +} diff --git a/apps/client/src/common/components/input/input/Input.module.scss b/apps/client/src/common/components/input/input/Input.module.scss index c0ab1a5b0..c72eee9a9 100644 --- a/apps/client/src/common/components/input/input/Input.module.scss +++ b/apps/client/src/common/components/input/input/Input.module.scss @@ -1,7 +1,6 @@ .input { box-sizing: border-box; - background-color: $gray-1200; font-size: 1rem; font-weight: 400; color: $gray-200; @@ -31,6 +30,15 @@ } } +.subtle { + background-color: $gray-1200; +} + +.ghosted { + background-color: transparent; + padding: 0; +} + .medium { height: 2rem; } diff --git a/apps/client/src/common/components/input/input/Input.tsx b/apps/client/src/common/components/input/input/Input.tsx index e72f84bd5..00695bac3 100644 --- a/apps/client/src/common/components/input/input/Input.tsx +++ b/apps/client/src/common/components/input/input/Input.tsx @@ -5,7 +5,7 @@ import { cx } from '../../../utils/styleUtils'; import style from './Input.module.scss'; export interface InputProps extends InputHTMLAttributes { - variant?: 'subtle'; + variant?: 'subtle' | 'ghosted'; height?: 'medium' | 'large'; fluid?: boolean; } @@ -20,6 +20,7 @@ const Input = forwardRef(function Input( type='text' autoCorrect='off' autoComplete='off' + spellCheck='false' className={cx([style.input, style[variant], style[height], fluid && style.fluid, className])} {...inputProps} /> diff --git a/apps/client/src/views/cuesheet/CuesheetPage.tsx b/apps/client/src/views/cuesheet/CuesheetPage.tsx index 654e5f806..53c0ae440 100644 --- a/apps/client/src/views/cuesheet/CuesheetPage.tsx +++ b/apps/client/src/views/cuesheet/CuesheetPage.tsx @@ -1,7 +1,9 @@ import { useCallback, useMemo, useState } from 'react'; import { IoApps, IoSettingsOutline } from 'react-icons/io5'; -import { IconButton, Modal, ModalContent, ModalOverlay, useDisclosure } from '@chakra-ui/react'; +import { Modal, ModalContent, ModalOverlay } from '@chakra-ui/react'; +import { useDisclosure } from '@mantine/hooks'; +import IconButton from '../../common/components/buttons/IconButton'; import NavigationMenu from '../../common/components/navigation-menu/NavigationMenu'; import useViewEditor from '../../common/components/navigation-menu/useViewEditor'; import EmptyPage from '../../common/components/state/EmptyPage'; @@ -21,12 +23,11 @@ import { cuesheetOptions } from './cuesheet.options'; import styles from './CuesheetPage.module.scss'; export default function CuesheetPage() { - // TODO: can we use the normalised rundown for the table? const { data: flatRundown, status: rundownStatus } = useFlatRundown(); const { data: customFields, status: customFieldStatus } = useCustomFields(); const { showEditFormDrawer, isViewLocked } = useViewEditor({ isLockable: true }); - const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure(); - const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure(); + const [isMenuOpen, menuHandler] = useDisclosure(); + const [isEventEditorOpen, eventEditorHandler] = useDisclosure(); const [eventId, setEventId] = useState(null); const columns = useMemo(() => makeCuesheetColumns(customFields), [customFields]); @@ -40,13 +41,13 @@ export default function CuesheetPage() { (eventId: string | null) => { if (eventId) { setEventId(eventId); - onEventEditorOpen(); + eventEditorHandler.open(); } else { setEventId(null); - onEventEditorClose(); + eventEditorHandler.close(); } }, - [onEventEditorClose, onEventEditorOpen], + [eventEditorHandler], ); if (!customFields || !flatRundown || rundownStatus === 'pending' || customFieldStatus === 'pending') { @@ -55,32 +56,34 @@ export default function CuesheetPage() { return ( <> - +
- + } - onClick={onOpen} - isDisabled={isViewLocked} - /> + variant='subtle-white' + size='xlarge' + onClick={menuHandler.open} + disabled={isViewLocked} + > + + } + variant='subtle-white' + size='xlarge' onClick={showEditFormDrawer} - isDisabled={isViewLocked} - /> + disabled={isViewLocked} + > + + diff --git a/apps/client/src/views/cuesheet/cuesheet-dnd/CuesheetDnd.tsx b/apps/client/src/views/cuesheet/cuesheet-dnd/CuesheetDnd.tsx index 4960f1a60..2a76487f3 100644 --- a/apps/client/src/views/cuesheet/cuesheet-dnd/CuesheetDnd.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-dnd/CuesheetDnd.tsx @@ -17,9 +17,7 @@ interface CuesheetDndProps { columns: ColumnDef[]; } -export default function CuesheetDnd(props: PropsWithChildren) { - const { columns, children } = props; - +export default function CuesheetDnd({ columns, children }: PropsWithChildren) { const { columnOrder, saveColumnOrder } = useColumnManager(columns); const sensors = useSensors( diff --git a/apps/client/src/views/cuesheet/cuesheet-table/CuesheetTable.tsx b/apps/client/src/views/cuesheet/cuesheet-table/CuesheetTable.tsx index a2f636f9e..a40cdd71d 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/CuesheetTable.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/CuesheetTable.tsx @@ -21,9 +21,7 @@ interface CuesheetTableProps { showModal: (eventId: MaybeString) => void; } -export default function CuesheetTable(props: CuesheetTableProps) { - const { data, columns, showModal } = props; - +export default function CuesheetTable({ data, columns, showModal }: CuesheetTableProps) { const { updateEntry, updateTimer } = useEntryActions(); const { followSelected, showDelayedTimes, hideTableSeconds } = useCuesheetOptions(); const { columnVisibility, columnOrder, columnSizing, resetColumnOrder, setColumnVisibility, setColumnSizing } = diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/BlockRow.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/BlockRow.tsx index 0c6f0aa14..b5f3a3c39 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/BlockRow.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/BlockRow.tsx @@ -10,8 +10,7 @@ interface BlockRowProps { columnCount: number; } -function BlockRow(props: BlockRowProps) { - const { hidePast, title, columnCount } = props; +function BlockRow({ hidePast, title, columnCount }: BlockRowProps) { const { currentBlockId } = useCurrentBlockId(); const firstCellRef = useRef(null); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetBody.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetBody.tsx index 43e6c56d2..920fe46b0 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetBody.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetBody.tsx @@ -18,9 +18,7 @@ interface CuesheetBodyProps { table: Table; } -export default function CuesheetBody(props: CuesheetBodyProps) { - const { rowModel, selectedRef, table } = props; - +export default function CuesheetBody({ rowModel, selectedRef, table }: CuesheetBodyProps) { const { selectedEventId } = useSelectedEventId(); const { hideDelays, hidePast } = useCuesheetOptions(); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetHeader.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetHeader.tsx index 15511bafc..7bf1165fe 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetHeader.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/CuesheetHeader.tsx @@ -13,8 +13,7 @@ interface CuesheetHeaderProps { headerGroups: HeaderGroup[]; } -export default function CuesheetHeader(props: CuesheetHeaderProps) { - const { headerGroups } = props; +export default function CuesheetHeader({ headerGroups }: CuesheetHeaderProps) { const { hideIndexColumn, showActionMenu } = useCuesheetOptions(); return ( diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DelayRow.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DelayRow.tsx index b7e842b29..3449ea2b7 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DelayRow.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DelayRow.tsx @@ -8,8 +8,7 @@ interface DelayRowProps { duration: number; } -function DelayRow(props: DelayRowProps) { - const { duration } = props; +function DelayRow({ duration }: DelayRowProps) { const delayTime = millisToDelayString(duration, 'expanded'); return ( diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DurationInput.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DurationInput.tsx index 3ecd2ed5c..1d9d63a46 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DurationInput.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/DurationInput.tsx @@ -17,9 +17,13 @@ interface ParentFocusableInput extends HTMLInputElement { export default memo(DurationInput); -function DurationInput(props: PropsWithChildren) { - const { initialValue, lockedValue, delayed, onSubmit, children } = props; - +function DurationInput({ + initialValue, + lockedValue, + delayed, + onSubmit, + children, +}: PropsWithChildren) { const [isEditing, setIsEditing] = useState(false); const [value, setValue] = useState(initialValue); const inputRef = useRef(null); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EditableImage.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EditableImage.tsx index efc5b242e..3a09fda2a 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EditableImage.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EditableImage.tsx @@ -1,5 +1,6 @@ import { memo } from 'react'; -import { Input } from '@chakra-ui/react'; + +import Input from '../../../../common/components/input/input/Input'; import style from './EditableImage.module.scss'; @@ -10,9 +11,7 @@ interface EditableImageProps { export default memo(EditableImage); -function EditableImage(props: EditableImageProps) { - const { initialValue, updateValue } = props; - +function EditableImage({ initialValue, updateValue }: EditableImageProps) { const handleUpdate = (newValue: string) => { if (newValue === initialValue) { return; @@ -26,10 +25,8 @@ function EditableImage(props: EditableImageProps) { if (!initialValue) { return ( handleUpdate(event.currentTarget.value)} onKeyDown={(event) => { @@ -38,8 +35,6 @@ function EditableImage(props: EditableImageProps) { } }} defaultValue={initialValue} - spellCheck={false} - autoComplete='off' /> ); } diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EventRow.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EventRow.tsx index e0cf99180..d2db1b4f4 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EventRow.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/EventRow.tsx @@ -39,8 +39,7 @@ export default memo(EventRow, (prevProps, nextProps) => { ); }); -function EventRow(props: EventRowProps) { - const { rowId, event, eventIndex, rowIndex, isPast, selectedRef, rowBgColour, table } = props; +function EventRow({ rowId, event, eventIndex, rowIndex, isPast, selectedRef, rowBgColour, table }: EventRowProps) { const { hideIndexColumn, showActionMenu } = useCuesheetOptions(); const ownRef = useRef(null); const [isVisible, setIsVisible] = useState(false); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/MultiLineCell.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/MultiLineCell.tsx index 9a9c5ec67..7bf55718c 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/MultiLineCell.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/MultiLineCell.tsx @@ -10,8 +10,7 @@ interface MultiLineCellProps { export default memo(MultiLineCell); -function MultiLineCell(props: MultiLineCellProps) { - const { initialValue, handleUpdate } = props; +function MultiLineCell({ initialValue, handleUpdate }: MultiLineCellProps) { const ref = useRef(null); const submitCallback = useCallback((newValue: string) => handleUpdate(newValue), [handleUpdate]); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/SingleLineCell.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/SingleLineCell.tsx index 6eb546291..9445b80cb 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/SingleLineCell.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/SingleLineCell.tsx @@ -1,6 +1,6 @@ import { forwardRef, memo, useCallback, useImperativeHandle, useRef } from 'react'; -import { Input } from '@chakra-ui/react'; +import Input from '../../../../common/components/input/input/Input'; import useReactiveTextInput from '../../../../common/components/input/text-input/useReactiveTextInput'; interface SingleLineCellProps { @@ -10,50 +10,47 @@ interface SingleLineCellProps { handleCancelUpdate?: () => void; } -const SingleLineCell = forwardRef((props: SingleLineCellProps, inputRef) => { - const { initialValue, allowSubmitSameValue, handleUpdate, handleCancelUpdate } = props; - const ref = useRef(null); - const submitCallback = useCallback((newValue: string) => handleUpdate(newValue), [handleUpdate]); +const SingleLineCell = forwardRef( + ({ initialValue, allowSubmitSameValue, handleUpdate, handleCancelUpdate }: SingleLineCellProps, inputRef) => { + const ref = useRef(null); + const submitCallback = useCallback((newValue: string) => handleUpdate(newValue), [handleUpdate]); - const { value, onChange, onBlur, onKeyDown } = useReactiveTextInput(initialValue, submitCallback, ref, { - allowSubmitSameValue, - allowKeyboardNavigation: true, - submitOnEnter: true, // single line should submit on enter - submitOnCtrlEnter: true, - onCancelUpdate: handleCancelUpdate, - }); + const { value, onChange, onBlur, onKeyDown } = useReactiveTextInput(initialValue, submitCallback, ref, { + allowSubmitSameValue, + allowKeyboardNavigation: true, + submitOnEnter: true, // single line should submit on enter + submitOnCtrlEnter: true, + onCancelUpdate: handleCancelUpdate, + }); - // expose a subset of the methods to the parent - useImperativeHandle(inputRef, () => { - return { - focus() { - ref.current?.focus(); - }, - select() { - ref.current?.select(); - }, - focusParentElement() { - ref.current?.parentElement?.focus(); - }, - }; - }, [ref]); + // expose a subset of the methods to the parent + useImperativeHandle(inputRef, () => { + return { + focus() { + ref.current?.focus(); + }, + select() { + ref.current?.select(); + }, + focusParentElement() { + ref.current?.parentElement?.focus(); + }, + }; + }, [ref]); - return ( - - ); -}); + return ( + + ); + }, +); SingleLineCell.displayName = 'SingleLineCell'; diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TextLikeInput.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TextLikeInput.tsx index 9c23fad7a..ee0415756 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TextLikeInput.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TextLikeInput.tsx @@ -18,9 +18,9 @@ const TextLikeInput = forwardRef((props: PropsWithChildren, return { focusParentElement() { ref.current?.parentElement?.focus(); - } - } - }) + }, + }; + }); return (
diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TimeInput.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TimeInput.tsx index 29af203aa..f4c914da0 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TimeInput.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-elements/TimeInput.tsx @@ -19,9 +19,13 @@ interface ParentFocusableInput extends HTMLInputElement { export default memo(TimeInputDuration); -function TimeInputDuration(props: PropsWithChildren) { - const { initialValue, lockedValue, delayed, onSubmit, children } = props; - +function TimeInputDuration({ + initialValue, + lockedValue, + delayed, + onSubmit, + children, +}: PropsWithChildren) { const [isEditing, setIsEditing] = useState(false); const [value, setValue] = useState(initialValue); const inputRef = useRef(null); diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenu.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenu.tsx index 4d6c2055c..740cad7a1 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenu.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenu.tsx @@ -10,8 +10,7 @@ interface CuesheetTableMenuProps { export default memo(CuesheetTableMenu); -function CuesheetTableMenu(props: CuesheetTableMenuProps) { - const { showModal } = props; +function CuesheetTableMenu({ showModal }: CuesheetTableMenuProps) { const { isOpen, eventId, entryIndex, position, closeMenu } = useCuesheetTableMenu(); return ( diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenuActions.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenuActions.tsx index aee6eb793..c24edb12a 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenuActions.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-menu/CuesheetTableMenuActions.tsx @@ -11,8 +11,7 @@ interface CuesheetTableMenuActionsProps { showModal: (entryId: string) => void; } -export default function CuesheetTableMenuActions(props: CuesheetTableMenuActionsProps) { - const { eventId, entryIndex, showModal } = props; +export default function CuesheetTableMenuActions({ eventId, entryIndex, showModal }: CuesheetTableMenuActionsProps) { const { addEntry, getEntryById, move, deleteEntry } = useEntryActions(); const handleCloneEvent = () => { diff --git a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-settings/CuesheetTableSettings.tsx b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-settings/CuesheetTableSettings.tsx index 943a5b51c..157bca0e6 100644 --- a/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-settings/CuesheetTableSettings.tsx +++ b/apps/client/src/views/cuesheet/cuesheet-table/cuesheet-table-settings/CuesheetTableSettings.tsx @@ -1,18 +1,13 @@ import { memo, ReactNode } from 'react'; -import { Button, Checkbox } from '@chakra-ui/react'; import { Column } from '@tanstack/react-table'; import { OntimeEntry } from 'ontime-types'; +import Button from '../../../../common/components/buttons/Button'; +import Checkbox from '../../../../common/components/checkbox/Checkbox'; import * as Editor from '../../../../common/components/editor-utils/EditorUtils'; import style from './CuesheetTableSettings.module.scss'; -// reusable button styles -const buttonProps = { - size: 'xs', - variant: 'ontime-subtle', -}; - interface CuesheetTableSettingsProps { columns: Column[]; handleResetResizing: () => void; @@ -20,9 +15,12 @@ interface CuesheetTableSettingsProps { handleClearToggles: () => void; } -function CuesheetTableSettings(props: CuesheetTableSettingsProps) { - const { columns, handleResetResizing, handleResetReordering, handleClearToggles } = props; - +function CuesheetTableSettings({ + columns, + handleResetResizing, + handleResetReordering, + handleClearToggles, +}: CuesheetTableSettingsProps) { return (
@@ -32,14 +30,10 @@ function CuesheetTableSettings(props: CuesheetTableSettingsProps) { const columnHeader = column.columnDef.header; const visible = column.getIsVisible(); return ( - + ); })}
@@ -47,13 +41,13 @@ function CuesheetTableSettings(props: CuesheetTableSettingsProps) {
Reset Options
- - -
diff --git a/apps/client/src/views/editor/Editor.tsx b/apps/client/src/views/editor/Editor.tsx index b6cb48b3c..9a9aa220b 100644 --- a/apps/client/src/views/editor/Editor.tsx +++ b/apps/client/src/views/editor/Editor.tsx @@ -1,8 +1,8 @@ import { lazy, useCallback, useEffect } from 'react'; import { IoApps, IoClose, IoSettingsOutline } from 'react-icons/io5'; -import { IconButton, useDisclosure } from '@chakra-ui/react'; -import { useHotkeys } from '@mantine/hooks'; +import { useDisclosure, useHotkeys } from '@mantine/hooks'; +import IconButton from '../../common/components/buttons/IconButton'; import NavigationMenu from '../../common/components/navigation-menu/NavigationMenu'; import { useElectronListener } from '../../common/hooks/useElectronEvent'; import { useWindowTitle } from '../../common/hooks/useWindowTitle'; @@ -20,7 +20,7 @@ const MessageControl = lazy(() => import('../../features/control/message/Message export default function Editor() { const { isOpen: isSettingsOpen, setLocation, close } = useAppSettingsNavigation(); - const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure(); + const [isOpen, handler] = useDisclosure(); useWindowTitle('Editor'); @@ -49,22 +49,19 @@ export default function Editor() { return (
- + - } - onClick={onOpen} - /> + + + : } + variant={isSettingsOpen ? 'subtle' : 'subtle-white'} + size='xlarge' onClick={toggleSettings} - /> + > + {isSettingsOpen ? : } + {isSettingsOpen ? (