forked from Ivasoft/mattermost-mobile
* Started with bottom tabs layout * code clean up * Added animation to bottom tab bar * returns null if not focused * code clean up * Updating layout * Updated modal screen * Updated animation * Updated animation * Fix SafeArea on Home * A few clean ups * code clean up * Fix issue with navigation on Android * Use React Navigation in combination of RNN & create bottom tab bar * Set tab bar line separator height to 0.5 * Fix snapshot tests * Add home tab mention badge * Apply new themes * Home Tab badge * Remove unused constants Co-authored-by: Avinash Lingaloo <> Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
26 lines
769 B
TypeScript
26 lines
769 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {useEffect, useState} from 'react';
|
|
import {NativeModules, useWindowDimensions} from 'react-native';
|
|
|
|
import {Device} from '@constants';
|
|
|
|
const {MattermostManaged} = NativeModules;
|
|
const isRunningInSplitView = MattermostManaged.isRunningInSplitView;
|
|
|
|
export function useSplitView() {
|
|
const [isSplitView, setIsSplitView] = useState(false);
|
|
const dimensions = useWindowDimensions();
|
|
|
|
useEffect(() => {
|
|
if (Device.IS_TABLET) {
|
|
isRunningInSplitView().then((result: {isSplitView: boolean}) => {
|
|
setIsSplitView(result.isSplitView);
|
|
});
|
|
}
|
|
}, [dimensions]);
|
|
|
|
return isSplitView;
|
|
}
|