@@ -14,6 +14,7 @@ import {
14
14
FeedbackPopup ,
15
15
} from './Feedback' ;
16
16
import { SettingsPopup } from './Settings' ;
17
+ import { AboutPopup } from './About' ;
17
18
import { HoverButton } from './Controls' ;
18
19
19
20
enum ChatSource {
@@ -104,9 +105,12 @@ function Chat({entries, humanText, onPrompt, clearConversation}: ChatProps): JSX
104
105
const chatHistory = React . useContext ( ChatHistoryContext ) ;
105
106
const [ showFeedbackPopup , setShowFeedbackPopup ] = React . useState ( false ) ;
106
107
const [ showSettingsPopup , setShowSettingsPopup ] = React . useState ( false ) ;
108
+ const [ showAboutPopup , setShowAboutPopup ] = React . useState ( false ) ;
107
109
const [ feedbackIsPositive , setFeedbackIsPositive ] = React . useState ( false ) ;
108
110
const scrollViewRef : React . RefObject < ScrollView > = React . useRef ( null ) ;
109
111
112
+ let showingAnyPopups = ( showFeedbackPopup || showSettingsPopup || showAboutPopup ) ;
113
+
110
114
const feedbackContext = {
111
115
showFeedback : ( positive : boolean ) => {
112
116
setFeedbackIsPositive ( positive ) ;
@@ -174,7 +178,7 @@ function Chat({entries, humanText, onPrompt, clearConversation}: ChatProps): JSX
174
178
disableCopy = { true }
175
179
contentShownOnHover = {
176
180
< >
177
- < HoverButton content = "❔" tooltip = "About" onPress = { ( ) => console . log ( "About dialog: Not yet implemented" ) } />
181
+ < HoverButton content = "❔" tooltip = "About" onPress = { ( ) => setShowAboutPopup ( true ) } />
178
182
< HoverButton content = "⚙️" tooltip = "Settings" onPress = { ( ) => setShowSettingsPopup ( true ) } />
179
183
</ >
180
184
} >
@@ -187,14 +191,17 @@ function Chat({entries, humanText, onPrompt, clearConversation}: ChatProps): JSX
187
191
clearConversation = { clearConversation } />
188
192
</ HumanSection >
189
193
</ View >
190
- { ( showFeedbackPopup || showSettingsPopup ) && < View style = { styles . popupBackground } /> }
194
+ { showingAnyPopups && < View style = { styles . popupBackground } /> }
191
195
< FeedbackPopup
192
196
show = { showFeedbackPopup }
193
197
isPositive = { feedbackIsPositive }
194
198
close = { ( ) => setShowFeedbackPopup ( false ) } />
195
199
< SettingsPopup
196
200
show = { showSettingsPopup }
197
201
close = { ( ) => setShowSettingsPopup ( false ) } />
202
+ < AboutPopup
203
+ show = { showAboutPopup }
204
+ close = { ( ) => setShowAboutPopup ( false ) } />
198
205
</ View >
199
206
</ ChatScrollContext . Provider >
200
207
</ FeedbackContext . Provider >
0 commit comments