Display columns on Record Board (#3626)
* Display columns on Record board * Fix * Fix according to review * Fix
This commit is contained in:
@ -2,7 +2,7 @@ import { useRecoilState } from 'recoil';
|
||||
|
||||
import { useDropdownStates } from '@/ui/layout/dropdown/hooks/internal/useDropdownStates';
|
||||
import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope';
|
||||
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
|
||||
import { getScopeIdOrUndefinedFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdOrUndefinedFromComponentId';
|
||||
|
||||
export const useDropdown = (dropdownId?: string) => {
|
||||
const {
|
||||
@ -11,7 +11,7 @@ export const useDropdown = (dropdownId?: string) => {
|
||||
dropdownWidthState,
|
||||
isDropdownOpenState,
|
||||
} = useDropdownStates({
|
||||
dropdownScopeId: getScopeIdFromComponentId(dropdownId),
|
||||
dropdownScopeId: getScopeIdOrUndefinedFromComponentId(dropdownId),
|
||||
});
|
||||
|
||||
const {
|
||||
|
||||
@ -5,8 +5,7 @@ import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/get
|
||||
import { getState } from '@/ui/utilities/recoil-scope/utils/getState';
|
||||
|
||||
export const useClickOustideListenerStates = (componentId: string) => {
|
||||
// TODO: improve typing
|
||||
const scopeId = getScopeIdFromComponentId(componentId) ?? '';
|
||||
const scopeId = getScopeIdFromComponentId(componentId);
|
||||
|
||||
return {
|
||||
scopeId,
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
export const getScopeIdFromComponentId = (componentId?: string) =>
|
||||
componentId ? `${componentId}-scope` : undefined;
|
||||
export const getScopeIdFromComponentId = (componentId: string) =>
|
||||
`${componentId}-scope`;
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
|
||||
|
||||
export const getScopeIdOrUndefinedFromComponentId = (componentId?: string) =>
|
||||
componentId ? getScopeIdFromComponentId(componentId) : undefined;
|
||||
@ -0,0 +1,8 @@
|
||||
import { DefaultValue } from 'recoil';
|
||||
|
||||
export const guardRecoilDefaultValue = (
|
||||
candidate: any,
|
||||
): candidate is DefaultValue => {
|
||||
if (candidate instanceof DefaultValue) return true;
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user