Chore: Evaluate ForwardLivechatView - TypeScript (#4126)
* Chore: Evaluate ForwardLivechatView - TypeScript * minor tweaks
This commit is contained in:
parent
a27d63c22e
commit
f04b15a432
|
@ -115,11 +115,7 @@ const ChatsStackNavigator = () => {
|
|||
component={NotificationPrefView}
|
||||
options={NotificationPrefView.navigationOptions}
|
||||
/>
|
||||
<ChatsStack.Screen
|
||||
name='ForwardLivechatView'
|
||||
component={ForwardLivechatView}
|
||||
options={ForwardLivechatView.navigationOptions}
|
||||
/>
|
||||
<ChatsStack.Screen name='ForwardLivechatView' component={ForwardLivechatView} />
|
||||
<ChatsStack.Screen name='LivechatEditView' component={LivechatEditView} options={LivechatEditView.navigationOptions} />
|
||||
<ChatsStack.Screen name='PickerView' component={PickerView} options={PickerView.navigationOptions} />
|
||||
<ChatsStack.Screen
|
||||
|
|
|
@ -158,11 +158,7 @@ const ModalStackNavigator = React.memo(({ navigation }: INavigation) => {
|
|||
component={NotificationPrefView}
|
||||
options={NotificationPrefView.navigationOptions}
|
||||
/>
|
||||
<ModalStack.Screen
|
||||
name='ForwardLivechatView'
|
||||
component={ForwardLivechatView}
|
||||
options={ForwardLivechatView.navigationOptions}
|
||||
/>
|
||||
<ModalStack.Screen name='ForwardLivechatView' component={ForwardLivechatView} />
|
||||
<ModalStack.Screen name='CannedResponsesListView' component={CannedResponsesListView} />
|
||||
<ModalStack.Screen name='CannedResponseDetail' component={CannedResponseDetail} />
|
||||
<ModalStack.Screen name='LivechatEditView' component={LivechatEditView} options={LivechatEditView.navigationOptions} />
|
||||
|
|
|
@ -4,13 +4,12 @@ import { StyleSheet, View } from 'react-native';
|
|||
import { useDispatch } from 'react-redux';
|
||||
|
||||
import { forwardRoom, ITransferData } from '../actions/room';
|
||||
import { themes } from '../lib/constants';
|
||||
import OrSeparator from '../containers/OrSeparator';
|
||||
import Input from '../containers/UIKit/MultiSelect/Input';
|
||||
import { IBaseScreen, IServerRoom } from '../definitions';
|
||||
import I18n from '../i18n';
|
||||
import { ChatsStackParamList } from '../stacks/types';
|
||||
import { withTheme } from '../theme';
|
||||
import { useTheme } from '../theme';
|
||||
import { IOptionsField } from './NotificationPreferencesView/options';
|
||||
import { Services } from '../lib/services';
|
||||
|
||||
|
@ -28,14 +27,15 @@ interface IParsedData {
|
|||
|
||||
const COUNT_DEPARTMENT = 50;
|
||||
|
||||
const ForwardLivechatView = ({ navigation, route, theme }: IBaseScreen<ChatsStackParamList, 'ForwardLivechatView'>) => {
|
||||
const ForwardLivechatView = ({ navigation, route }: IBaseScreen<ChatsStackParamList, 'ForwardLivechatView'>) => {
|
||||
const [departments, setDepartments] = useState<IParsedData[]>([]);
|
||||
const [departmentId, setDepartment] = useState('');
|
||||
const [departmentTotal, setDepartmentTotal] = useState(0);
|
||||
const [users, setUsers] = useState<IOptionsField[]>([]);
|
||||
const [userId, setUser] = useState();
|
||||
const [room, setRoom] = useState<IServerRoom>({} as IServerRoom);
|
||||
const [room, setRoom] = useState({} as IServerRoom);
|
||||
const dispatch = useDispatch();
|
||||
const { theme, colors } = useTheme();
|
||||
|
||||
const rid = route.params?.rid;
|
||||
|
||||
|
@ -149,7 +149,7 @@ const ForwardLivechatView = ({ navigation, route, theme }: IBaseScreen<ChatsStac
|
|||
};
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: themes[theme].auxiliaryBackground }]}>
|
||||
<View style={[styles.container, { backgroundColor: colors.auxiliaryBackground }]}>
|
||||
<Input onPress={onPressDepartment} placeholder={I18n.t('Select_a_Department')} theme={theme} />
|
||||
<OrSeparator theme={theme} />
|
||||
<Input onPress={onPressUser} placeholder={I18n.t('Select_a_User')} theme={theme} />
|
||||
|
@ -157,4 +157,4 @@ const ForwardLivechatView = ({ navigation, route, theme }: IBaseScreen<ChatsStac
|
|||
);
|
||||
};
|
||||
|
||||
export default withTheme(ForwardLivechatView);
|
||||
export default ForwardLivechatView;
|
||||
|
|
Loading…
Reference in New Issue