diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index 473d793..ef8fd11 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -7,14 +7,6 @@ import { useColorScheme } from "@/components/useColorScheme"; import { useClientOnlyValue } from "@/components/useClientOnlyValue"; import { TAB_CONFIG } from "@/constants/config"; -// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ -function TabBarIcon(props: { - name: React.ComponentProps['name']; - color: string; -}) { - return ; -} - export default function TabLayout() { const colorScheme = useColorScheme(); @@ -23,35 +15,21 @@ export default function TabLayout() { screenOptions={{ tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint, headerShown: useClientOnlyValue(false, true), - }}> - , - headerRight: () => ( - - - {({ pressed }) => ( - - )} - - - ), - }} - /> - , - }} - /> + }} + > + {TAB_CONFIG.map(({ name, title, Icon, IconFilled }) => ( + { + const IconComponent = focused ? IconFilled : Icon; + return ; + }, + }} + /> + ))} ); } diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 6cbee6d..92540e6 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -1,13 +1,19 @@ -import { StyleSheet } from 'react-native'; - -import EditScreenInfo from '@/components/EditScreenInfo'; -import { Text, View } from '@/components/Themed'; +import { StyleSheet } from "react-native"; +import { useTranslation } from "react-i18next"; +import EditScreenInfo from "@/components/EditScreenInfo"; +import { Text, View } from "@/components/Themed"; export default function TabOneScreen() { + const { t } = useTranslation(); return ( - Tab One - + {t("welcome")} + {t("change-language")} + ); @@ -16,16 +22,16 @@ export default function TabOneScreen() { const styles = StyleSheet.create({ container: { flex: 1, - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, title: { fontSize: 20, - fontWeight: 'bold', + fontWeight: "bold", }, separator: { marginVertical: 30, height: 1, - width: '80%', + width: "80%", }, }); diff --git a/app/(tabs)/my-battery.tsx b/app/(tabs)/my-battery.tsx new file mode 100644 index 0000000..d250141 --- /dev/null +++ b/app/(tabs)/my-battery.tsx @@ -0,0 +1,35 @@ +import { StyleSheet } from "react-native"; + +import EditScreenInfo from "@/components/EditScreenInfo"; +import { Text, View } from "@/components/Themed"; + +export default function MyBatteryTabScreen() { + return ( + + Coming Soon + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: "center", + justifyContent: "center", + }, + title: { + fontSize: 20, + fontWeight: "bold", + }, + separator: { + marginVertical: 30, + height: 1, + width: "80%", + }, +}); diff --git a/app/(tabs)/payments.tsx b/app/(tabs)/payments.tsx new file mode 100644 index 0000000..be2abdf --- /dev/null +++ b/app/(tabs)/payments.tsx @@ -0,0 +1,35 @@ +import { StyleSheet } from "react-native"; + +import EditScreenInfo from "@/components/EditScreenInfo"; +import { Text, View } from "@/components/Themed"; + +export default function PaymentsTabScreen() { + return ( + + Tab Two + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: "center", + justifyContent: "center", + }, + title: { + fontSize: 20, + fontWeight: "bold", + }, + separator: { + marginVertical: 30, + height: 1, + width: "80%", + }, +}); diff --git a/app/(tabs)/service.tsx b/app/(tabs)/service.tsx new file mode 100644 index 0000000..7348c24 --- /dev/null +++ b/app/(tabs)/service.tsx @@ -0,0 +1,35 @@ +import { StyleSheet } from "react-native"; + +import EditScreenInfo from "@/components/EditScreenInfo"; +import { Text, View } from "@/components/Themed"; + +export default function ServiceTabScreen() { + return ( + + Coming Soon + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: "center", + justifyContent: "center", + }, + title: { + fontSize: 20, + fontWeight: "bold", + }, + separator: { + marginVertical: 30, + height: 1, + width: "80%", + }, +}); diff --git a/app/(tabs)/two.tsx b/app/(tabs)/two.tsx deleted file mode 100644 index f2ea47e..0000000 --- a/app/(tabs)/two.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { StyleSheet } from 'react-native'; - -import EditScreenInfo from '@/components/EditScreenInfo'; -import { Text, View } from '@/components/Themed'; - -export default function TabTwoScreen() { - return ( - - Tab Two - - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, - title: { - fontSize: 20, - fontWeight: 'bold', - }, - separator: { - marginVertical: 30, - height: 1, - width: '80%', - }, -}); diff --git a/assets/icons/battery-filled.svg b/assets/icons/battery-filled.svg new file mode 100644 index 0000000..eedad12 --- /dev/null +++ b/assets/icons/battery-filled.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/battery.svg b/assets/icons/battery.svg new file mode 100644 index 0000000..6c485e9 --- /dev/null +++ b/assets/icons/battery.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/home-filled.svg b/assets/icons/home-filled.svg new file mode 100644 index 0000000..5f2d488 --- /dev/null +++ b/assets/icons/home-filled.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/home.svg b/assets/icons/home.svg new file mode 100644 index 0000000..c710b9d --- /dev/null +++ b/assets/icons/home.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/payments-filled.svg b/assets/icons/payments-filled.svg new file mode 100644 index 0000000..3d43a44 --- /dev/null +++ b/assets/icons/payments-filled.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/payments.svg b/assets/icons/payments.svg new file mode 100644 index 0000000..0d00a49 --- /dev/null +++ b/assets/icons/payments.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/service-filled.svg b/assets/icons/service-filled.svg new file mode 100644 index 0000000..09a7d28 --- /dev/null +++ b/assets/icons/service-filled.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/service.svg b/assets/icons/service.svg new file mode 100644 index 0000000..b07bec4 --- /dev/null +++ b/assets/icons/service.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/icon.png b/assets/images/icon.png index a0b1526..c2f4c20 100644 Binary files a/assets/images/icon.png and b/assets/images/icon.png differ diff --git a/assets/images/splash-icon.png b/assets/images/splash-icon.png index 03d6f6b..e51b79c 100644 Binary files a/assets/images/splash-icon.png and b/assets/images/splash-icon.png differ diff --git a/constants/config.ts b/constants/config.ts new file mode 100644 index 0000000..3072a9b --- /dev/null +++ b/constants/config.ts @@ -0,0 +1,50 @@ +import HomeIcon from "../assets/icons/home.svg"; +import HomeIconFilled from "../assets/icons/home-filled.svg"; +import PaymentsIcon from "../assets/icons/payments.svg"; +import PaymentsIconFilled from "../assets/icons/payments-filled.svg"; +import ServiceIcon from "../assets/icons/service.svg"; +import ServiceIconFilled from "../assets/icons/service-filled.svg"; +import BatteryIcon from "../assets/icons/battery.svg"; +import BatteryIconFilled from "../assets/icons/battery-filled.svg"; + +export const STORAGE_KEYS = { + LANGUAGE: "USER_LANGUAGE", + TOKEN: "AUTH_TOKEN", + THEME: "APP_THEME", +}; + +export const APP_CONFIG = { + DEFAULT_LANGUAGE: "en", + SUPPORTED_LANGUAGES: ["en", "hi"], +}; + +export const TAB_CONFIG = [ + { + name: "index", + title: "Home", + Icon: HomeIcon, + IconFilled: HomeIconFilled, + path: "/", + }, + { + name: "payments", + title: "Payments", + Icon: PaymentsIcon, + IconFilled: PaymentsIconFilled, + path: "/payments", + }, + { + name: "service", + title: "Service", + Icon: ServiceIcon, + IconFilled: ServiceIconFilled, + path: "/service", + }, + { + name: "my-battery", + title: "My Battery", + Icon: BatteryIcon, + IconFilled: BatteryIconFilled, + path: "/my-battery", + }, +];