- {!android &&
-
-
-
- }
{t('Settings.textEmptyScreens')}
:
@@ -42,4 +35,86 @@ const Navigation = props => {
)
}
-export default Navigation;
\ No newline at end of file
+const NavigationSheet = props => {
+ const { t } = useTranslation();
+ const api = Common.EditorApi.get();
+ const navigationObject = api.asc_ShowDocumentOutline();
+ const [currentPosition, setCurrentPosition] = useState(navigationObject.get_CurrentPosition());
+ const arrHeaders = props.updateNavigation();
+
+ const [stateHeight, setHeight] = useState('45%');
+ const [stateOpacity, setOpacity] = useState(1);
+
+ const [stateStartY, setStartY] = useState();
+ const [isNeedClose, setNeedClose] = useState(false);
+
+ const handleTouchStart = (event) => {
+ const touchObj = event.changedTouches[0];
+ setStartY(parseInt(touchObj.clientY));
+ };
+
+ const handleTouchMove = (event) => {
+ const touchObj = event.changedTouches[0];
+ const dist = parseInt(touchObj.clientY) - stateStartY;
+
+ if (dist < 0) {
+ setHeight('90%');
+ setOpacity(1);
+ setNeedClose(false);
+ } else if (dist < 80) {
+ setHeight('45%');
+ setOpacity(1);
+ setNeedClose(false);
+ } else {
+ setNeedClose(true);
+ setOpacity(0.6);
+ }
+ };
+
+ const handleTouchEnd = (event) => {
+ const touchObj = event.changedTouches[0];
+ const swipeEnd = parseInt(touchObj.clientY);
+ const dist = swipeEnd - stateStartY;
+
+ if (isNeedClose) {
+ f7.sheet.close('#view-navigation-sheet');
+ } else if (stateHeight === '90%' && dist > 20) {
+ setHeight('45%');
+ }
+ };
+
+ useEffect(() => {
+ props.closeModal();
+ f7.sheet.open('#view-navigation-sheet', true);
+ }, []);
+
+ return (
+