Refactor/context and scopes (#1602)
* Put onImport in a context * Refactored RecoilScopeContexts * Refactored naming * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -16,7 +16,7 @@ type OwnProps = {
|
||||
|
||||
export function ActivityAssigneeEditableField({ activity }: OwnProps) {
|
||||
return (
|
||||
<RecoilScope SpecificContext={FieldRecoilScopeContext}>
|
||||
<RecoilScope CustomRecoilScopeContext={FieldRecoilScopeContext}>
|
||||
<RecoilScope>
|
||||
<EditableField
|
||||
customEditHotkeyScope={{
|
||||
|
||||
@ -21,7 +21,7 @@ type OwnProps = {
|
||||
|
||||
export function ActivityRelationEditableField({ activity }: OwnProps) {
|
||||
return (
|
||||
<RecoilScope SpecificContext={FieldRecoilScopeContext}>
|
||||
<RecoilScope CustomRecoilScopeContext={FieldRecoilScopeContext}>
|
||||
<RecoilScope>
|
||||
<EditableField
|
||||
useEditButton
|
||||
|
||||
@ -12,7 +12,7 @@ const meta: Meta<typeof TaskGroups> = {
|
||||
decorators: [ComponentWithRouterDecorator, ComponentWithRecoilScopeDecorator],
|
||||
parameters: {
|
||||
msw: graphqlMocks,
|
||||
recoilScopeContext: TasksRecoilScopeContext,
|
||||
customRecoilScopeContext: TasksRecoilScopeContext,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ const meta: Meta<typeof TaskGroups> = {
|
||||
decorators: [ComponentWithRouterDecorator, ComponentWithRecoilScopeDecorator],
|
||||
parameters: {
|
||||
msw: graphqlMocks,
|
||||
recoilScopeContext: TasksRecoilScopeContext,
|
||||
customRecoilScopeContext: TasksRecoilScopeContext,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ const StyledContainer = styled.div`
|
||||
export function EntityTasks({ entity }: { entity: ActivityTargetableEntity }) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<RecoilScope SpecificContext={TasksRecoilScopeContext}>
|
||||
<RecoilScope CustomRecoilScopeContext={TasksRecoilScopeContext}>
|
||||
<TaskGroups entity={entity} showAddButton />
|
||||
</RecoilScope>
|
||||
</StyledContainer>
|
||||
|
||||
@ -27,7 +27,7 @@ export function PageAddTaskButton() {
|
||||
}
|
||||
|
||||
return (
|
||||
<RecoilScope SpecificContext={DropdownRecoilScopeContext}>
|
||||
<RecoilScope CustomRecoilScopeContext={DropdownRecoilScopeContext}>
|
||||
<PageAddButton onClick={handleClick} />
|
||||
</RecoilScope>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user