@@ -28,14 +28,19 @@ 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+
33+ const storyMapPresentationMode = options . storyMapPresentationMode ?? false ;
3134 const tabInfo = [
32- ! settings . objectPropertiesDisabled && settings . storyMapPresentationDisabled
35+ ! settings . objectPropertiesDisabled && ! storyMapPresentationMode
3336 ? { name : 'objectProperties' , title : 'Object Properties' }
3437 : false ,
35- {
36- name : 'storyPanel' ,
37- title : displayEditor ? 'Story Editor' : 'Story Map' ,
38- } ,
38+ ! settings . storyMapsDisabled
39+ ? {
40+ name : 'storyPanel' ,
41+ title : displayEditor ? 'Story Editor' : 'Story Map' ,
42+ }
43+ : false ,
3944 ! settings . annotationsDisabled
4045 ? { name : 'annotations' , title : 'Annotations' }
4146 : false ,
@@ -45,7 +50,7 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
4550 ] . filter ( Boolean ) as { name : string ; title : string } [ ] ;
4651
4752 const [ curTab , setCurTab ] = React . useState < string > ( ( ) => {
48- if ( ! settings . storyMapPresentationDisabled ) {
53+ if ( ! settings . storyMapsDisabled ) {
4954 return 'storyPanel' ;
5055 }
5156 return tabInfo . length > 0 ? tabInfo [ 0 ] . name : '' ;
@@ -55,6 +60,9 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
5560 const onSettingsChanged = ( ) => {
5661 setSettings ( { ...props . model . jgisSettings } ) ;
5762 } ;
63+ const onOptionsChanged = ( ) => {
64+ setOptions ( { ...props . model . getOptions ( ) } ) ;
65+ } ;
5866 let currentlyIdentifiedFeatures : any = undefined ;
5967 const onAwerenessChanged = (
6068 _ : IJupyterGISModel ,
@@ -74,10 +82,12 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
7482 } ;
7583
7684 props . model . settingsChanged . connect ( onSettingsChanged ) ;
85+ props . model . sharedOptionsChanged . connect ( onOptionsChanged ) ;
7786 props . model . clientStateChanged . connect ( onAwerenessChanged ) ;
7887
7988 return ( ) => {
8089 props . model . settingsChanged . disconnect ( onSettingsChanged ) ;
90+ props . model . sharedOptionsChanged . disconnect ( onOptionsChanged ) ;
8191 props . model . clientStateChanged . disconnect ( onAwerenessChanged ) ;
8292 } ;
8393 } , [ props . model ] ) ;
@@ -136,25 +146,28 @@ export const RightPanel: React.FC<IRightPanelProps> = props => {
136146 </ TabsContent >
137147 ) }
138148
139- < TabsContent
140- value = "storyPanel"
141- className = "jgis-panel-tab-content"
142- style = { { paddingTop : 0 } }
143- >
144- < div style = { { padding : '0 0.5rem 0.5rem 0.5rem' } } >
145- { settings . storyMapPresentationDisabled && (
146- < PreviewModeSwitch
147- checked = { ! displayEditor }
148- onCheckedChange = { toggleEditor }
149- />
150- ) }
151- { ! settings . storyMapPresentationDisabled || ! displayEditor ? (
152- < StoryViewerPanel model = { props . model } />
153- ) : (
154- < StoryEditorPanel model = { props . model } />
155- ) }
156- </ div >
157- </ TabsContent >
149+ { ! settings . storyMapsDisabled && (
150+ < TabsContent
151+ value = "storyPanel"
152+ className = "jgis-panel-tab-content"
153+ style = { { paddingTop : 0 } }
154+ >
155+ < div style = { { padding : '0 0.5rem 0.5rem 0.5rem' } } >
156+ { /* Don't want to see the toggle switch in presentation mode */ }
157+ { ! storyMapPresentationMode && (
158+ < PreviewModeSwitch
159+ checked = { ! displayEditor }
160+ onCheckedChange = { toggleEditor }
161+ />
162+ ) }
163+ { storyMapPresentationMode || ! displayEditor ? (
164+ < StoryViewerPanel model = { props . model } />
165+ ) : (
166+ < StoryEditorPanel model = { props . model } />
167+ ) }
168+ </ div >
169+ </ TabsContent >
170+ ) }
158171
159172 { ! settings . annotationsDisabled && (
160173 < TabsContent value = "annotations" className = "jgis-panel-tab-content" >
0 commit comments