@@ -28,8 +28,10 @@ interface IRightPanelProps {
2828export const RightPanel : React . FC < IRightPanelProps > = props => {
2929 const [ displayEditor , setDisplayEditor ] = React . useState ( true ) ;
3030 const [ settings , setSettings ] = React . useState ( props . model . jgisSettings ) ;
31+ const [ options , setOptions ] = React . useState ( props . model . getOptions ( ) ) ;
32+ const storyMapPresentation = options . storyMapPresentation ?? false ;
3133 const tabInfo = [
32- ! settings . objectPropertiesDisabled && settings . storyMapPresentationDisabled
34+ ! settings . objectPropertiesDisabled && ! storyMapPresentation
3335 ? { name : 'objectProperties' , title : 'Object Properties' }
3436 : false ,
3537 {
@@ -45,7 +47,7 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
4547 ] . filter ( Boolean ) as { name : string ; title : string } [ ] ;
4648
4749 const [ curTab , setCurTab ] = React . useState < string > ( ( ) => {
48- if ( ! settings . storyMapPresentationDisabled ) {
50+ if ( storyMapPresentation ) {
4951 return 'storyPanel' ;
5052 }
5153 return tabInfo . length > 0 ? tabInfo [ 0 ] . name : '' ;
@@ -55,6 +57,9 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
5557 const onSettingsChanged = ( ) => {
5658 setSettings ( { ...props . model . jgisSettings } ) ;
5759 } ;
60+ const onOptionsChanged = ( ) => {
61+ setOptions ( { ...props . model . getOptions ( ) } ) ;
62+ } ;
5863 let currentlyIdentifiedFeatures : any = undefined ;
5964 const onAwerenessChanged = (
6065 _ : IJupyterGISModel ,
@@ -74,10 +79,12 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
7479 } ;
7580
7681 props . model . settingsChanged . connect ( onSettingsChanged ) ;
82+ props . model . sharedOptionsChanged . connect ( onOptionsChanged ) ;
7783 props . model . clientStateChanged . connect ( onAwerenessChanged ) ;
7884
7985 return ( ) => {
8086 props . model . settingsChanged . disconnect ( onSettingsChanged ) ;
87+ props . model . sharedOptionsChanged . disconnect ( onOptionsChanged ) ;
8188 props . model . clientStateChanged . disconnect ( onAwerenessChanged ) ;
8289 } ;
8390 } , [ props . model ] ) ;
@@ -142,13 +149,13 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
142149 style = { { paddingTop : 0 } }
143150 >
144151 < div style = { { padding : '0 0.5rem 0.5rem 0.5rem' } } >
145- { settings . storyMapPresentationDisabled && (
152+ { ! storyMapPresentation && (
146153 < PreviewModeSwitch
147154 checked = { ! displayEditor }
148155 onCheckedChange = { toggleEditor }
149156 />
150157 ) }
151- { ! settings . storyMapPresentationDisabled || ! displayEditor ? (
158+ { storyMapPresentation || ! displayEditor ? (
152159 < StoryViewerPanel model = { props . model } />
153160 ) : (
154161 < StoryEditorPanel model = { props . model } />
0 commit comments