feat(overlays): add/remove overlay from store
1 unresolved thread
1 unresolved thread
Description
This PR focuses on adding functionality to manage overlayBioEntity state for multiple overlays. Bio entities are stored under key-value pairs as follows:
export type OverlaysBioEntityState = { overlaysId: number[]; data: { [overlayId: number]: { [modelId: number]: OverlayBioEntityRender[]; }; }; };
This way it's easier to add and remove new overlays.
Things done
- store management - adding / removing new overlays
- toggling on/off overlays in drawer -> currently displays only first overlay
Things to consider during code review
OverlayListItem covers test cases for useOverlay
hook.
Edited by Tadeusz Miesiąc
Merge request reports
Activity
Filter activity
added 1 commit
- 56bb144c - feat(overlays): add/remove overlay from store
1 import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; 2 import { useAppSelector } from '@/redux/hooks/useAppSelector'; 3 import { isOverlayActiveSelector } from '@/redux/overlayBioEntity/overlayBioEntity.selector'; 4 import { removeOverlayBioEntityForGivenOverlay } from '@/redux/overlayBioEntity/overlayBioEntity.slice'; 5 import { getOverlayBioEntityForAllModels } from '@/redux/overlayBioEntity/overlayBioEntity.thunk'; 6 import { useEmptyBackground } from './useEmptyBackground'; 7 8 type UseOverlay = { 9 toggleOverlay: () => void; 10 isOverlayActive: boolean; 11 }; 12 13 export const useOverlay = (overlayId: number): UseOverlay => { mentioned in commit e461460d
Please register or sign in to reply