Fix/table rerenders (#609)
* Fixed top bar rerenders * Fixed rerender on editable cell * Fix lint * asd * Fix --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
17
front/src/modules/ui/layout/top-bar/TableTopBarHotkeys.tsx
Normal file
17
front/src/modules/ui/layout/top-bar/TableTopBarHotkeys.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import { useScopedHotkeys } from '@/hotkeys/hooks/useScopedHotkeys';
|
||||
import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';
|
||||
|
||||
type OwnProps = {
|
||||
onAddButtonClick?: () => void;
|
||||
};
|
||||
|
||||
export function TopBarHotkeys({ onAddButtonClick }: OwnProps) {
|
||||
useScopedHotkeys(
|
||||
'c',
|
||||
() => onAddButtonClick?.(),
|
||||
InternalHotkeysScope.Table,
|
||||
[onAddButtonClick],
|
||||
);
|
||||
|
||||
return <></>;
|
||||
}
|
||||
@ -1,8 +1,6 @@
|
||||
import { ReactNode } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { useScopedHotkeys } from '@/hotkeys/hooks/useScopedHotkeys';
|
||||
import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';
|
||||
import { IconPlus } from '@/ui/icons/index';
|
||||
|
||||
import NavCollapseButton from '../navbar/NavCollapseButton';
|
||||
@ -51,8 +49,6 @@ type OwnProps = {
|
||||
};
|
||||
|
||||
export function TopBar({ title, icon, onAddButtonClick }: OwnProps) {
|
||||
useScopedHotkeys('c', () => onAddButtonClick?.(), InternalHotkeysScope.Table);
|
||||
|
||||
return (
|
||||
<>
|
||||
<TopBarContainer>
|
||||
|
||||
Reference in New Issue
Block a user