Skip to content

Commit

Permalink
[FIX] Picker without results
Browse files Browse the repository at this point in the history
  • Loading branch information
djorkaeffalexandre committed Apr 7, 2020
1 parent 6ba96c1 commit 4691190
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/ForwardLivechatView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ForwardLivechatView = ({ navigation, theme }) => {
const [departmentId, setDepartment] = useState();
const [users, setUsers] = useState([]);
const [userId, setUser] = useState();
const [room, setRoom] = useState({});
const [room, setRoom] = useState();

const rid = navigation.getParam('rid');

Expand Down
18 changes: 16 additions & 2 deletions app/views/PickerView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, FlatList, StyleSheet } from 'react-native';
import {
View, FlatList, StyleSheet, Text
} from 'react-native';

import I18n from '../i18n';
import { themedHeader } from '../utils/navigation';
Expand All @@ -21,6 +23,16 @@ const styles = StyleSheet.create({
search: {
width: '100%',
height: 56
},
noResult: {
fontSize: 16,
paddingVertical: 56,
...sharedStyles.textAlignCenter,
...sharedStyles.textSemibold
},
withoutBorder: {
borderBottomWidth: 0,
borderTopWidth: 0
}
});

Expand Down Expand Up @@ -109,12 +121,14 @@ class PickerView extends React.PureComponent {
/>
)}
ItemSeparatorComponent={() => <Separator theme={theme} />}
ListEmptyComponent={() => <Text style={[styles.noResult, { color: themes[theme].titleText }]}>{I18n.t('No_results_found')}</Text>}
contentContainerStyle={[
sharedStyles.listContentContainer,
{
backgroundColor: themes[theme].auxiliaryBackground,
borderColor: themes[theme].separatorColor
}
},
!data.length && styles.withoutBorder
]}
style={{ backgroundColor: themes[theme].auxiliaryBackground }}
/>
Expand Down

0 comments on commit 4691190

Please sign in to comment.