hide messageCard when there is no message to show on tablet

This commit is contained in:
ammarahm-ed
2021-02-23 12:44:59 +05:00
parent d0eb452123
commit 27558fb6d9

View File

@@ -39,7 +39,7 @@ const SimpleList = ({
}, },
}) => { }) => {
const [state] = useTracked(); const [state] = useTracked();
const {colors, deviceMode} = state; const {colors, deviceMode, messageBoardState} = state;
const [_loading, setLoading] = useState(true); const [_loading, setLoading] = useState(true);
const [dataProvider, setDataProvider] = useState( const [dataProvider, setDataProvider] = useState(
new DataProvider((r1, r2) => { new DataProvider((r1, r2) => {
@@ -67,7 +67,6 @@ const SimpleList = ({
setLoading(false); setLoading(false);
}, [listData, deviceMode]); }, [listData, deviceMode]);
const _onRefresh = async () => { const _onRefresh = async () => {
await Sync.run(); await Sync.run();
if (refreshCallback) { if (refreshCallback) {
@@ -86,7 +85,6 @@ const SimpleList = ({
return emptyData.getDataForIndex(index).type; return emptyData.getDataForIndex(index).type;
}, },
(type, dim) => { (type, dim) => {
switch (type) { switch (type) {
case 'empty': case 'empty':
dim.width = width; dim.width = width;
@@ -141,7 +139,13 @@ const SimpleList = ({
case 'MAIN_HEADER': case 'MAIN_HEADER':
dim.width = width; dim.width = width;
dim.height = dim.height =
dataType === 'search' ? 0 : DDS.isLargeTablet() ? 50 : 195; dataType === 'search'
? 0
: DDS.isLargeTablet()
? messageBoardState.visible
? 50
: 0
: 195;
break; break;
default: default:
dim.width = width; dim.width = width;