session-desktop/ts/components/SessionMainPanel.tsx
Audric Ackermann 28c7445dce
refactor most of the components to outside of their Session folder (#2072)
* refactor most of the components to outside of their Session folder

* finish moving overlay and memberListItem to react hook

* fix bug with kicked member len >2 not being displayed

also sort admins first in UpdateGroupMembers dialog

* fix admin leaving text of groupNotification

* add a useFocusMount hook to focus input fields on mount

* make click avatar convo item open only user dialog

* cleanup config default.json

* make sure to use convoController to build sync message

* disable showing pubkey on opengroups

* add a pause on audio playback

Fixes #2079
2021-12-14 15:15:12 +11:00

26 lines
891 B
TypeScript

import React from 'react';
import { useSelector } from 'react-redux';
import { useAppIsFocused } from '../hooks/useAppFocused';
import { getFocusedSettingsSection } from '../state/selectors/section';
import { SmartSessionConversation } from '../state/smart/SessionConversation';
import { SessionSettingsView } from './settings/SessionSettings';
const FilteredSettingsView = SessionSettingsView as any;
export const SessionMainPanel = () => {
const focusedSettingsSection = useSelector(getFocusedSettingsSection);
const isSettingsView = focusedSettingsSection !== undefined;
// even if it looks like this does nothing, this does update the redux store.
useAppIsFocused();
if (isSettingsView) {
return <FilteredSettingsView category={focusedSettingsSection} />;
}
return (
<div className="session-conversation">
<SmartSessionConversation />
</div>
);
};