app layout

This commit is contained in:
2025-09-30 09:58:20 +02:00
parent dd8e8049c4
commit 3dcf5453ca
5 changed files with 153 additions and 146 deletions
+27 -27
View File
@@ -1,21 +1,19 @@
/* eslint-disable react/display-name */
import React, { useState, useEffect } from 'reactn';
import { setGlobal } from 'reactn';
import { Image, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { Motion } from '@legendapp/motion';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { Image, View } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { SafeAreaView } from "react-native-safe-area-context";
import React, { setGlobal, useEffect, useState } from "reactn";
import { responsiveHeight } from '../actions/responsiveSizes.js';
import { responsiveHeight } from "../actions/responsiveSizes.js";
import { Fonts, gutters } from '../styles';
import { gutters } from "../styles";
import BaseHeader from '../components/BaseHeader';
import NavigateHeader from '../components/NavigateHeader';
import BaseHeader from "../components/BaseHeader";
import NavigateHeader from "../components/NavigateHeader";
import { isDesktop, isWeb } from '../hooks/useLayoutType.js';
import { useUserData } from '../providers/UserDataProvider.js';
import { background } from '../assets/index.js';
import { background } from "../assets/index.js";
import { isDesktop, isWeb } from "../hooks/useLayoutType.js";
import { useUserData } from "../providers/UserDataProvider.js";
export default ({
children,
@@ -23,11 +21,11 @@ export default ({
topStickyContent = null,
bottomStickyContent = null,
title = '',
title = "",
rightComponent = null,
containerType = 'SAFE_AREA_VIEW',
headerType = 'BASE',
containerType = "SAFE_AREA_VIEW",
headerType = "BASE",
containerStyle = {},
headerStyle = {},
@@ -45,7 +43,7 @@ export default ({
const [scrollPosition, setScrollPosition] = useState(0);
const PageContainer =
containerType === 'SAFE_AREA_VIEW' ? SafeAreaView : View;
containerType === "SAFE_AREA_VIEW" ? SafeAreaView : View;
const ContentContainer = scrollEnabled ? KeyboardAwareScrollView : View;
@@ -68,24 +66,25 @@ export default ({
{!isWeb && (
<Image
source={backgroundImg}
style={{ width: '100%', height: '100%', position: 'absolute' }}
style={{ width: "100%", height: "100%", position: "absolute" }}
/>
)}
<PageContainer
{...(containerType === 'SAFE_AREA_VIEW' ? { edges: ['top'] } : {})}
{...(containerType === "SAFE_AREA_VIEW" ? { edges: ["top"] } : {})}
style={{
height: '100%',
height: "100%",
paddingTop: isWeb ? gutters / 2 : 0,
padding: gutters,
paddingBottom: 0,
...(isWeb ? { maxHeight: '100vh', width: '100%' } : {}),
...(isWeb ? { maxHeight: "100vh", width: "100%" } : {}),
...(!currentUID && isDesktop
? { maxWidth: 500, alignSelf: 'center' }
? { maxWidth: 500, alignSelf: "center" }
: {}),
...containerStyle,
}}>
{headerType !== 'NONE' ? (
headerType === 'BASE' ? (
}}
>
{headerType !== "NONE" ? (
headerType === "BASE" ? (
<BaseHeader containerStyle={{ ...headerStyle }} />
) : (
<NavigateHeader
@@ -109,9 +108,10 @@ export default ({
scrollEventThrottle: 80,
showsVerticalScrollIndicator: false,
contentContainerStyle: { paddingBottom: responsiveHeight(55) },
keyboardDismissMode: 'on-drag',
keyboardDismissMode: "on-drag",
}
: {})}>
: {})}
>
{children}
</ContentContainer>
</PageContainer>