Skip to content

Commit 1346a3c

Browse files
authored
Merge pull request #8 from afnx/feature/browser-screen
Feature/browser screen
2 parents 2f63f4a + 6128469 commit 1346a3c

12 files changed

Lines changed: 569 additions & 79 deletions

File tree

package-lock.json

Lines changed: 39 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
},
1414
"dependencies": {
1515
"@expo/vector-icons": "^15.0.2",
16+
"@react-native-community/blur": "^4.4.1",
1617
"@react-navigation/bottom-tabs": "^7.4.0",
1718
"@react-navigation/elements": "^2.6.3",
1819
"@react-navigation/native": "^7.1.8",
1920
"@reduxjs/toolkit": "^2.9.0",
2021
"expo": "~54.0.13",
2122
"expo-constants": "~18.0.9",
22-
"expo-dev-client": "~6.0.15",
23+
"expo-dev-client": "~6.0.16",
2324
"expo-font": "~14.0.9",
2425
"expo-haptics": "~15.0.7",
2526
"expo-image": "~3.0.9",
@@ -34,6 +35,7 @@
3435
"react-dom": "19.1.0",
3536
"react-native": "0.81.4",
3637
"react-native-gesture-handler": "~2.28.0",
38+
"react-native-keyboard-controller": "^1.19.2",
3739
"react-native-reanimated": "~4.1.1",
3840
"react-native-safe-area-context": "~5.6.0",
3941
"react-native-screens": "~4.16.0",

src/app/_layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Stack } from "expo-router";
44
import { StatusBar } from "expo-status-bar";
55
import React from "react";
66
import { ActivityIndicator, Text, View } from "react-native";
7+
import { KeyboardProvider } from "react-native-keyboard-controller";
78
import { SafeAreaProvider } from "react-native-safe-area-context";
89
import { Provider } from "react-redux";
910
import { PersistGate } from "redux-persist/integration/react";
@@ -40,7 +41,9 @@ export default function RootLayout() {
4041
<Provider store={store}>
4142
<PersistGate loading={<LoadingComponent />} persistor={persistor}>
4243
<ThemeProvider>
43-
<AppContent />
44+
<KeyboardProvider>
45+
<AppContent />
46+
</KeyboardProvider>
4447
</ThemeProvider>
4548
</PersistGate>
4649
</Provider>

src/app/index.tsx

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,5 @@
1-
import { useSettings } from "@/src/features/settings/hooks/useSettings";
2-
import { useTheme } from "@/src/theme/useTheme";
3-
import { Pressable, Text, View } from "react-native";
1+
import BrowserScreen from "@/src/features/browser/screens/BrowserScreen";
42

53
export default function Index() {
6-
const theme = useTheme();
7-
const settings = useSettings();
8-
9-
return (
10-
<View
11-
style={{
12-
flex: 1,
13-
justifyContent: "center",
14-
alignItems: "center",
15-
backgroundColor: theme.colors.background,
16-
}}
17-
>
18-
<Text
19-
style={{
20-
...theme.typography.h4,
21-
color: theme.colors.warning,
22-
}}
23-
>
24-
The current theme color is {theme.name}.{"\n"}
25-
The current theme mode is {settings.theme}.
26-
</Text>
27-
<Pressable onPress={() => settings.switchTheme("system")}>
28-
<Text
29-
style={{
30-
...theme.typography.button,
31-
color: theme.colors.textPrimary,
32-
}}
33-
>
34-
System Theme
35-
</Text>
36-
</Pressable>
37-
<Pressable onPress={() => settings.switchTheme("light")}>
38-
<Text
39-
style={{
40-
...theme.typography.button,
41-
color: theme.colors.textPrimary,
42-
}}
43-
>
44-
Light Theme
45-
</Text>
46-
</Pressable>
47-
<Pressable onPress={() => settings.switchTheme("dark")}>
48-
<Text
49-
style={{
50-
...theme.typography.button,
51-
color: theme.colors.textPrimary,
52-
}}
53-
>
54-
Dark Theme
55-
</Text>
56-
</Pressable>
57-
</View>
58-
);
4+
return <BrowserScreen />;
595
}

src/components/IconButton.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { Icon, IconSizes } from "@/src/constants/Icons";
2+
import { Ionicons } from "@expo/vector-icons";
3+
import { ColorValue, Pressable, StyleSheet, ViewStyle } from "react-native";
4+
5+
interface IconButtonProps {
6+
icon: Icon;
7+
size?: number;
8+
color?: ColorValue;
9+
disabled?: boolean;
10+
accessibilityLabel?: string;
11+
style?: ViewStyle;
12+
onPress?: () => void;
13+
}
14+
15+
export default function IconButton({
16+
icon,
17+
size = IconSizes.medium,
18+
color = "#000",
19+
disabled = false,
20+
accessibilityLabel,
21+
style,
22+
onPress,
23+
}: IconButtonProps) {
24+
return (
25+
<Pressable
26+
style={({ pressed }) => [
27+
styles.button,
28+
style,
29+
disabled && styles.disabled,
30+
pressed && !disabled && styles.pressed,
31+
]}
32+
onPress={onPress}
33+
disabled={disabled}
34+
accessibilityRole="button"
35+
accessibilityLabel={accessibilityLabel}
36+
>
37+
<Ionicons name={icon} size={size} color={color} />
38+
</Pressable>
39+
);
40+
}
41+
42+
const styles = StyleSheet.create({
43+
button: {
44+
padding: 8,
45+
borderRadius: 20,
46+
alignItems: "center",
47+
justifyContent: "center",
48+
},
49+
disabled: {
50+
opacity: 0.4,
51+
},
52+
pressed: {
53+
opacity: 0.7,
54+
},
55+
});
56+
57+
export { IconSizes };

src/constants/Icons.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export const Icons = {
2727
secure: "lock-closed" as const,
2828
insecure: "warning" as const,
2929
search: "search" as const,
30+
microphone: "mic-outline" as const,
31+
deleteInput: "close-circle" as const,
32+
readerOutline: "reader-outline" as const,
3033

3134
// Tab management
3235
closeTab: "close" as const,
@@ -54,8 +57,8 @@ export const Icons = {
5457
textSize: "text" as const,
5558

5659
// Bookmarks and favorites
57-
bookmark: "bookmark-outline" as const,
58-
bookmarkFilled: "bookmark" as const,
60+
bookmark: "book-outline" as const,
61+
bookmarkFilled: "book" as const,
5962
star: "star-outline" as const,
6063
starFilled: "star" as const,
6164

0 commit comments

Comments
 (0)