Skip to content

Commit 2bb20cc

Browse files
authored
Build (#4)
* stable for build * design bug fixed
1 parent 23aff48 commit 2bb20cc

File tree

7 files changed

+55
-51
lines changed

7 files changed

+55
-51
lines changed

App.jsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createNativeStackNavigator } from "@react-navigation/native-stack";
2+
import { SafeAreaProvider } from "react-native-safe-area-context";
23
import { NavigationContainer } from "@react-navigation/native";
34
import { openDatabase } from "./src/functions/functions";
45
import { AppProvider } from "./src/Contexts/Contexts";
@@ -30,14 +31,16 @@ export default function App() {
3031
if (!appReady) return <SplashScreen />;
3132

3233
return (
33-
<AppProvider>
34-
<NavigationContainer>
35-
<Stack.Navigator screenOptions={{ headerShown: false }}>
36-
<Stack.Screen name="Home" component={Home} />
37-
<Stack.Screen name="Details" component={Details} />
38-
<Stack.Screen name="History" component={History} />
39-
</Stack.Navigator>
40-
</NavigationContainer>
41-
</AppProvider>
34+
<SafeAreaProvider style={{backgroundColor: ""}}>
35+
<AppProvider>
36+
<NavigationContainer>
37+
<Stack.Navigator screenOptions={{ headerShown: false }}>
38+
<Stack.Screen name="Home" component={Home} />
39+
<Stack.Screen name="Details" component={Details} />
40+
<Stack.Screen name="History" component={History} />
41+
</Stack.Navigator>
42+
</NavigationContainer>
43+
</AppProvider>
44+
</SafeAreaProvider>
4245
);
4346
}

assets/favicon.png

1.32 KB
Loading

assets/splash.png

21.7 KB
Loading

src/components/Navbar.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import { useSafeAreaInsets } from "react-native-safe-area-context";
12
import { Feather, Ionicons } from "@expo/vector-icons";
23
import { Pressable, View, Text } from "react-native";
34
import { StyleSheet } from "react-native";
45

56
export default function Navbar({ brand, navigation }) {
7+
const insets = useSafeAreaInsets();
8+
69
return (
7-
<View style={styles.navbar}>
10+
<View style={[styles.navbar, {paddingTop: insets.top}]}>
811
{brand ? (
912
<Text style={styles.brand}>ForgeScan</Text>
1013
) : (
@@ -23,7 +26,6 @@ const styles = StyleSheet.create({
2326
navbar: {
2427
display: "flex",
2528
alignItems: "flex-end",
26-
paddingTop: 50,
2729
flexDirection: "row",
2830
justifyContent: "space-between",
2931
},

src/screens/Details.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const styles = StyleSheet.create({
116116
},
117117
responseContainer: {
118118
flex: 1,
119-
padding: 20,
119+
paddingHorizontal: 20,
120120
gap: 10,
121121
},
122122
responseSubContainer: {

src/screens/History.jsx

+38-37
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from "@expo/vector-icons";
1212

1313
import AlertBox from "../components/AlertBox";
14+
import { useSafeAreaInsets } from "react-native-safe-area-context";
1415

1516
const db = SQLite.openDatabase("myDatabase.db");
1617

@@ -26,6 +27,8 @@ export default function Home({ navigation }) {
2627
color: null,
2728
});
2829

30+
const insets = useSafeAreaInsets();
31+
2932
const handleCheckbox = () => {
3033
if (isCheck) {
3134
setCheck(false);
@@ -125,48 +128,48 @@ export default function Home({ navigation }) {
125128

126129
return (
127130
<View style={styles.container}>
128-
<View style={styles.responseContainer}>
129-
<View style={styles.headerContainer}>
130-
<Text
131-
style={{
132-
fontSize: 20,
133-
}}
134-
>
135-
History
136-
</Text>
131+
<View style={[styles.headerContainer, { paddingTop: 50 }]}>
132+
<Text
133+
style={{
134+
fontSize: 20,
135+
}}
136+
>
137+
History
138+
</Text>
137139

138-
<View style={{ flexDirection: "row", gap: 16, alignItems: "center" }}>
139-
{isDelete ? (
140-
<Pressable onPress={handleAllDelete}>
141-
<MaterialIcons name="delete-forever" size={24} color="black" />
142-
</Pressable>
140+
<View style={{ flexDirection: "row", gap: 16, alignItems: "center" }}>
141+
{isDelete ? (
142+
<Pressable onPress={handleAllDelete}>
143+
<MaterialIcons name="delete-forever" size={24} color="black" />
144+
</Pressable>
145+
) : (
146+
<MaterialIcons
147+
name="delete-forever"
148+
size={24}
149+
color="black"
150+
style={{ opacity: 0.3 }}
151+
/>
152+
)}
153+
<View style={{ borderWidth: 1, opacity: 0.1, height: "50%" }} />
154+
<Pressable onPress={handleCheckbox}>
155+
{isCheck ? (
156+
<MaterialIcons name="check-box" size={24} color="black" />
143157
) : (
144158
<MaterialIcons
145-
name="delete-forever"
159+
name="check-box-outline-blank"
146160
size={24}
147161
color="black"
148-
style={{ opacity: 0.3 }}
149162
/>
150163
)}
151-
<View style={{ borderWidth: 1, opacity: 0.1, height: "50%" }} />
152-
<Pressable onPress={handleCheckbox}>
153-
{isCheck ? (
154-
<MaterialIcons name="check-box" size={24} color="black" />
155-
) : (
156-
<MaterialIcons
157-
name="check-box-outline-blank"
158-
size={24}
159-
color="black"
160-
/>
161-
)}
162-
</Pressable>
163-
</View>
164+
</Pressable>
164165
</View>
165-
{alertBox.message && (
166-
<View style={{ marginTop: -10 }}>
167-
<AlertBox message={alertBox.message} color={alertBox.color} />
168-
</View>
169-
)}
166+
</View>
167+
{alertBox.message && (
168+
<View style={{ marginTop: -10 }}>
169+
<AlertBox message={alertBox.message} color={alertBox.color} />
170+
</View>
171+
)}
172+
<View style={styles.responseContainer}>
170173
<ScrollView>
171174
<View style={styles.responseSubContainer}>
172175
{historyDb &&
@@ -232,7 +235,6 @@ const styles = StyleSheet.create({
232235
borderBottomWidth: 2,
233236
borderColor: "#CED0FF",
234237
padding: 20,
235-
paddingTop: 60,
236238
},
237239
footer: {},
238240
actionsContainer: {
@@ -249,15 +251,14 @@ const styles = StyleSheet.create({
249251
iconContainer: {},
250252
responseContainer: {
251253
flex: 1,
252-
// padding: 20,
253254
gap: 10,
254255
},
255256
responseSubContainer: {
256257
flex: 1,
257-
paddingHorizontal: 20,
258258
paddingBottom: 100,
259259
gap: 5,
260260
overflow: "scroll",
261+
padding: 10
261262
},
262263
primeAction: {
263264
padding: 10,

src/screens/Home.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ export default function Home({ navigation }) {
6969

7070
return (
7171
<View style={styles.container}>
72-
<Navbar brand={true} navigation={navigation} />
73-
7472
{alertBox && <AlertBox message={alertBox} />}
7573

7674
{isFocus && <Cam flash={flashlightOn ? 2 : 0} zoom={value} />}

0 commit comments

Comments
 (0)