add a way to click the toast to turn on microphone to show the settings
							parent
							
								
									f4fb56d9ed
								
							
						
					
					
						commit
						eb30c7823c
					
				| @ -0,0 +1,42 @@ | |||||||
|  | import React from 'react'; | ||||||
|  | 
 | ||||||
|  | import { DefaultTheme } from 'styled-components'; | ||||||
|  | import { SmartSessionConversation } from '../state/smart/SessionConversation'; | ||||||
|  | import { | ||||||
|  |   SessionSettingCategory, | ||||||
|  |   SmartSettingsView, | ||||||
|  | } from './session/settings/SessionSettings'; | ||||||
|  | 
 | ||||||
|  | const FilteredSettingsView = SmartSettingsView as any; | ||||||
|  | 
 | ||||||
|  | interface Props { | ||||||
|  |   focusedSettingsSection?: SessionSettingCategory; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export class SessionMainPanel extends React.Component<Props> { | ||||||
|  |   public constructor(props: Props) { | ||||||
|  |     super(props); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   public render() { | ||||||
|  |     const isSettingsView = this.props.focusedSettingsSection !== undefined; | ||||||
|  | 
 | ||||||
|  |     return isSettingsView | ||||||
|  |       ? this.renderSettings() | ||||||
|  |       : this.renderSessionConversation(); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   private renderSettings() { | ||||||
|  |     const category = this.props.focusedSettingsSection; | ||||||
|  | 
 | ||||||
|  |     return <FilteredSettingsView category={category} />; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   private renderSessionConversation() { | ||||||
|  |     return ( | ||||||
|  |       <div className="session-conversation"> | ||||||
|  |         <SmartSessionConversation /> | ||||||
|  |       </div> | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | import { connect } from 'react-redux'; | ||||||
|  | import { StateType } from '../reducer'; | ||||||
|  | 
 | ||||||
|  | import { mapDispatchToProps } from '../actions'; | ||||||
|  | import { getFocusedSettingsSection } from '../selectors/section'; | ||||||
|  | import { getTheme } from '../selectors/theme'; | ||||||
|  | import { SessionMainPanel } from '../../components/SessionMainPanel'; | ||||||
|  | 
 | ||||||
|  | const mapStateToProps = (state: StateType) => { | ||||||
|  |   return { | ||||||
|  |     theme: getTheme(state), | ||||||
|  |     focusedSettingsSection: getFocusedSettingsSection(state), | ||||||
|  |   }; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | const smart = connect(mapStateToProps, mapDispatchToProps); | ||||||
|  | 
 | ||||||
|  | export const SmartSessionMainPanel = smart(SessionMainPanel); | ||||||
					Loading…
					
					
				
		Reference in New Issue