Add Authentik sign-in, fix tab scroll insets, and polish multi-account auth.
Mobile app detects SSO per server, supports OAuth sign-in, and preserves saved sessions when adding accounts. Tab screens get proper chrome layout and tab-bar clearance with scrollable page headers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { useScrollToTop } from "expo-router";
|
||||
import { useRef, type ReactNode } from "react";
|
||||
import { Platform, ScrollView, type ScrollViewProps, StyleSheet, View } from "react-native";
|
||||
|
||||
import { tabLayout } from "@/lib/tab-layout";
|
||||
import { useTabBarScrollPadding } from "@/lib/tab-bar-insets";
|
||||
import { useTabScreenScrollPadding } from "@/lib/tab-bar-insets";
|
||||
|
||||
type TabScrollViewProps = ScrollViewProps & {
|
||||
/** Rendered above screen body — scrolls under the blurred top chrome. */
|
||||
/** Rendered at the top of scroll content (scrolls with the page). */
|
||||
header?: ReactNode;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
/** Scroll view for native tab screens — content scrolls under the tab bar. */
|
||||
/**
|
||||
* Tab screen scroll view. Top chrome (logo / account) is pinned in TabPage;
|
||||
* the page header and body scroll together here.
|
||||
*/
|
||||
export function TabScrollView({
|
||||
header,
|
||||
children,
|
||||
@@ -18,18 +22,22 @@ export function TabScrollView({
|
||||
style,
|
||||
...props
|
||||
}: TabScrollViewProps) {
|
||||
const scrollPadding = useTabBarScrollPadding();
|
||||
const scrollRef = useRef<ScrollView>(null);
|
||||
const bottomPadding = useTabScreenScrollPadding();
|
||||
|
||||
useScrollToTop(scrollRef);
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
ref={scrollRef}
|
||||
style={[styles.scroll, style]}
|
||||
contentContainerStyle={[
|
||||
tabLayout.scrollContent,
|
||||
{ paddingBottom: scrollPadding },
|
||||
{ paddingBottom: bottomPadding },
|
||||
contentContainerStyle,
|
||||
]}
|
||||
contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "never" : undefined}
|
||||
scrollIndicatorInsets={{ bottom: scrollPadding }}
|
||||
scrollIndicatorInsets={{ bottom: bottomPadding }}
|
||||
{...props}
|
||||
>
|
||||
{header}
|
||||
@@ -41,6 +49,7 @@ export function TabScrollView({
|
||||
const styles = StyleSheet.create({
|
||||
scroll: {
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
backgroundColor: "transparent",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user