-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettingsBar.tsx
More file actions
53 lines (49 loc) · 1.69 KB
/
SettingsBar.tsx
File metadata and controls
53 lines (49 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from "react";
import { View, Text, TouchableOpacity, useWindowDimensions } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { StatusBar } from "expo-status-bar";
import { useAuth } from "../context/Auth";
import { useNavigation } from "@react-navigation/native";
const BAR_BG = "#000000ff";
const CONTENT_MAX_W = 480; // ← same as forms
export default function SettingsBar() {
const { user, signOut } = useAuth();
const nav = useNavigation<any>();
const { width } = useWindowDimensions();
const isNarrow = width < 420; // stack buttons below on very small widths
const NOT_SIGNED_COLOR = BAR_BG;
const Btn = ({ title, onPress }: { title: string; onPress: () => void }) => (
<TouchableOpacity
onPress={onPress}
style={{
backgroundColor: "#fff",
paddingVertical: 8,
paddingHorizontal: 12,
borderRadius: 6,
borderWidth: 1,
}}
>
<Text style={{ fontWeight: "600" }}>{title}</Text>
</TouchableOpacity>
);
return (
<SafeAreaView edges={["top"]} style={{ backgroundColor: BAR_BG }}>
<StatusBar style="dark" backgroundColor={BAR_BG} />
<View style={{ backgroundColor: BAR_BG, paddingHorizontal: 12, paddingVertical: 10 }}>
<View style={{ alignItems: "center" }}>
<View style={{ width: "100%", maxWidth: CONTENT_MAX_W, gap: 8 }}>
<View
style={{
flexDirection: isNarrow ? "column" : "row",
alignItems: "center",
gap: 8,
flexWrap: "wrap",
}}
>
</View>
</View>
</View>
</View>
</SafeAreaView>
);
}