8f88605f32
* Fixed ActionBar paddings and added transition on button hover * Added recoil library for state management * Refactor table state with recoil : - Removed table internal states - Added refetchQueries to plug apollo store directly into tables - Added an action bar component that manages itself - Use recoil state and selector for row selection - Refactored Companies and People tables * Moved hook * Cleaned some files * Fix bug infinite re-compute table row selection --------- Co-authored-by: Charles Bochet <charles@twenty.com>
17 lines
454 B
TypeScript
17 lines
454 B
TypeScript
import { useSetRecoilState } from 'recoil';
|
|
import { currentRowSelectionState } from '../states/rowSelectionState';
|
|
import { useCallback, useMemo } from 'react';
|
|
|
|
export function useResetTableRowSelection() {
|
|
const setCurrentRowSelectionState = useSetRecoilState(
|
|
currentRowSelectionState,
|
|
);
|
|
|
|
return useCallback(
|
|
function resetCurrentRowSelection() {
|
|
setCurrentRowSelectionState({});
|
|
},
|
|
[setCurrentRowSelectionState],
|
|
);
|
|
}
|