File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
// SPDX-License-Identifier: Apache-2.0
3
- import React , { createContext , useContext } from 'react' ;
3
+ import React , { useContext } from 'react' ;
4
4
5
5
import { SplitPanelFocusControlRefs } from '../../app-layout/utils/use-split-panel-focus-control' ;
6
+ import { awsuiPluginsInternal } from '../plugins/api' ;
6
7
7
8
export interface SplitPanelSideToggleProps {
8
9
displayed : boolean ;
@@ -38,12 +39,16 @@ export interface SplitPanelContextProps extends SplitPanelContextBaseProps {
38
39
animationDisabled ?: boolean ;
39
40
}
40
41
41
- const SplitPanelContext = createContext < SplitPanelContextProps | null > ( null ) ;
42
+ const AppLayoutWidgetSplitPanelContext =
43
+ awsuiPluginsInternal . sharedReactContexts . createContext < SplitPanelContextProps | null > (
44
+ React ,
45
+ 'AppLayoutWidgetSplitPanelContext'
46
+ ) ;
42
47
43
- export const SplitPanelContextProvider = SplitPanelContext . Provider ;
48
+ export const SplitPanelContextProvider = AppLayoutWidgetSplitPanelContext . Provider ;
44
49
45
50
export function useSplitPanelContext ( ) {
46
- const ctx = useContext ( SplitPanelContext ) ;
51
+ const ctx = useContext ( AppLayoutWidgetSplitPanelContext ) ;
47
52
if ( ! ctx ) {
48
53
throw new Error ( 'Split panel can only be used inside app layout' ) ;
49
54
}
You can’t perform that action at this time.
0 commit comments